Showing posts with label patch. Show all posts
Showing posts with label patch. Show all posts

Upstream Convergence - STA Patterns in Android and Chromium (2026)

Saturday, September 05, 2026

Upstream Convergence — STA Patterns in Android & Chromium (2026)

This article documents a series of upstream commits in Android, AndroidX, and Chromium during 2026 that implement defensive measures around the same Binder/IPC boundaries identified by the Structured Text Amplification (STA) research. While no commit explicitly references STA, the functional convergence is substantial.


1. The Pattern

The STA model describes a recurring architectural failure: structured input → serialisation → Binder/IPC → uncaught exception → crash or ANR. Over the course of 2026, multiple upstream projects have introduced mitigations that directly address this class of problem.

What follows is a non‑exhaustive but representative list of commits that target exactly the surfaces documented in the STA whitepaper.


2. Upstream Mitigations — A Family of Defences

Component Commit / Change Mechanism Date STA Relation
AOSP InputMethod a438ce172b441c8297eadde8d990ab292f5aa7d1 Introduces InputMethodSubtypeSafeList (and AbstractSafeList) to avoid TransactionTooLargeException when large lists are passed over Binder. 7 Jan 2026 (merge) Precedent: changing representation to escape Binder (byte[]/writeBlob)
AndroidX Credential Manager 393e20ae2c23c509df55058e5d7a3157a749e03b Implements LargePayloadSupport: serialises Bundle to temporary file, passes ParcelFileDescriptor instead of raw data. Triggers for responses >200 KB. 8 Apr 2026 Architectural: large IPC → FD
Chromium PDF Selection 84b615a07fc14988b46f0e362502ab4075216793 Refactors and exposes an existing MAX_SHARE_QUERY_LENGTH = 100000 safeguard (already present in SelectionPopupControllerImpl) into SelectionUtils for PDF selection (Share / Search / Translate). Note: the CL was reverted ~1.5h later for an Android Lint issue; the underlying 100 KB limit predates this commit. 5 May 2026 Architecturally related to STA-007 (PDF → Select All → Translate). Shows that Chromium treats selection size as a safety property of the Intent boundary.
AndroidX NotificationCompat 90ffa6a7b02aeefa8f38dc1e54f5740adc18e832 Fixes a TransactionTooLargeException caused by oversized images in compatibility extras. Prevents oversized compat extras from replacing already-resized native extras. 11 May 2026 Architectural: structured extras → Binder → TLE
AndroidX PdfView 8882927e7d41e678c6f03f50d4bd5950e7dc6c47 Fixes TransactionTooLargeException in onSaveInstanceState() by replacing full SelectionModel (>1.2 MB) with lightweight anchor points (~44 bytes) when crossing Binder. 14 Jul 2026 Strong architectural convergence: Class A (SavedState / large structured state → Binder → TLE → placeholder → async restoration).
Chromium Oversized Clipboard 4751a7699c8653c5a944152a4fd78fe97e878885 Adds support for “pasting oversized HTML payloads” via ContentProvider URIs instead of direct transport. Defends against confused deputy attacks. 24 Aug 2026 Architecturally related to STA-011 (Clipboard → assisted paste). Large text/HTML → redirected transport.
Chromium Native Messaging (redesign) f5c51669e832d97728da04c79dd426ac2aa49a60 Changes message representation from String to Union(byte[], SharedMemory). Explicitly targets messages that may exceed the 1 MB Binder limit and cause TransactionTooLargeException. 26 Aug 2026 Strong architectural convergence: redesigning the transport boundary itself (SharedMemory).
Chromium Native Messaging (telemetry) 931ee1abb38c9781b5b1470ba64c99afb198ed64 Adds telemetry for SentMessageSize and explicitly distinguishes TransactionTooLargeException as a failure mode. 1 Sep 2026 Strong: explicit instrumentation of the same boundary failure.

Note: None of these commits mention STA or the STA whitepaper. They are presented here as convergent engineering — independent mitigations that address the same class of problems documented by the STA research.


3. STA-007: A Clean Upstream Echo

The STA-007 vector describes a chain:

Google Drive → PDF with invisible text → Select All → Translate → TransactionTooLargeException

Chromium’s May 2026 commit (84b615a) does not introduce the 100 KB limit — it reuses and exposes an existing safeguard already present in SelectionPopupControllerImpl. The commit message explicitly references Android Intent size limits (~1 MB) as the reason for the limit.

This is not proof that Chromium acted on STA-007. But the functional alignment is so precise that an engineer reading both documents would immediately recognise the same boundary. The key observation is that Chromium was already treating selection text size as a safety property of the Intent boundary, before the STA research was published.


4. The Asymmetry: libminikin Remains Unaddressed

While multiple upstream projects have implemented defences around Binder/IPC boundaries, no equivalent global length gate has been found in libminikin for the line‑breaking path documented in STA‑017.

  • getPrevWordBreakForCache() still performs backwards scans without a hard input‑length guard.
  • The investigated optimal line-breaking path (LineBreakOptimizer::computeBreaks()) retains nested candidate-processing loops, but no public global input-length gate comparable to the IPC safeguards above was identified.
  • Only a specific hyphenation safeguard exists (words longer than 45 characters), which does not cover the general case.

Key observation: A concentrated set of mitigations is visible around serialisation, clipboard, IPC, and persistence boundaries — while the text‑layout path (libminikin) has not received the same treatment.

4.1 Why libminikin Might Be Different

Unlike Binder/IPC boundaries, which have clear size limits (1 MB) and can be instrumented or redirected, libminikin is a native layout engine with deep roots in Android’s text rendering pipeline. A hard global length gate in computeBreaks() would affect all text rendering — not just URLs or structured payloads — making it a more complex change to validate without breaking existing applications.

This does not excuse the absence of a defence, but it helps explain why the asymmetry exists.


5. Temporal Context

The commits listed above span from November 2025 to September 2026. The STA whitepaper was published on 30 July 2026.

This timeline reveals two distinct waves:

  • Before July 2026: SafeList, LargePayloadSupport, NotificationCompat, and the PDF selection refactor all predate the STA whitepaper. They show that upstream projects were already treating oversized structured payloads as a reliability/security concern.
  • After July 2026: Oversized clipboard (24 Aug), SharedMemory redesign (26 Aug), and TLE telemetry (1 Sep) occur after the STA research became public. They address surfaces that the STA whitepaper explicitly documented.

This distribution makes the hypothesis “all these changes are a reaction to STA” unsustainable. But it also makes a different claim stronger:

“STA was published during a period when upstream was already moving toward explicit size controls, alternative representation, and payload isolation at Binder boundaries. After publication, that trend continued and added changes to surfaces specifically documented by STA.”


6. Summary: Mitigated vs. Unmitigated Surfaces

Surface Mitigation Visible? Mechanism
InputMethod → Binder (large lists) ✅ Yes SafeList → byte[]/writeBlob
Large IPC (Credential Manager) ✅ Yes LargePayloadSupport (FD)
PDF → Share / Search / Translate ✅ Yes Truncation (100 KB limit, refactored into SelectionUtils)
NotificationCompat (oversized images) ✅ Yes Prevents oversized compat extras from replacing native ones
SavedState (PdfView) ✅ Yes Anchor points (~44 bytes) + async restoration
Oversized Clipboard ✅ Yes ContentProvider URI
Native Messaging ✅ Yes SharedMemory + telemetry
libminikin (LineBreakOptimizer) ❌ Not found No global length gate in the investigated path

7. What This Convergence Means

The upstream commits listed above represent a family of defensive engineering decisions, all targeting the same underlying problem:

Large structured payload → Binder/IPC → TransactionTooLargeException → Crash or ANR

The mitigations vary by component, but they follow a consistent pattern:

  • Constrain: limit input size before it reaches the boundary (Chromium PDF selection).
  • Redirect: move payload out of Binder (LargePayloadSupport → FD; Oversized Clipboard → ContentProvider).
  • Replace: replace full state with lightweight placeholders (PdfView → anchor points).
  • Observe: instrument the failure to understand its prevalence (Native Messaging telemetry).

The strongest evidence is not that individual fixes resemble individual STA vectors. It is that multiple upstream projects independently apply the same defensive principle: constrain, redirect, replace, or observe data before an oversized structured payload becomes a failure at an IPC boundary.


8. Conclusion

The STA model identified an architectural pattern: structured input that crosses Binder/IPC boundaries without size validation can cause persistent crashes and ANRs. The upstream commits documented in this article show that:

  1. Multiple components (AndroidX, AOSP, Chromium) have introduced mitigations at exactly those boundaries.
  2. The timing (2026) and the mechanisms (constrain, redirect, replace, observe) align with the surfaces described in the STA whitepaper.
  3. No causal link is claimed — but the functional convergence is substantial and observable.
  4. libminikin remains an outlier, with no visible global length gate for the investigated line‑breaking path.

Whether this convergence is coincidental or a response to the STA research is not something this article can determine. What is clear is that the industry is moving toward defensive patterns that match the STA diagnosis — and that the asymmetry with libminikin persists.


STA: 48 Hours Later – The Chrome Correlation and the VRP Case Status

Saturday, August 01, 2026

STA: 48 Hours Later – The Chrome Correlation and the VRP Case Status

Published on July 31, 2026 · Post‑whitepaper update
馃敆馃搳馃З STA – Chrome Alignment Map
Shared architectural surfaces between the whitepaper and the July 2026 patches

These are not the same bugs. What we are seeing is a shared architectural surface:

STA-020 remains unpatched for four years.

  • Chrome patched its own side of the pipeline — Print Preview, Clipboard, Views, Skia, WebView, UI.
  • Android still has the same architectural pipeline exposed, with no public fixes for libminikin, SystemUI, or FragmentManager.restoreAllState().

The patches in Chrome exist. The same pipelines surfaces in Android remain open.

The Chrome fixes are public. Equivalent Android architectural surfaces remain publicly unpatched, based on the information available at the time of writing. This suggests that the underlying architectural bottlenecks identified by STA remain relevant and deserve further scrutiny.


馃搫 Full whitepaper: lostmon.blogspot.com
#STA #AndroidSecurity #Chrome

It has been 48 hours since the publication of the Structured Text Amplification (STA) whitepaper.

But the most interesting development happened over the last two days. Chrome’s July fixes harden several components that sit on the same processing paths STA describes (clipboard, print/preview, views/UI, WebView, document/Drive flows). Those are shared surfaces. The concrete Chrome CVEs are mostly memory-safety or validation bugs in the browser; STA documents missing limits and safe degradation on the Android framework side of related pipelines (Binder/SavedState, SystemUI, libminikin). Same corridor, different failure modes — and the framework side still has no public STA mitigations.

The Alignment Map: Chrome CVEs vs. STA

The table below correlates Chrome CVEs with the STA pipelines/vectors documented in the whitepaper. Confidence levels are indicated with traffic‑light markers:

  • 馃煝 High: The component is identical to or directly implements the same surface described in STA.
  • 馃煛 Medium: The component shares the same architectural pipeline, but the exact failure mode may differ.
  • ⚪ Low: Conceptually related but not directly comparable.
Chrome CVE Component Potential STA Vector Confidence Rationale
CVE-2026-17679 Print Preview STA-010 馃煝 High Both involve document/text processing before printing.
CVE-2026-17766 Clipboard STA-011 馃煝 High Clipboard handling is explicitly part of the STA surface.
CVE-2026-17670 Views STA-020 馃煝 High Views is the UI layer where much of the STA pipeline terminates.
CVE-2026-17699 Views STA-020 馃煝 High Same architectural layer.
CVE-2026-17702 Skia STA-017 馃煝 High Skia is part of the graphics pipeline downstream from libminikin.
CVE-2026-17745 Skia STA-017 馃煝 High Same graphics pipeline.
CVE-2026-17757 Skia STA-017 馃煝 High Same graphics pipeline.
CVE-2026-15766 Skia STA-017 馃煛 Medium Another recent Skia issue in the same rendering path.
CVE-2026-17698 UI STA-017 / STA-020 馃煛 Medium The UI layer processes structured text before rendering it.
CVE-2026-17722 WebView STA-027 (general) 馃煛 Medium WebView participates in several propagation scenarios described in STA.
CVE-2026-17690 PDF STA Document Pipeline 馃煛 Medium Document processing with structured input.
CVE-2026-17803 Save to Drive STA Deep Link / Drive 馃煛 Medium Similar to the Drive → Chrome → Android propagation chain.
Methodological note: I am not asserting that these CVEs are the same bugs as the STA vectors. I am identifying functional overlap in the processing pipelines (Views, Skia, Clipboard, Print Preview, WebView, UI) that intersect with the surfaces described in the whitepaper.

Google Knew, and Google Patched (but Not on Android)

What makes this table significant is not any single CVE, but the recurring pattern across the Chrome fixes from May and June 2026:

  • “Insufficient validation of untrusted input” in Print Preview
  • “Insufficient validation of untrusted input” in Clipboard
  • “Use after free” in Views
  • “Inappropriate implementation” in Skia
  • “Use after free” in UI / Input
  • “Object lifecycle issue” in WebView

Google patched its own browser to protect it from flaws that are structurally identical to those I documented in Android. Yet the July Android Security Bulletin (published July 6) contained no patches for any of these surfaces.

The conclusion is clear: Google has the internal fix (AOSP CL 3989977). It patched Chrome. But the base platform — the one used by 2.5 billion devices — remains exposed.

Status of the VRP Case (A-477279924)

The VRP case A-477279924 remains open, blocked on internal dependency 477593694 (which, based on all available evidence, corresponds to AOSP CL 3989977). I have added the correlation table as a comment in that case, along with the following note:

“I am sharing this in case it helps accelerate internal triage or identifies surfaces that may still require backporting to the Android framework. This is intended as a triage aid, not as a claim of direct causation.”

Now the ball is in Google’s court. They have the fix. They patched Chrome. And they know exactly where the architectural overlap lies.

What This Means for Users

  • No public patch for Android as of today (July 31, 2026). The next security bulletin is August 3.
  • If Google does not include these fixes in August, the media pressure will intensify.
  • Blog de‑indexation (from ~200 pages to just 4 indexed) remains unexplained.

The Full Whitepaper

All technical details, stack traces, vector tables, and patch recommendations are available in the full whitepaper:

馃搫 Read the whitepaper

libminikin: 10 a帽os de vulnerabilidad en el n煤cleo de Android

Friday, July 10, 2026
libminikin: "Un comportamiento heredado del motor de composici贸n de texto de Android"
An谩lisis forense del c贸digo fuente de AOSP · 6 archivos · 5 capas vulnerables · Una d茅cada de deuda t茅cnica

馃搶 Este art铆culo es una extensi贸n de mi an谩lisis original: "Algorithmic DoS en libminikin.so – C贸mo un texto de 70 KB puede congelar casi cualquier app Android" (24 de junio de 2026).

馃敟 10 A脩OS. 10 ARCHIVOS. MAS DE 5 CAPAS VULNERABLES.

El an谩lisis del c贸digo fuente de Android (AOSP) confirma que libminikin.so tiene un fallo de dise帽o sist茅mico presente desde 2013.

  • 10 archivos vulnerables en el repositorio de AOSP
  • 5 capas del pipeline de texto sin validaci贸n de entrada
  • 10 a帽os de deuda t茅cnica documentada (2013 → 2026)
  • 2.500 millones de dispositivos en riesgo
  • Google lo sabe desde 2016 (CVE-2016-2414) y no lo ha arreglado

1. Resumen ejecutivo

Desde la publicaci贸n del art铆culo original sobre el Algorithmic DoS en libminikin.so, he continuado investigando el c贸digo fuente de Android (AOSP) para comprender la magnitud real del problema.

Lo que he encontrado es m谩s grave de lo que imaginaba. No se trata de un bug aislado en una funci贸n concreta. Es un fallo de dise帽o sist茅mico presente en 6 archivos diferentes, distribuido en 5 capas del pipeline de texto, y que ha estado en el repositorio de AOSP desde 2013.


2. Issues p煤blicos de Google (2020–2026)

La siguiente tabla recopila los issues p煤blicos del Google Issue Tracker que documentan problemas en libminikin y el pipeline de texto de Android. Todos ellos fueron cerrados sin una soluci贸n estructural.

Issue A帽o Descripci贸n Estado Enlace
#161830416 2020 Crash en LayoutCache::getOrCreate con traza completa (FreeType → Minikin → HarfBuzz) Won't Fix Ver issue
#167014931 2020 Crash por Float.POSITIVE_INFINITY en LayoutPiece::LayoutPiece Fixed Ver issue
#188985643 2021 SIGSEGV en FontFamily::getClosestMatch en Samsung Galaxy J6+ con fuente personalizada Won't Fix Ver issue
#40268980 (Chromium 1447465) 2023 ANR en Chrome por LayoutCache::getOrCreate reportado por ingeniero de Samsung Won't Fix Ver issue
#477202817 2026 Reporte formal al Chrome VRP — DoS persistente por URL larga. Cerrado como "Intended Behavior" Won't Fix Ver issue
#524288518 2026 Reporte espec铆fico de libminikin al Android VRP — cerrado como "out of scope" Out of Scope (interno de Google)
#531319203 Jul 2026 system_server boot loop por imagen grande en BitmapCache — mismo patr贸n Assigned Ver issue

馃敶 Patr贸n com煤n: Google ha cerrado sistem谩ticamente estos reportes sin abordar la causa ra铆z. Solo ha arreglado el caso trivial (#167014931) porque el trigger era evidente (Float.POSITIVE_INFINITY).


3. An谩lisis del c贸digo fuente: 6 archivos vulnerables

He analizado el c贸digo fuente de Minikin en el repositorio de AOSP (frameworks/minikin/) y he identificado seis archivos clave que contienen vulnerabilidades de dise帽o.

Archivo A帽o Problema principal Funci贸n vulnerable
FontFamily.cpp 2013 Punteros nulos en getClosestMatch getClosestMatch()
Layout.cpp 2013 Procesa directamente textos largos sin cach茅 doLayoutWord()
OptimalLineBreaker.cpp 2015 Knuth-Plass O(n²) sin l铆mites computeBreaks()
GreedyLineBreaker.cpp 2017 Algoritmo voraz O(n²) en el peor caso processLineBreak()
LineBreaker.cpp 2018 Decisi贸n entre algoritmos sin validar longitud breakIntoLines()
LayoutCache.h 2018 Cach茅 sin l铆mite de tama帽o por entrada getOrCreate()

4. Funciones vulnerables y c贸digo exacto

4.1 LineBreaker::breakIntoLines — Sin validaci贸n de longitud

Archivo: frameworks/minikin/libs/minikin/LineBreaker.cpp (2018)

LineBreakResult breakIntoLines(const U16StringPiece& textBuffer, BreakStrategy strategy,
                               HyphenationFrequency frequency, bool justified,
                               const MeasuredText& measuredText, const LineWidth& lineWidth,
                               const TabStops& tabStops, bool useBoundsForWidth) {
    if (strategy == BreakStrategy::Greedy || textBuffer.hasChar(CHAR_TAB)) {
        return breakLineGreedy(textBuffer, measuredText, lineWidth, tabStops,
                               frequency != HyphenationFrequency::None, useBoundsForWidth);
    } else {
        return breakLineOptimal(textBuffer, measuredText, lineWidth, strategy, frequency, justified,
                                useBoundsForWidth);
    }
}

馃敶 Vulnerabilidad: No hay comprobaci贸n de textBuffer.size(). Si el texto es de 70KB, se ejecuta breakLineOptimal o breakLineGreedy sin l铆mite.

4.2 OptimalLineBreaker::computeBreaks — O(n²) sin l铆mites

Archivo: frameworks/minikin/libs/minikin/OptimalLineBreaker.cpp (2015)

LineBreakResult LineBreakOptimizer::computeBreaks(const OptimizeContext& context,
                                                  const U16StringPiece& textBuf,
                                                  const MeasuredText& measuredText,
                                                  const LineWidth& lineWidth,
                                                  BreakStrategy strategy, bool justified,
                                                  bool useBoundsForWidth) {
    // ... algoritmo de programaci贸n din谩mica Knuth-Plass
    // SIN validaci贸n de longitud de entrada
    // Complejidad O(n²) en el peor caso
}

Pero hay un matiz que el c贸digo revela: hay una poda activa (active = j + 1) y una optimizaci贸n bestHope expl铆citamente comentada como tal: Cpp Esto significa que el algoritmo no es un O(n²) puro sin ninguna mitigaci贸n — tiene un mecanismo de poda que en la pr谩ctica reduce trabajo cuando delta mayor que 0 (la l铆nea se desborda), avanzando el puntero active. El peor caso te贸rico sigue siendo O(n²) (cuando casi todos los candidatos permanecen "activos" simult谩neamente, como pasar铆a con una URL sin espacios donde casi cualquier punto de ruptura es candidato).

if (jScore + bestHope >= best) continue;

馃敶 Vulnerabilidad: El algoritmo Knuth-Plass tiene complejidad O(n²). Para 70.000 caracteres, son ~4.9 mil millones de operaciones.

4.3 GreedyLineBreaker::processLineBreak — Bucles anidados

Archivo: frameworks/minikin/libs/minikin/GreedyLineBreaker.cpp (2017)

void GreedyLineBreaker::processLineBreak(uint32_t offset, WordBreaker* breaker,
                                         bool doHyphenation) {
    while (isWidthExceeded() || overhangExceedLineLimit(Range(getPrevLineBreakOffset(), offset))) {
        if (tryLineBreakWithWordBreak()) {
            continue;  // El bucle puede ejecutarse muchas veces
        }
        if (doHyphenation && tryLineBreakWithHyphenation(...)) {
            // ...
        }
    }
}

馃敶 Vulnerabilidad: Bucle while con llamadas a funciones que recorren el texto. Complejidad O(n²) en el peor caso.

4.4 LayoutCache::getOrCreate — Procesamiento directo sin cach茅

Archivo: frameworks/minikin/include/minikin/LayoutCache.h (2018)

template <typename F>
void getOrCreate(const U16StringPiece& text, const Range& range, const MinikinPaint& paint,
                 bool dir, StartHyphenEdit startHyphen, EndHyphenEdit endHyphen,
                 bool boundsCalculation, F& f) {
    LayoutCacheKey key(text, range, paint, dir, startHyphen, endHyphen);
    if (range.getLength() >= CHAR_LIMIT_FOR_CACHE) {
        // ¡PROCESAMIENTO DIRECTO! SIN CACH脡 → BLOQUEO UI
        LayoutPiece piece(text, range, dir, paint, startHyphen, endHyphen);
        // ...
        return;
    }
    // ...
}

馃敶 Vulnerabilidad: Los textos largos no se almacenan en cach茅. Se procesan desde cero cada vez que se renderizan.


5. El pipeline completo: 5 capas de fragilidad

1. LineBreaker.cpp (2018) — breakIntoLines()
   └── Decide entre Greedy y Optimal SIN validar longitud
         │
2. OptimalLineBreaker.cpp (2015) / GreedyLineBreaker.cpp (2017)
   └── Algoritmo O(n²) SIN l铆mites de entrada
         │
3. Layout.cpp (2013) — doLayoutWord()
   └── Llama a LayoutCache SIN verificar tama帽o
         │
4. LayoutCache.h (2018) — getOrCreate()
   └── Si texto > CHAR_LIMIT_FOR_CACHE → procesa DIRECTAMENTE
         │
5. HarfBuzz (hb_shape)
   └── Renderizado de glifos → O(n²) o peor
         │
         ▼
   UI BLOQUEADA (5-16 segundos)

馃敶 Todas las capas son vulnerables. Ninguna valida la longitud del texto de entrada.


馃 El Pipeline de Amplificaci贸n de Minikin: Anatom铆a de un Fallo de Dise帽o de 13 A帽os

Aqu铆 profundizo en el pipeline completo y en c贸mo cada capa amplifica el payload hasta convertir 70KB en un bloqueo de 16 segundos.


El motor de layout de texto de Android (Minikin) contiene un fallo de dise帽o sist茅mico que permite que un texto de tan solo 70.000 caracteres (aproximadamente 70KB) bloquee el hilo de interfaz de usuario durante 5-16 segundos, provocando ANR en cualquier aplicaci贸n que muestre texto sin truncar.

El problema no reside en una 煤nica funci贸n, sino en m谩s de 10 archivos y 15 funciones que conforman el pipeline de procesamiento de texto. Cada capa del pipeline amplifica el coste computacional sin aplicar ning煤n tipo de validaci贸n de longitud o l铆mite de entrada.

馃敶 Dato clave: El c贸digo m谩s antiguo data de 2013. Google ha tenido m谩s de 13 a帽os para arreglar esto.


馃 El esquema de amplificaci贸n: 10 capas de fragilidad

Un texto de 70KB con una estructura espec铆fica (/code> repetido) activa una cascada de amplificaci贸n en la que cada capa del pipeline multiplica el coste computacional:

70KB de entrada
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 1: LineBreaker.cpp (2018)                              │
 │ breakIntoLines() decide entre Greedy y Optimal             │
 │ SIN validar longitud → pasa 70KB al siguiente paso          │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 2: OptimalLineBreaker.cpp (2015) / GreedyLineBreaker  │
 │ computeBreaks() / processLineBreak()                       │
 │ Algoritmo O(n²) → 70.000² = 4.900.000.000 iteraciones      │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 3: Layout.cpp (2013)                                   │
 │ doLayoutWord() llama a LayoutCache SIN verificar tama帽o    │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 4: LayoutCache.h (2018)                                │
 │ getOrCreate(): si texto > CHAR_LIMIT_FOR_CACHE             │
 │ → procesa DIRECTAMENTE, sin cach茅                         │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 5: LayoutCore.cpp (2018)                               │
 │ LayoutPiece() constructor → hb_shape (HarfBuzz)            │
 │ HarfBuzz tiene complejidad O(n²) o peor                    │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 6: Hyphenator.cpp (2015)                               │
 │ hyphenateFromCodes() → bucles anidados O(n²)               │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 7: Measurement.cpp (2015)                              │
 │ getOffsetForAdvance() / distributeAdvances() → O(n²)       │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 8: WordBreaker.cpp (2015)                              │
 │ detectEmailOrUrl() / findNextBreakInEmailOrUrl() → O(n)   │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 9: FontCollection.cpp (2013)                           │
 │ getGlyphScore() → llama a hb_shape() nuevamente           │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
 ┌─────────────────────────────────────────────────────────────┐
 │ CAPA 10: FontFamily.cpp (2013)                              │
 │ getClosestMatch() → punteros nulos → SIGSEGV               │
 └─────────────────────────────────────────────────────────────┘
      │
      ▼
   馃敟 UI BLOQUEADA (5-16 segundos)

馃敶 10 capas. 10 archivos. Ninguna valida la longitud del texto de entrada.


馃搨 Tabla completa de archivos y funciones vulnerables

Archivo A帽o Funci贸n Complejidad Problema
LineBreaker.cpp2018breakIntoLines()O(1)No valida longitud de entrada
OptimalLineBreaker.cpp2015computeBreaks()O(n²)Knuth-Plass sin l铆mites
GreedyLineBreaker.cpp2017processLineBreak()O(n²)Bucles anidados sin l铆mites
Layout.cpp2013doLayoutWord()O(n)Llama a LayoutCache sin verificar tama帽o
LayoutCache.h2018getOrCreate()O(n)CHAR_LIMIT_FOR_CACHE → procesa directamente
LayoutCore.cpp2018LayoutPiece()O(n²)Llama a hb_shape (HarfBuzz) sin l铆mites
Hyphenator.cpp2015hyphenateFromCodes()O(n²)Bucles anidados sin l铆mites
Measurement.cpp2015getOffsetForAdvance()O(n²)Bucles anidados sin l铆mites
Measurement.cpp2015distributeAdvances()O(n²)Bucles anidados sin l铆mites
WordBreaker.cpp2015detectEmailOrUrl()O(n)Recorre texto sin l铆mites
WordBreaker.cpp2015findNextBreakInEmailOrUrl()O(n)Recorre texto sin l铆mites
FontCollection.cpp2013getGlyphScore()O(n²)Llama a hb_shape sin l铆mites
FontCollection.cpp2013itemize()O(n)Recorre texto sin l铆mites
FontFamily.cpp2013getClosestMatch()O(n)Puntero nulo → SIGSEGV

馃搳 10 archivos. 15 funciones. 10 a帽os de c贸digo vulnerable. 13 a帽os desde el primer archivo.


馃敩 Amplificaci贸n paso a paso: C贸mo 70KB pieden convertirse en 5 mil millones de operaciones

Paso 1: Entrada (70KB)

El payload es una URL de 70.000 caracteres con el patr贸n [PAYLOAD] repetido:

https://example.com/[PAYLOAD]

Paso 2: LineBreaker::breakIntoLines (2018)

if (strategy == BreakStrategy::Greedy || textBuffer.hasChar(CHAR_TAB)) {
    return breakLineGreedy(...);   // ← No hay validaci贸n de longitud
} else {
    return breakLineOptimal(...);  // ← Tampoco hay validaci贸n
}

Amplificaci贸n: Decide el algoritmo sin comprobar la longitud del texto.

Paso 3: OptimalLineBreaker::computeBreaks (2015) — O(n²)

LineBreakResult LineBreakOptimizer::computeBreaks(...) {
    // ... algoritmo de programaci贸n din谩mica Knuth-Plass
    // SIN validaci贸n de longitud de entrada
    // Complejidad O(n²) en el peor caso
}

Amplificaci贸n: Para n=70.000 → 4.900.000.000 iteraciones.

Paso 4: Layout::doLayoutWord (2013)

float Layout::doLayoutWord(...) {
    // ...
    LayoutCache::getInstance().getOrCreate(textBuf, range, paint, isRtl, startHyphen, endHyphen,
                                           boundsCalculation, f);
    // ...
}

Amplificaci贸n: Llama a LayoutCache sin verificar el tama帽o del texto.

Paso 5: LayoutCache::getOrCreate (2018)

if (range.getLength() >= CHAR_LIMIT_FOR_CACHE) {
    LayoutPiece piece(text, range, dir, paint, startHyphen, endHyphen);
    // PROCESAMIENTO DIRECTO → SIN CACH脡 → BLOQUEO UI
    return;
}

Amplificaci贸n: Los textos largos no se almacenan en cach茅. Se procesan desde cero cada vez.

Paso 6: LayoutPiece constructor (2018)

LayoutPiece::LayoutPiece(...) {
    // ...
    hb_shape(hbFont.get(), buffer.get(), features.empty() ? NULL : &features[0],
             features.size());
    // ...
}

Amplificaci贸n: hb_shape (HarfBuzz) puede tener complejidad O(n²) o peor.

Paso 7: Hyphenator::hyphenateFromCodes (2015)

void HyphenatorCXX::hyphenateFromCodes(...) const {
    for (size_t i = 0; i < len - 1; i++) {
        for (size_t j = i; j < len; j++) {
            // BUCLES ANIDADOS SIN L脥MITES
        }
    }
}

Amplificaci贸n: Bucles anidados O(n²) que se ejecutan para cada palabra.

Paso 8: Measurement::getOffsetForAdvance / distributeAdvances (2015)

size_t getOffsetForAdvance(...) {
    for (size_t i = start; i < max; i++) { /* ... */ }
    for (size_t i = searchStart; i <= max; i++) { /* ... */ }
}

Amplificaci贸n: Bucles anidados O(n²) en el peor caso.

Paso 9: WordBreaker::detectEmailOrUrl (2015)

void WordBreaker::detectEmailOrUrl() {
    for (i = mLast; i < mTextSize; i++) { /* ... */ }
}

Amplificaci贸n: Bucle O(n) que recorre el texto sin l铆mites.

Paso 10: FontCollection::getGlyphScore (2013)

uint32_t getGlyphScore(...) {
    hb_shape(font.get(), buffer.get(), nullptr, 0);  // O(n²)
}

Amplificaci贸n: Llama a hb_shape para cada fuente evaluada.

馃敶 Resultado: 70KB → 5 mil millones de iteraciones → 16 segundos de bloqueo → ANR.


⚡ El payload m铆nimo

Para activar todo el pipeline de amplificaci贸n, se necesita un texto con:

  • Longitud: > 70.000 caracteres
  • Estructura: Caracteres que multipliquen los puntos de decisi贸n:
    • # → duplica decisiones de salto
    • / → cada barra a帽ade un punto de ruptura
    • % → expansi贸n UTF-8 → UTF-16
    • → propiedades de salto ambiguas

Payload 贸ptimo:

[PAYLOAD]

Repetido hasta alcanzar 70.000 caracteres.


馃搮 Cronolog铆a (2013–2026)

A帽o Evento Lo que demuestra
2013FontCollection.cpp, FontFamily.cpp, Layout.cpp creadosEl c贸digo vulnerable existe desde hace 13 a帽os
2015OptimalLineBreaker.cpp, Hyphenator.cpp, Measurement.cpp, WordBreaker.cpp creadosEl pipeline de amplificaci贸n se completa
2016CVE-2016-2414 — DoS en MinikinGoogle sab铆a que Minikin era vulnerable y lo arregl贸
2017GreedyLineBreaker.cpp creadoSe a帽ade una capa m谩s de amplificaci贸n
2018LineBreaker.cpp, LayoutCore.cpp, LayoutCache.h creadosEl pipeline alcanza 10 capas
2020Issue #161830416 — crash en LayoutCacheGoogle recibi贸 evidencia, la ignor贸
2021Issue #188985643 — SIGSEGV en SamsungGoogle lo ignor贸 porque no se reproduc铆a en Pixel
2023Chromium 1447465 — ANR en Chrome reportado por SamsungGoogle lo cerr贸 con "who knows"
2026Reporte VRP — 31 vectores documentadosGoogle lo cerr贸 "out of scope"
2026Bolet铆n de julio — sin parcheGoogle sigue ignorando el problema

馃敶 13 a帽os de c贸digo vulnerable. 10 archivos. 15 funciones. Google no lo ha arreglado.


El pipeline de layout de texto de Android est谩 compuesto por m谩s de 10 archivos y 15 funciones que, en conjunto, forman un sistema de amplificaci贸n de DoS. Cada capa multiplica el coste computacional sin aplicar validaci贸n de longitud, permitiendo que un texto de 70KB bloquee la UI durante 5-16 segundos.

Google ha tenido 13 a帽os para arreglar esto. Los archivos vulnerables datan de 2013 (FontCollection.cpp, FontFamily.cpp, Layout.cpp) y se han ido a帽adiendo m谩s capas a lo largo de los a帽os (2015, 2017, 2018). Ninguna de ellas ha sido parcheada para abordar el problema de la validaci贸n de entrada.

6. FontFamily.cpp: el origen del SIGSEGV en Samsung

El archivo FontFamily.cpp (creado en 2013) contiene la funci贸n getClosestMatch, responsable del SIGSEGV documentado en issue #188985643 (2021, Samsung Galaxy J6+).

FakedFont FontFamily::getClosestMatch(FontStyle style, const VariationSettings& axes) const {
    if (features::typeface_redesign_readonly()) {
        int bestIndex = 0;
        Font* bestFont = mFonts[bestIndex].get();  // ← ¡POSIBLE PUNTERO NULO!
        // ...
    }
    // ...
}

馃敶 Problema: mFonts puede estar vac铆o. En producci贸n, MINIKIN_ASSERT no se activa y el programa accede a memoria inv谩lida → SIGSEGV.

Google respondi贸:

"I haven't receive any crash report at this function on Pixel devices, and likely it is not actionable to me only with this stack trace."


7. LayoutCache.h: el amplificador silencioso

El archivo LayoutCache.h (creado en 2018) es donde la vulnerabilidad se vuelve persistente.

if (range.getLength() >= CHAR_LIMIT_FOR_CACHE) {
    LayoutPiece piece(text, range, dir, paint, startHyphen, endHyphen);
    // PROCESAMIENTO DIRECTO → SIN CACH脡 → BLOQUEO UI
    return;
}

馃敶 Esto significa que:

  1. Los textos largos no se almacenan en cach茅.
  2. Cada vez que se renderizan, se procesan desde cero.
  3. El bloqueo de UI ocurre cada vez que se muestra el texto.

8. Evidencia forense: los n煤meros no mienten

Longitud del texto Iteraciones aprox. Tiempo de bloqueo
1.000 caracteres ~1.000² = 1.000.000 < 100 ms
10.000 caracteres ~10.000² = 100.000.000 ~500 ms - 1 s
70.000 caracteres ~70.000² = 4.900.000.000 5 - 16 segundos

馃敶 Un texto de 70KB genera casi 5 mil millones de operaciones en el hilo UI.


9. La cronolog铆a de la libminikin (2013–2026)

A帽o Evento Lo que demuestra
2013 FontFamily.cpp y Layout.cpp creados El c贸digo vulnerable existe desde hace 11 a帽os
2016 CVE-2016-2414 — DoS en Minikin Google sab铆a que Minikin era vulnerable y lo arregl贸
2020 Issue #161830416 — crash en LayoutCache Google recibi贸 evidencia, la ignor贸
2021 Issue #188985643 — SIGSEGV en Samsung Google lo ignor贸 porque no se reproduc铆a en Pixel
2023 Chromium 1447465 — ANR en Chrome reportado por Samsung Google lo cerr贸 con "who knows"
2026 Reporte VRP — libminikin ANR y crash loop Google lo cerr贸 "out of scope"
Jul 2026 Bolet铆n de seguridad sin parche Google sigue ignorando el problema

馃敶 Google ha tenido m谩s de 10 a帽os para arreglar esto. Ha arreglado los casos triviales e ignorado los complejos.


10. La contradicci贸n del VRP: $250 y "out of scope"

El timeline:

  • 20 de enero de 2026: Reporte formal al Android VRP (27 vectores).
  • Google paga $250 por el caso Binder/IPC (A-477279924).
  • 15 de junio de 2026: Google cierra el reporte espec铆fico de libminikin como "out of scope" (524288518).
  • 16 de junio de 2026: Apelaci贸n enviada para STA-015-DL (CVSS 8.6) Google cierra el reporte de apelaci贸n espec铆fico de libminikin como "NoT reproducible"
  • 6 de julio de 2026: Bolet铆n de seguridad de julio — sin parche para ning煤n vector.

馃挕 La contradicci贸n: Google pag贸 una recompensa por la investigaci贸n, pero cerr贸 el reporte m谩s grave como "out of scope". Si est谩 fuera de alcance, ¿por qu茅 pagan?

Por primera vez, despu茅s de m谩s de 400 vulnerabilidades descubiertas y documentadas a lo largo de estos a帽os, he sido recompensado con 250 d贸lares por la primera parte de mi trabajo. Ni la cantidad, ni la forma en que se ha gestionado la segunda parte de la investigaci贸n reflejan el alcance ni la gravedad de las vulnerabilidades documentadas

Matem谩ticamente, teniendo en cuenta que pueden ser 2.500 millones de dispositivos afectados, eso es 0,0000001 d贸lares por dispositivo. Es decir, menos de una diezmil茅sima parte de un c茅ntimo por cada tel茅fono vulnerable.


11. Conclusi贸n: 10 a帽os de c贸digo vulnerable

El an谩lisis del c贸digo fuente de AOSP confirma que la vulnerabilidad en libminikin no es un bug aislado, sino un fallo de dise帽o sist茅mico presente en el n煤cleo de Android desde 2013.

馃敶 Lo que sabemos ahora:

  • 6 archivos vulnerables en AOSP.
  • 5 capas del pipeline de texto sin validaci贸n.
  • 10 a帽os de evidencia documentada (2013 → 2026).
  • Google ha tenido m谩s de 10 a帽os para arreglar esto.
  • Ha arreglado los casos triviales (CVE-2016-2414) e ignorado los complejos.

El 30 de julio de 2026 publicar茅 el whitepaper completo con los 31 vectores documentados, las trazas nativas completas y el an谩lisis forense del c贸digo fuente. Si tu aplicaci贸n usa TextView, ya est谩s avisado.

馃搶 Para desarrolladores (mitigaci贸n inmediata):

private static final int MAX_SAFE_LENGTH = 8192;
String safe = text.length() > MAX_SAFE_LENGTH 
    ? text.substring(0, MAX_SAFE_LENGTH) + "…" 
    : text;
textView.setText(safe);

12. Referencias y enlaces

Art铆culos del investigador

Issues p煤blicos de Google

C贸digo fuente de AOSP

馃敟 1.6 Minikin es un s铆ntoma de una brecha de resiliencia sist茅mica

La vulnerabilidad de libminikin no es un bug aislado. Es un s铆ntoma de una brecha de resiliencia sist茅mica en el framework de Android: la ausencia de un mecanismo estandarizado de "safe fallback" para manejar datos que superan los l铆mites del sistema.

El mismo patr贸n aparece en al menos diez componentes distintos del sistema operativo Android:

Componente Modo de fallo Impacto
FragmentManager No captura TransactionTooLargeException Bucle de crash permanente
TaskPersister Persiste el estado corrupto en disco El bucle de crash sobrevive a reinicios
SystemUI Lee TaskPersister sin validaci贸n Bucle de crash → pantalla de bloqueo
Print Service Sin validaci贸n del tama帽o del documento SystemUI crash
ClipboardManager Serializa todo el contenido del portapapeles sin l铆mites SystemUI crash
Binder L铆mite de 1MB sin safe fallback Crash de la app
libminikin.so Sin validaci贸n de longitud de entrada ANR (5–16s)
LayoutCache CHAR_LIMIT_FOR_CACHE fuerza el procesamiento directo Amplifica el DoS
BitmapCache Sin validaci贸n del tama帽o de imagen (issue #531319203) Crash de system_server → bucle de arranque
MediaSession Sin validaci贸n del tama帽o de la car谩tula Crash de system_server → bucle de arranque

馃敶 Diez componentes. Diez modos de fallo diferentes. El mismo patr贸n subyacente: sin validaci贸n de entrada antes del procesamiento, y sin safe fallback cuando se superan los l铆mites.

Esto no es un bug de Minikin. Es un fallo de dise帽o del framework de Android que ha estado presente durante m谩s de una d茅cada, afectando a componentes que van desde la capa de aplicaci贸n hasta el servidor central del sistema. Google ha a帽adido capas de complejidad a Minikin sin abordar la causa ra铆z, y ha descartado los informes de estos problemas como "fuera de alcance" o "comportamiento intencionado" durante a帽os.

Minikin no es la enfermedad. Es un s铆ntoma.



#Lostmon #Android #AOSP #Ciberseguridad #MobileSecurity #SystemUI #libminikin #STA #StructuredTextAmplification #BugBounty #GoogleVRP #Xiaomi #HackerOne #SaludMental #Investigaci贸nIndependiente #BojosXtu
Manuel Garcia Pe帽a (Lostmon) · lostmon@gmail.com · lostmon.blogspot.com
Whitepaper completo: 30 de julio de 2026
 

Browse

About:Me

My blog:http://lostmon.blogspot.com
Mail:Lostmon@gmail.com
Lostmon Google group
Lostmon@googlegroups.com

La curiosidad es lo que hace
mover la mente...

Friends