CVE-2026-49924 AI-generated analysis
platform/frameworks/base, ShortcutService / ShortcutInfo (services/core/java/com/android/server/pm, core/java/android/content/pm)
ShortcutService now measures the parcelled size of every ShortcutInfo submitted via setDynamicShortcuts, addDynamicShortcuts, updateShortcuts and pushDynamicShortcut, trims Persons/Extras when a shortcut exceeds 32KB, and drops it if it still exceeds the limit.
Root cause
ShortcutService accepted ShortcutInfo objects from apps through the publishing APIs with only package verification (verifyShortcutInfoPackages / verifyShortcutInfoPackage) and no bound on the size of an individual shortcut. An app could therefore submit arbitrarily large shortcuts (large Person arrays, large PersistableBundle extras, large intent extras, etc.) that the service would accept. The bulletin classifies the result as a High severity DoS; the exact failure mode is not shown in the material.
How the fix works
- ShortcutService.java: adds constants MAX_SHORTCUT_TOTAL_SIZE_BYTES = 32 * 1024 and MAX_TRIMMED_PERSONS = 20.
- ShortcutService.java:isWithinMaxSize(ShortcutInfo, Parcel): resets the parcel, calls si.writeToParcel(parcel, 0) and returns parcel.dataSize() <= MAX_SHORTCUT_TOTAL_SIZE_BYTES. The limit is the Parcel representation size, not the XML persisted size.
- ShortcutService.java:tryTrimShortcut(ShortcutInfo, Parcel): three ordered steps, each on a fresh copy via the new ShortcutInfo(ShortcutInfo) copy constructor and re-checked with isWithinMaxSize: (1) if persons.length > 20, Arrays.copyOf to 20 via setPersons; (2) if extras non-null and non-empty, replace with new PersistableBundle() via setExtras; (3) if persons still present, setPersons(null). Returns the (possibly still oversized) result.
- ShortcutService.java:sanitizeShortcutSize(ShortcutInfo, Parcel): returns si unchanged if within limit; otherwise returns the trimmed copy if it fits, else null.
- ShortcutService.java:sanitizeShortcutSizes(List<ShortcutInfo>): iterates backwards over the caller's list, removes null entries, removes entries whose sanitize result is null (with a Slog.w), and replaces entries with their trimmed copy when one was produced.
- ShortcutService.java:sanitizeShortcutSize(ShortcutInfo): single-item wrapper that obtains/recycles its own Parcel and logs the oversize/drop case.
- ShortcutService.java:setDynamicShortcuts, addDynamicShortcuts, updateShortcuts: sanitizeShortcutSizes(newShortcuts) is called immediately after verifyShortcutInfoPackages and before `final int size = newShortcuts.size()`, so later logic sees only validated shortcuts.
- ShortcutService.java:pushDynamicShortcut: shortcut = sanitizeShortcutSize(shortcut) after verifyShortcutInfoPackage; returns early if null (also covers a null input, see testPushDynamicShortcut_nullShortcut_ignoredWithoutCrash).
- ShortcutInfo.java: adds @hide copy constructor ShortcutInfo(ShortcutInfo source) delegating to ShortcutInfo(source, 0), @hide setPersons(Person[]) (clones via clonePersons) and @hide setExtras(PersistableBundle) (direct assignment). Also adds @hide Builder(Context, ShortcutInfo source) copy builder and a Builder.mStartingThemeResName field, with the private ShortcutInfo(Builder) constructor now falling back to b.mStartingThemeResName when no theme res id is set. The Builder copy path is not used by the ShortcutService changes in this diff.
- Tests: new ShortcutSizeValidationTest covering drop/trim across all four APIs; BaseShortcutManagerTest.createPackageContextAsUser now returns a PackageContext with the right package name and user; ShortcutManagerTest2 casts null to (String) because the new Builder(Context, ShortcutInfo) overload makes the null literal ambiguous.
Completeness
- Covers the four app-facing publishing entry points in ShortcutService: setDynamicShortcuts, addDynamicShortcuts, updateShortcuts, pushDynamicShortcut. Other ways a ShortcutInfo can enter the service (for example pinned shortcut requests, manifest shortcuts, restore) are not touched by this diff; the material does not show whether they have an equivalent bound.
- Trimming only reduces Persons and the top-level Extras bundle. Size contributed by intents/intent extras, icon, labels, categories, locus id or capability bindings is not trimmed, so a shortcut that is oversized for those reasons is dropped outright (testPushDynamicShortcut_oversizedAndUntrimmable_dropsSilently).
- The 32KB bound is per shortcut; the diff does not change any per-package shortcut count limit.
- Within the four patched APIs, validation runs after package verification but before the rest of the API logic.
Behavior changes
- A ShortcutInfo whose parcelled size exceeds 32KB is silently trimmed (persons capped at 20, then extras cleared, then persons removed) or dropped; the app receives no error. Bulk APIs still return true even when every entry was dropped (testBulkApi_allOversizedAndDropped_succeedsSilently).
- updateShortcuts with an oversized, untrimmable entry leaves the existing shortcut unchanged rather than updating it.
- pushDynamicShortcut with an oversized, untrimmable shortcut (or null) returns without publishing anything.
- Null entries in the submitted lists are now removed before processing.
- New Slog.w log lines on trim-failure/drop with the shortcut ID and activity.
- Trimmed shortcuts are new copies (ShortcutInfo copy constructor with flags 0), not the caller's objects; getDynamicShortcuts returns the trimmed content.
Per major
- Android 14: same fix: platform/frameworks/base 01bf19b34e45 in android-security-14.0.0_r29, identical content with line-offset differences (context shows mLock instead of mServiceLock, android.os.Handler import region). Resolver reports 7/8 lines of the patched region present at android-security-14.0.0_r31.
- Android 15: same fix: platform/frameworks/base df66a8f07d3b in android-security-15.0.0_r17 (the analysed commit). Resolver reports 7/8 lines present at android-security-15.0.0_r19; the code context at r19 shows the ShortcutInfo constructor change in place.
- Android 16: same fix: platform/frameworks/base cf0b6cd90ce0 in android-security-16.0.0_r8, identical content with line-offset differences. Resolver reports 7/8 lines present at android-security-16.0.0_r10.
- Android 17: same fix: platform/frameworks/base 560b2df86acf in android-security-17.0.0_r1, identical content; in pushDynamicShortcut the sanitize/early-return is inserted before the existing isPackageAppLockEnabled check. Resolver reports 7/8 lines present at android-security-17.0.0_r3.
Unknowns
- The concrete DoS mechanism (what fails in system_server or on disk when oversized shortcuts are accepted) is not shown; only the bulletin's DoS/High classification and the commit message's 'excessively large shortcuts' wording are available.
- Why the resolver reports 7/8 rather than 8/8 lines of the patched region in every latest security tag is not explained by the material.
- Whether other ingestion paths for ShortcutInfo (pin requests, manifest parsing, backup restore) have a comparable size bound is not shown.
- Existing per-package shortcut count limits, and therefore any total size bound, are not shown.
- The diff context does not show which caller checks the list APIs run before verifyShortcutInfoPackages.
- The two Cherrypick-From sources suggest an upstream two-change history; the split between them is not visible.
- Index results for callers of the patched ShortcutService methods were not available (the index search covered only callers of the test helper assertExpectException).