Showing posts with label bug. Show all posts
Showing posts with label bug. 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 The Print Preview Vector

Friday, September 04, 2026
STA The Print Preview Vector: Document Amplification Through Android Print Service

STA — The Print Preview Vector

This article documents the Print Preview amplification chain in Android — a Class A (IPC/SavedState) vector where oversized document previews exceed the Binder transaction limit, causing crashes in the Print Service, SystemUI, and, in the most severe cases, persistent crash loops requiring a hard reboot.


1. Overview

The Print Preview vector is a Class A amplification chain that begins when a user selects the Print or Print Preview option from an application — particularly Google Drive, PDF viewers, or document editors. The system constructs a preview Bundle containing page data, text, and metadata, and attempts to send it across the Binder IPC boundary to the Print Service, Print Spooler, or SystemUI.

Because no size validation is performed before serialization, a sufficiently large document (e.g., a complex DOCX, a high-resolution PDF, or a long text document) can produce a Bundle that exceeds the 1,048,576-byte Binder limit. When this happens, a TransactionTooLargeException is thrown — and in many cases, it remains uncaught. The result is a crash of the Print Service, the calling application, or SystemUI itself.

In the most severe scenarios, the crash corrupts the TaskPersister state on disk, causing a persistent crash loop that survives reboots and requires manual data clearance.

The full amplification chain is as follows:

Large document (Google Drive, PDF, DOCX)
        ↓
User selects "Print" or "Print Preview"
        ↓
Print Service builds a preview Bundle
        ↓
Bundle serialized → Parcel → Binder
        ↓
Exceeds 1 MB limit → TransactionTooLargeException
        ↓
Uncaught exception → Crash (app, Print Service, or SystemUI)
        ↓
If state is persisted (SavedState / TaskPersister) → Crash loop

Key observation: This vector is structurally identical to the WhatsApp ×20.6 amplification (STA-005) and the Threads deep-link crash (STA-012). In all cases, a structured payload crosses a Binder-backed boundary without a length check, and the resulting exception propagates uncaught.


2. Documented Vectors

The Print Preview amplification manifests in at least four distinct but related vectors, each affecting a different layer of the Android stack:

IDComponentMechanismCVSSPersistenceTier
STA-009 Google Drive → Print Preview Opening the print preview of a large DOCX/PDF generates a Bundle that exceeds the Binder limit, crashing the app. 6.5 Yes (until reboot) A
STA-010 Print Service → local printer The same oversized Bundle is sent to the local print service (SystemUI), causing SystemUI to crash. 7.2 Yes (until reboot) A
STA-010b Google Play Services → cloud printer Variant of STA-010 routed through Google Play Services. 6.5 Yes (until app closed) A
STA-018 Google Drive + Print Service + SystemUI Full chain: ANR in browser → TaskPersister corruption → SystemUI crash loop. Hard reboot required. 7.5 Yes (until reboot) A

All four vectors have been reproduced on Android 13–16 across multiple OEMs (Xiaomi, Samsung, OPPO, OnePlus, Pixel) and are classified as Tier A (full stack trace + exception + Bundle analysis).


3. Technical Evidence

3.1. SystemUI Crash During Print Preview

Bugreports captured on a Xiaomi Redmi Note 14 5G (HyperOS 3.0 / Android 16) show SystemUI crashing when a print preview is opened for a large document. The following stack trace was extracted from a production bugreport:

// SystemUI crash during Print Preview
android.os.TransactionTooLargeException: data parcel size 1,456,832 bytes
  at android.os.BinderProxy.transactNative(Native Method)
  at android.os.BinderProxy.transact(BinderProxy.java:642)
  at android.print.IPrintManager$Stub$Proxy.print(IPrintManager.java:456)
  at android.print.PrintManager.print(PrintManager.java:789)
  at com.google.android.apps.docs.print.PrintPreviewActivity.onCreate(...)
  at android.app.ActivityThread.performLaunchActivity(...)
  at android.app.ActivityThread.handleLaunchActivity(...)
  at android.app.servertransaction.LaunchActivityItem.execute(...)

Analysis: The Print Manager attempts to send the preview Bundle across Binder, but its size (1,456,832 bytes) exceeds the 1,048,576-byte limit. The resulting TransactionTooLargeException is not caught, and SystemUI crashes. The crash occurs before the user can interact with the print dialog, making it a reliable denial-of-service vector.

3.2. TaskPersister Corruption (STA-018)

In more severe cases — particularly on devices with OEM customisations (Xiaomi HyperOS) — the SystemUI crash corrupts the TaskPersister state on disk. Upon restart, SystemUI reads the corrupt state and crashes again, entering a persistent crash loop that requires a full device reboot or manual data clearance.

// TaskPersister corruption after Print Preview crash
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.android.systemui, PID: 1234
    android.os.BadParcelableException: Failure retrieving array; only received 1 of 4
        at android.content.pm.BaseParceledListSlice.<init>(...)
        at android.window.ITaskOrganizerController$Stub$Proxy.registerTaskOrganizer(...)
        at android.window.TaskOrganizer.registerOrganizer(TaskOrganizer.java:76)
        at com.android.wm.shell.sysui.ShellInit.init(...)
    Caused by: android.os.DeadObjectException: Transaction failed on small parcel

This demonstrates that the Print Preview vector can escalate beyond a transient crash and become a persistent denial-of-service condition that affects the entire device UI.

3.3. Bundle Size Amplification

As with other Class A vectors, the amplification factor depends on the structure of the document and the nesting depth of the Fragment hierarchy. In the case of Google Drive's print preview, a document of approximately 80–100 KB can generate a Bundle of 1.2–1.5 MB, exceeding the Binder limit by 20–50%.

This amplification is consistent with the pattern observed in WhatsApp (×20.6) and TikTok (×286), where nested FragmentManager state multiplies the original payload size at each level.


4. Connection to AndroidX PdfView Commit

On 14 July 2026, a commit was merged into AndroidX (8882927e7d41e678c6f03f50d4bd5950e7dc6c47) that fixes a TransactionTooLargeException in PdfView. The commit message states:

“When a user selects content across a large range of pages (e.g., 500 pages), the serialized SelectionModel exceeds 1.2 MB. Serializing this into onSaveInstanceState triggers an unhandled TransactionTooLargeException over the kernel Binder IPC driver right when the app goes into the background.”

The fix was to change the persistent representation: rather than serialising the full SelectionModel, only anchor points (~44 bytes) are saved, and the full state is reconstructed asynchronously upon restoration.

Note: This commit is independent of the STA research, but it confirms that Google is actively mitigating the same general class of oversized‑state / Binder‑boundary problems in components related to document handling and print preview.

However, the commit is scoped to androidx.pdf.viewer.PdfView only. It does not address the Print Service, SystemUI, or TaskPersister paths documented in STA-009, STA-010, and STA-018. As of September 2026, those paths remain publicly unpatched.


5. Relation to Other STA Vectors

VectorConnection
STA-015-DL Similar chain (Google Drive HTML → browser ANR → SystemUI crash loop), but triggered via a web link rather than the print UI. Both share the TaskPersister corruption mechanism.
STA-005 Class A amplification through FragmentManager / SavedState, but in the context of messaging apps (WhatsApp) rather than printing. The underlying cause — oversized Bundle → Binder → uncaught exception — is identical.
STA-012 Threads deep-link crash. Also Class A, also involves a structured payload crossing Binder without validation.
STA-017 Class B (libminikin ANR) — unrelated to printing, but shares the same root‑cause pattern: missing size validation before an expensive operation (text layout in libminikin; Binder serialisation in Print Service).

The Print Preview vectors are a clear demonstration that the STA pattern is not confined to a single application or component. It recurs across document handling, messaging, and system UI — all tied to the same underlying architectural gap: structured input → serialization → Binder → uncaught exception → crash.


6. Mitigation Recommendations

6.1. Framework (AOSP / AndroidX)

  • Validate Bundle size before serialization in PrintManager and PrintService — reject or truncate if the 1 MB limit is approached.
  • Catch TransactionTooLargeException in both the Print Service and SystemUI, and degrade gracefully (show an error message instead of crashing).
  • Adopt LargePayloadSupport (FD‑based transfer) for print previews, similar to what already exists for Credential Manager and Digital Credentials.
  • Prevent TaskPersister corruption by validating restored state size before persisting it to disk.

6.2. Application-level (Google Drive, document viewers)

  • Truncate document content before passing it to the Print Service — limit the number of pages, reduce preview resolution, or cap text length to 50,000 characters.
  • Reject print intents that contain oversized documents (e.g., by checking the document size before calling PrintManager.print()).

6.3. OEM-specific (HyperOS, One UI, ColorOS)

  • OEMs should apply safe degradation patterns in their Task State Interactors, similar to the pattern proposed in Section 16.4 of the STA whitepaper (catch DeadObjectException and emit null instead of crashing).

7. Conclusion

The Print Preview vector is a clear and well-documented manifestation of Class A Structured Text Amplification in a system‑level service (Print Service / SystemUI). It demonstrates that the same architectural pattern — structured input → serialization → Binder → uncaught exception → crash — recurs across multiple surfaces, from messaging apps to document handling to system UI.

The independent AndroidX fix for PdfView confirms that Google is aware of this class of problems, but the Print Service and SystemUI paths remain unpatched as of September 2026. Organisations relying on Android for document workflows should consider implementing defensive truncation at the application level.

This vector also reinforces the broader STA thesis: the problem is not a single bug, but a systemic architectural gap that requires a coordinated, cross‑component response from the Android framework.


8. Related Publications


STA-006 / 007 Translate: When translating text crashes Google Apps

Wednesday, August 26, 2026

STA-006 / 007 Translate: When translating text crashes Google Apps

Structured Text Amplification — Vectors 006 & 007

This post documents STA-006 and STA-007, two denial-of-service vectors in Google's Translate feature. An oversized text payload, when selected and sent to Translate via Intent.ACTION_TRANSLATE, can exceed the Binder transaction limit, causing a TransactionTooLargeException and a permanent crash loop in some cases.

⚠️ Severity: STA-006 and STA-007 are persistent DoS vectors in some oems implementations. A single oversized text selection can make Google App or Google Drive permanently unusable until the user clears app data. No special permissions or privileges are required.


1. Overview

STA-006 and STA-007 describe a persistent denial-of-service condition in Google's Translate feature, accessible from multiple Google apps. An attacker can craft or deliver an oversized text payload that, when selected and translated, contaminates the app's state and causes a permanent crash loop in oems.

The vector is triggered when the user selects a large text (visible or hidden) and invokes the Translate action. The app constructs an Intent.ACTION_TRANSLATE containing the selected text. During serialization of the Intent for transfer via Binder, the data size may exceed the Binder transaction limit (approximately 1 MiB). This can result in an unhandled TransactionTooLargeException, causing an immediate app crash.

Type: semi-persistent Denial of Service (DoS)
Class: Resource Exhaustion / State Persistence Boundary
CWE: CWE-400 — Uncontrolled Resource Consumption; CWE-770 — Allocation of Resources Without Limits
CVSS v3.1 estimated: 6.5 (Medium-High)
Vector: AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H


2. Attack chain

The observed chain can be represented as:

Attacker crafts/places oversized text payload
       ↓
User selects the text (or selects all in a PDF)
       ↓
User invokes Translate action (context menu or app button)
       ↓
Google App / Google Drive constructs ACTION_TRANSLATE Intent
       ↓
Selected text stored in Intent extra (EXTRA_TEXT)
       ↓
Intent serialization (Parcel)
       ↓
Parcel size exceeds Binder limit (1 MB)
       ↓
TransactionTooLargeException
       ↓
App crashes immediately
       ↓
State may be re-persisted (in Google Drive)
       ↓
App crashes on every launch attempt (persistent crash loop)
       ↓
Recovery: clear app data or uninstall/reinstall

The fundamental characteristic of STA-006/007 is that the STA payload is delivered through a standard user action (Translate) that the app is designed to handle. The user does nothing unusual — just selects text and translates it.


3. Vector details

3.1. STA-006 — Google App (Select text → Translate)

The vector is triggered through the Google App's selection menu:

  • The user selects a large text (e.g., from a web page, document, or any text field).
  • The user taps the "Translate" action from the context menu.
  • Google App creates an ACTION_TRANSLATE Intent with the selected text as EXTRA_TEXT.
  • During serialization of the Intent, the Bundle size exceeds the Binder transaction limit.
  • TransactionTooLargeException is thrown and not caught.
  • Google App crashes immediately.

Entry point: android.app.Activity.startActivityForResult()Instrumentation.execStartActivity() → Binder transaction → TransactionTooLargeException

3.2. STA-007 — Google Drive (PDF → Select All → Translate)

The vector is triggered through Google Drive's PDF viewer:

  • User opens a PDF containing invisible or oversized text (e.g., a PDF with a large hidden payload).
  • User selects all text (Select All) in the PDF viewer.
  • User taps the "Translate" action from the selection menu.
  • Google Drive creates an ACTION_TRANSLATE Intent with the selected text.
  • During serialization of the Intent, the Bundle size exceeds the Binder transaction limit.
  • TransactionTooLargeException is thrown and not caught.
  • Google Drive crashes immediately.
  • If the state is re-persisted, the app enters a permanent crash loop.

Entry point: PDF viewer selection menu → Intent.ACTION_TRANSLATE → Binder transaction → TransactionTooLargeException


4. Stack trace and Bundle analysis

The following stack trace and Bundle statistics were captured from a production device (Xiaomi Redmi Note 14 5G, HyperOS 3.0, Android 16) during a crash of the Google App. The crash occurred after selecting an oversized text payload, invoking Translate, and subsequently focusing the search bar, which triggered the state serialization and Binder transaction.

4.1. Exception

java.lang.RuntimeException: android.os.TransactionTooLargeException:
data parcel size 2454260 bytes
    at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:146)
    at android.os.Handler.handleCallback(Handler.java:1029)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:274)
    at android.os.Looper.loop(Looper.java:369)
    at android.app.ActivityThread.main(ActivityThread.java:10090)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:616)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1137)
Caused by:
android.os.TransactionTooLargeException:
data parcel size 2454260 bytes
    at android.os.BinderProxy.transactNative(Native Method)
    at android.os.BinderProxy.transact(BinderProxy.java:736)
    at android.app.IActivityClientController$Stub$Proxy.activityStopped(IActivityClientController.java:1546)
    at android.app.ActivityClient.activityStopped(ActivityClient.java:106)
    at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:135)

4.2. Bundle statistics

The Bundle that triggered the exception contained the following components:

Bundle stats:
    androidx.lifecycle.BundlableSavedStateRegistry.key [size=2452080]
    androidx.lifecycle.internal.SavedStateHandlesProvider [size=1127400]
    tt_activity_account_retained:6 [size=1125236]
    SearchSession:1 [size=1125012]
    androidx.lifecycle.BundlableSavedStateRegistry.key [size=1124884]
    androidx.lifecycle.internal.SavedStateHandlesProvider [size=1124752]
    androidx.lifecycle.ViewModelProvider.DefaultKey:... [size=1124452]
    BrowserSession:2 [size=963088]
    androidx.lifecycle.BundlableSavedStateRegistry.key [size=962960]
    androidx.lifecycle.internal.SavedStateHandlesProvider [size=962828]
    webx_browser [size=962464]
    webx_window [size=962416]
    web_view_url [size=962288]
    search_query_key [size=161080]
    search_query [size=161028]
    protoparsers [size=160976]
    android:support:fragments [size=1312836]
    fragment_e32da9b3... [size=1312412]
    arguments [size=161152]
    TIKTOK_FRAGMENT_ARGUMENT [size=161008]
    childFragmentManager [size=1312836]
    android-support-nav:controller:backStack [size=326252]
    registryState [size=168492]
    SEARCH_QUERY_STATE [size=160976]
    ... (additional nested fragment states)

4.4. Key metrics

Component Size
Input (search_query) ~161,028 bytes
childFragmentManager 1,312,836 bytes
SavedStateHandlesProvider 1,127,400 bytes
SearchSession / BrowserSession ~1,125,000 bytes each
Total Bundle size 2,454,260 bytes
Binder transaction limit 1,048,576 bytes
Excess +1,405,684 bytes (+134%)
Amplification factor ×15.2

Key observation: The input payload (~161 KB) is amplified to a total Bundle size of 2.45 MB through the serialization of nested Fragment states, SavedState handles, and session data. The amplification factor of ×15.2 is consistent with the amplification patterns documented in other Class A vectors (STA-005, ×20.6; STA-012, ×20.6).


5. Affected components

Primary

  • android.content.IntentACTION_TRANSLATE intent extra serialization
  • android.os.Bundle — serialization container
  • android.os.Parcel — Binder serialization
  • android.app.ActivityThread — lifecycle handling
  • androidx.fragment.app.FragmentManager — fragment state serialization
  • androidx.lifecycle.SavedStateHandlesProvider — SavedState management

Secondary

  • android.app.ActivityManagerProxy — Binder transaction
  • Google App (com.google.android.googlequicksearchbox) — Translate feature
  • Google Drive (com.google.android.apps.docs) — PDF viewer + Translate feature

6. Persistence

Persistence: YES (STA-007), Conditional (STA-006)

  • STA-006 (Google App): The app may crash immediately, but the state is not always re-persisted. Recovery typically involves reopening the app.
  • STA-007 (Google Drive): The PDF viewer state is saved, and the oversized payload may be re-persisted, causing a crash on every launch.

Recovery typically requires:

  • Clearing the app data (via adb pm clear com.google.android.googlequicksearchbox or adb pm clear com.google.android.apps.docs)
  • Uninstalling and reinstalling the app (loses all data)

7. Why this matters

STA-006 and STA-007 are not just crashes. They are semi-persistent denial-of-service vectors with significant implications:

  • For individual users: They lose access to the app until they clear data, losing all settings and potentially documents.
  • For Google: A single malicious document can make Google Drive unusable for any user who opens it and attempts to translate.
  • For the platform: This is a single point of failure in the Intent serialization and Binder transaction mechanism.

The vector is particularly concerning because:

  • The payload can be delivered through a standard PDF document that the app is designed to handle.
  • No special permissions are required.
  • The user does nothing unusual — just selects text and translates it.
  • The impact is persistent in some OEMS and requires clearing data to recover.

8. Relationship to other STA vectors

Vector Relationship
STA-003 Same mechanism (Share Intent → Binder → TransactionTooLargeException)
STA-005 Same mechanism (text input → SavedState → Bundle → Binder → crash loop). WhatsApp has a similar amplification factor (×20.6).
STA-012 Same mechanism (deep link → Fragment args → SavedState → Binder → crash loop)
STA-028 UTF-16 encoding amplification is a contributing factor to the measured amplification.

9. Chromium commit evidence

Chromium commit 84b615a0 (5 May 2026) added the Translate action to the Android PDF viewer's selection menu, confirming that this surface is considered relevant and that Google engineers have been working on it. The commit introduced:

84b615a07fc14988b46f0e362502ab4075216793
Author: Ryan Thomas
Date: 5 May 2026
Component: Android PDF viewer selection menu
Changes: Added Share, Web Search, Translate actions to selection menu

This demonstrates that the surface identified by STA-006/007 is being actively developed and modified, further validating the architectural relevance of the findings.


10. Recommended mitigation

10.1. Application-level (Google App / Google Drive)

  • Validate the size of selected text before constructing the ACTION_TRANSLATE Intent.
  • Truncate text to a safe limit (e.g., 8 KB) before placing it in EXTRA_TEXT.
  • Catch TransactionTooLargeException and fall back to a clean state.
// Recommended approach for Translate action
String selectedText = getSelectedText();
if (selectedText != null && selectedText.length() > MAX_SAFE_LENGTH) {
    selectedText = selectedText.substring(0, MAX_SAFE_LENGTH);
    Log.w(TAG, "Selected text truncated to safe length");
}
Intent translateIntent = new Intent(Intent.ACTION_TRANSLATE);
translateIntent.putExtra(Intent.EXTRA_TEXT, selectedText);
try {
    startActivity(translateIntent);
} catch (TransactionTooLargeException e) {
    Log.e(TAG, "Translate Intent too large", e);
    // Fallback: show error dialog or use alternative translation method
}

10.2. Framework-level (Android)

  • Intent serialization should include a size estimation before Binder transaction.
  • SystemUI should catch TransactionTooLargeException and handle it gracefully.
  • FragmentManager should limit the size of saved state before serialization.

11. Research status

Field Value
Vectors STA-006, STA-007
First formal communication 20 January 2026
Researcher Manuel García Peña (Lostmon)
Nature Independent research
Platform Android
Impact Persistent DoS
Interaction required Yes (one click / selection)
Privileges None
Tier A (Confirmed — full stack trace + exception)

STA-006/007 are part of the broader Structured Text Amplification (STA) research, which studies a recurring pattern of resource exhaustion produced when input data crosses serialization, transformation, IPC, or persistence boundaries without sufficiently early resource limits.


12. Conclusion

STA-006 and STA-007 demonstrate how a standard Translate action can become a persistent denial-of-service vector when the app fails to validate the size of selected text before constructing an Intent.

The amplification mechanism is consistent with other Class A vectors, confirming that the problem is architectural rather than specific to a single app:

Selected text (~161 KB)
 → Intent (ACTION_TRANSLATE)
 → FragmentManager serialization
 → SavedStateHandlesProvider
 → Bundle (2.45 MB)
 → Parcel
 → Binder
 → TransactionTooLargeException
 → Persistent crash loop

The most robust mitigation is to validate input size before constructing the Intent, complemented by fallback mechanisms that prevent an oversize condition from becoming a persistent crash loop.


Complete whitepaper: Resilience Gaps in Android IPC, SavedState and Text Layout — v6 (August 2026)


📌 About this series
This post is part of a series documenting the 32 vectors of Structured Text Amplification (STA).

Published:
STA-017 — Cross-Engine ANR
STA-015-DL — Google Drive → SystemUI
STA-005 — WhatsApp
STA-003 — Binder Share Intent
STA-006/007 — Translate (this post)

Coming next:
⬜ STA-012 — Threads
⬜ STA-019 — Firefox
⬜ STA-022 — DuckDuckGo

Whitepaper: Resilience Gaps in Android IPC, SavedState and Text Layout — v6


Lostmon · lostmon.blogspot.com

STA - Structured Text Amplification In Llm's

Sunday, August 23, 2026

🧩 Structured Text Amplification (STA)

A Systemic Vulnerability in LLMs. Documented from the Couch
📅 August 23, 2026 👤 Lostmon 🏷️ Research / Vulnerability / Tokenization

Structured Text Amplification (STA) is a phenomenon where a finite-length input sequence, composed of non-semantic characters and lacking structural delimiters, causes a non-linear growth in computational cost in generative AI systems.

We tested 7 different systems (DeepSeek, Grok, Gemini, Copilot, Leo, Qwen VL, and others) and all are vulnerable, though with different symptoms: reasoning loops, 19-minute thinking times, parsing errors, interface amplification, and more.

🧠 The Key: STA is not a flaw in a specific model, but a structural problem in the design of AI systems — affecting tokenization, the ingestion interface, the parser, and the reasoning mode.

⚙️ STA Pattern Used

The base pattern is a repetition of special characters without separators or semantic meaning

We tested lengths of 1,600, 10,000, 61,560, and 65,560 characters, always with UTF-8 encoding.

📊 Results by System

SystemInputMain SymptomAmplification
DeepSeek (V4-Flash)1,600 charsReasoning loop, long responses~4.4x
Grok (xAI)1,600 chars"Think" mode activated for 19 min without response
Gemini (Google)61,560 charsLong structured response, no useful data
Copilot (GitHub)61,560 charsInflated count (1,002,682) + fragmentation16.28x
Leo (Mistral)65,560 charsSyntax error: "Unterminated string"
Qwen VL 30B65,560 charsSyntax error: "Unterminated string"

🧬 Layer-by-Layer Analysis

LayerVulnerabilityAffected Systems
Input ParserDoes not escape special characters → syntax errorLeo, Qwen VL
Ingestion InterfaceConverts long text into truncated document with repetitionsCopilot
Tokenizer (BPE)Fragments special characters as individual tokensDeepSeek, Grok, Gemini
Inference EngineEnters loop without semantic structureDeepSeek, Grok
Reasoning ModeSTA prevents convergence → prolonged blockGrok

🎯 Attack Vectors Identified

  • Direct Vector: Sending the STA pattern as a message to the model (1,600 characters).
  • File Vector: Uploading the pattern in a file (61,560 characters).
  • Interface Vector: Pasting the pattern into an interface that converts it to a document (Copilot).
  • Multimodal Vector: Including the pattern in an image/text context (Qwen VL).
  • Clipboard Vector: Fragmentation and contamination of the clipboard (Copilot).

🔍 The Copilot Case: Interface Amplification

Copilot does not amplify STA by itself; rather, the interface converts the long text into an internal document (<AttachedDocument>), truncates it, and fills it with repeated blocks. The model receives that amplified document and processes it as if it were real.

Actual input: 61,560 characters Internal document: ~1,002,682 characters Amplification factor: 16.28x

This is especially serious because the user has no control over this process, and the attack can escalate without the model or the user detecting it.

💰 Estimated Economic Impact

ModelInput (chars)Approx. Cost per Attack
DeepSeek1,600$0.0014
OpenAI GPT-4 (reference)1,600$0.06
Copilot (with amplification)61,560 → 1MNot quantified, but high

If the attack is automated (10 requests/second), costs can quickly escalate to hundreds of dollars per hour.

🛡️ Technical Recommendations

  • Parser: Automatically escape non-ASCII characters and validate string termination.
  • Ingestion Interface: Do not convert long text into internal documents if it is not an explicitly uploaded file. If converted, do not truncate with repetitions.
  • Tokenizer: Add subword merging rules for common combinations of special characters and limit the number of tokens per input.
  • Inference Engine: Implement timeouts in reasoning mode and detect low-entropy patterns to respond with an error without spending tokens on inference.
  • User: Do not paste long strings of special characters into AI interfaces; use preprocessing tools that clean non-semantic characters.

📌 Conclusions

  • STA is a real and documented phenomenon affecting generative AI systems across multiple layers.
  • All tested models are vulnerable, though with different symptoms.
  • The interface layer can amplify the attack (Copilot: 16.6x).
  • STA is not a flaw in a specific model, but a structural problem in the design of AI systems.
  • Urgent action is recommended to mitigate this attack vector.

📚 References & Further Reading


🛋️ Research led from the couch with ingenuity, patience, and insatiable curiosity.
Lostmon
🧩 STA — Structured Text Amplification  ·  Version 2.0 (Technical)  ·  Published under CC BY-NC 4.0
```

STA-003 When sharing an oversized link breaks the browser (Binder Share Intent)

Friday, August 21, 2026

STA-003 Binder Share Intent TransactionTooLargeException

Structured Text Amplification — Vector 003

This post documents STA-003, a denial-of-service vector in Android browsers where an oversized URL shared via the context menu triggers a TransactionTooLargeException during Binder serialization of the ACTION_SEND Intent, causing an immediate browser crash.

⚠️ Severity: STA-003 is an interactive DoS vector. A single long-press on a crafted link followed by "Share" can crash the browser immediately. No special permissions or privileges are required.


1. Summary

STA-003 describes a denial-of-service condition in Android web browsers when an excessively large URL is shared via the context menu of a link.

The vector is triggered when the user performs a long-press on a link and selects "Share". The browser constructs an ACTION_SEND Intent containing the URL as EXTRA_TEXT. During serialization of the Intent for transfer via Binder, the data size may exceed the Binder transaction limit (approximately 1 MiB). This can result in an unhandled TransactionTooLargeException, causing an immediate browser process termination.

Type: Denial of Service (DoS)
Class: Resource Exhaustion / IPC Serialization Boundary
CWE: CWE-20 — Improper Input Validation; CWE-400 — Uncontrolled Resource Consumption
CVSS v4.0 estimated: 6.5 (Medium)


2. Attack chain

The observed chain can be represented as:

Malicious web page
       ↓
Excessively large URL
       ↓
Long-press on the link
       ↓
Context menu
       ↓
"Share"
       ↓
Intent ACTION_SEND
       ↓
EXTRA_TEXT = URL
       ↓
Intent serialization
       ↓
Binder IPC
       ↓
Parcel > transaction limit
       ↓
TransactionTooLargeException
       ↓
Browser crash
       ↓
Denial of Service

The fundamental characteristic of STA-003 is that a legitimate-looking input — a URL — acquires a disproportionate cost when crossing a serialization/IPC boundary.


3. Difference from STA-001

STA-003 must be kept separate from STA-001.

Vector Mechanism Failure
STA-001 Context menu processing Prolonged processing / freeze before crash
STA-003 ACTION_SEND Intent → Binder serialization Immediate crash during Intent serialization

STA-001 is associated with prolonged processing during context menu construction, with a noticeable freeze before the crash.

STA-003 fails during the Share operation itself:

Long URL
       ↓
ACTION_SEND
       ↓
Intent serialization
       ↓
Binder
       ↓
TransactionTooLargeException
       ↓
Immediate crash

4. Required conditions

The attack requires:

  • An Android browser that exposes the Share operation for the affected link.
  • A page containing a link with a sufficiently large URL to exceed the effective Binder transaction limit.
  • The victim performs a long-press on the link.
  • The victim selects "Share".

Not required:

  • Special Android permissions
  • Local access to the device
  • Application privileges
  • Prior code execution on the device

The URL can be distributed via any channel capable of delivering a link, including web pages, messaging, email, social networks, QR codes, or other URL distribution mechanisms.


5. Browser-specific observations

A relevant observation during the investigation is that the availability of the vector depends on how each browser handles excessively large URLs.

Browser Behaviour Mitigation level
Google Chrome Does not present Share option for extremely large URLs Application-level
Microsoft Edge Equivalent mitigation behaviour Application-level
Opera Browser Share operation available → TransactionTooLargeException → crash No mitigation

This difference is important because it demonstrates two levels of mitigation:

Application-level mitigation:
    Avoid generating/sending an excessively large Intent

Framework-level:
    Accept an oversized operation
    ↓
    TransactionTooLargeException
    ↓
    Safe fallback / degradation

The existence of application-level mitigations does not eliminate the underlying condition in the IPC mechanism.


6. Stack trace and evidence

The following stack trace was captured during a Share operation with an oversized URL. The excerpt is abbreviated; irrelevant frames and build-specific details have been omitted.

Share Intent crash

java.lang.RuntimeException: android.os.TransactionTooLargeException:
data parcel size 1662976 bytes
at android.app.ActivityClient.activityStopped(ActivityClient.java:101)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run()
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(...)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)

Key metric: Parcel size 1,662,976 bytes — exceeds the Binder transaction limit (1,048,576 bytes) by approximately 58%. The crash is immediate, with no observable delay.

Vulnerable code pattern

The following pattern is present in many browsers and apps that implement sharing functionality:

// Browser code (simplified)
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, url); // ← No size check!
startActivity(Intent.createChooser(shareIntent, "Share via"));

The Android framework provides no guardrails for Intent.putExtra() size, and no automatic truncation or validation is performed before the Intent is serialized for Binder transmission.


7. Impact

The observed impact is a denial of service of the browser:

  • Immediate browser crash during the Share operation
  • Loss of browsing session
  • Interruption of user activity
  • Potential repetition of the crash if the operation is re-executed

Unlike STA-001 (which may show a 10-17 second freeze before crash), STA-003 crashes immediately during Intent serialization.

Any application implementing share functionality is potentially vulnerable:

  • Web browsers (all vendors)
  • Email clients
  • Social media apps
  • Messaging apps
  • Document viewers
  • File managers
  • Any app with a "Share" button for text/URLs

Estimated affected apps: 10,000+ on Play Store


8. Relationship to Structured Text Amplification

STA-003 belongs to the class of vectors where a legitimate-looking data item crosses a transformation or serialization boundary without a sufficiently early limit.

The pattern can be expressed as:

Small / legitimate input
        ↓
Transformation / serialization
        ↓
Structured representation
        ↓
IPC boundary
        ↓
Resource limit exceeded
        ↓
Failure / DoS

In STA-003:

URL
 ↓
String / EXTRA_TEXT
 ↓
Intent
 ↓
Parcel
 ↓
Binder
 ↓
TransactionTooLargeException
 ↓
Browser crash

The vector therefore does not depend solely on the logical size of the URL. The relevant cost is the size of the representation that must ultimately cross the IPC boundary.


9. Proof of Concept

The PoC consists of an HTML page containing a link with an extremely large URL:

<a href="https://example.com/[STA Pattern]">
    Test link
</a>

During the investigation, character patterns were used to produce an especially large representation after encoding/serialization transformations. The full payload is not included in this public documentation to reduce the potential for abuse.

Conceptual reproduction:

  1. Open an affected Android browser (e.g., Opera).
  2. Access a page containing the prepared link.
  3. Long-press the link.
  4. Select "Share".
  5. Observe the immediate browser crash.
  6. Logs may show TransactionTooLargeException with a parcel size exceeding 1 MB.

10. Evidence and background

The research relates STA-003 to the following background:

  • Chromium Issue 40879254 (2022): Issue related to sharing an excessively large URL for Binder.
  • Mozilla Bugzilla #1802594: Incidents related to TransactionTooLargeException / DeadSystemException in Firefox.
  • Chromium: Changes intended to truncate visible URLs and reduce the size of certain data before subsequent operations.
  • Android TransactionTooLargeException: Official documentation of the failure mechanism associated with excessively large Binder transactions.
  • Android Intent.ACTION_SEND: Surface used to transfer content that subsequently crosses IPC.

These references constitute independent background that helps establish that the attack surface is not limited to a specific browser implementation.

A relevant observation during the investigationis that Chrome and Edge hide the Share option for extremely large URLs, while Opera does not. This suggests that Chrome's behaviour is a deliberate application-level mitigation rather than a framework-level protection. The difference is important: it demonstrates that application-level mitigations can prevent the crash, but they do not address the underlying framework condition. A malicious payload delivered through an app that lacks such a mitigation (like Opera) still triggers the TransactionTooLargeException and crash. This aligns with Google's documented position that TransactionTooLargeException is a framework constraint, not a security vulnerability. However, the availability of application-level mitigations does not eliminate the underlying risk for apps that do not implement them.


11. Proposed mitigation

11.1. Application-level mitigation

The browser should check the URL size before constructing the Intent that will be transferred via Binder.

URL
 ↓
Size validation
 ↓
Does it exceed the limit?
 ├── Yes → truncate / reject / safe alternative
 └── No → build ACTION_SEND

This is the preferred defense because it prevents the oversized object from reaching the IPC boundary. Browsers that already hide the Share option for excessively large URLs (Chrome, Edge) provide an example of this approach.

11.2. Framework-level mitigation

Android could provide additional protection mechanisms so that a transaction exceeding the limit does not necessarily result in an unrecoverable crash of the consuming process.

Oversized transaction
        ↓
Detect before / during IPC
        ↓
Controlled failure
        ↓
Fallback
        ↓
Application remains operational

Late detection of a size condition should not automatically become a process termination condition when a safe alternative exists.

11.3. SavedState / FragmentManager (related surface)

In related SavedState surfaces, the research additionally proposes controlled fallback against errors occurring during restoration of excessively large state.

try {
    restoreStateInternal(state);
} catch (TransactionTooLargeException e) {
    Log.e(TAG, "SavedState restore failed. Restarting without state.", e);
}

The goal would be to degrade to a clean state when it is safe to do so, rather than propagating the exception to cause a crash.


12. Classification

STA-003 can be classified as:

Binder Serialization Boundary Resource Exhaustion

Within the STA model:

"Uncontrolled amplification / expansion across a serialization and IPC boundary leading to resource exhaustion."

The vector also has an important characteristic: the initial data can be completely valid from a semantic point of view — a URL — and become dangerous solely due to its size and the cost of transporting it between components.


13. Scope of the claim

STA-003 does not demonstrate that Binder is inherently vulnerable or that all Android browsers are exploitable.

The research demonstrates a more specific condition:

"When an application allows excessively large data to reach an ACTION_SEND operation and subsequently cross Binder without sufficient prior validation, the transaction size limit can become a denial-of-service mechanism."

Successful exploitation depends on the specific browser implementation and whether it incorporates validation, truncation, or fallback before constructing or sending the Intent.


14. Research status

Field Value
Vector STA-003
First formal communication 20 January 2026
Researcher Manuel García Peña (Lostmon)
Nature Independent research
Platform Android
Primary surface Browser → Intent.ACTION_SEND → Binder
Impact DoS
Interaction required Yes
Privileges None
Special permissions None

STA-003 is part of the broader Structured Text Amplification (STA) research, which studies a recurring pattern of resource exhaustion produced when input data crosses serialization, transformation, IPC, or persistence boundaries without sufficiently early resource limits.


15. Conclusion

STA-003 demonstrates how an ordinary operation — sharing a link — can become a denial-of-service condition when an oversized input crosses multiple representation layers:

URL
 → Intent
 → Parcel
 → Binder
 → transaction limit
 → TransactionTooLargeException
 → crash

The most robust mitigation is to measure and limit the size before reaching the amplification or IPC boundary, complemented by fallback mechanisms that prevent an oversize condition from unnecessarily becoming a process crash.

In the context of STA, this vector constitutes an example of how a legitimate-looking structured input can become a resource exhaustion condition when crossing a serialization boundary.


Complete whitepaper: Resilience Gaps in Android IPC, SavedState and Text Layout — v6 (August 2026)


📌 About this series
This post is part of a series documenting the 32 vectors of Structured Text Amplification (STA).

Published:
STA-005 — WhatsApp
STA-003 — Binder Share Intent (this post)

Whitepaper: Resilience Gaps in Android IPC, SavedState and Text Layout v5


Lostmon · lostmon.blogspot.com

 

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