CVE-2025-32329 AI-generated analysis
platform/frameworks/base, services/autofill (FillUi, DialogFillUi, SaveUi, Session, Helper)
Autofill system UI (FillUi, DialogFillUi, SaveUi) now applies the fill service's RemoteViews presentations with a Context created for the current foreground user (new Helper.getUserContext) instead of the system_server user-0 context, and Session's custom icon/label PackageManager lookups run under a cleared Binder calling identity.
Root cause
FillUi, DialogFillUi and SaveUi run inside system_server and inflate RemoteViews presentations that come from the autofill service's FillResponse. Before the fix they called presentation.applyWithTheme(mContext, ...), and SaveUi built its ContextThemeWrapper over the plain system context, so this inflation ran as user 0 (system_server's user). The commit message says: "Autofill will inflate views as the current foreground user instead of the system_server user (0)". The bulletin rates this High, EoP.
How the fix works
- Helper.java: adds public static Context getUserContext(Context), annotated @RequiresPermission(INTERACT_ACROSS_USERS). It reads ActivityManager.getCurrentUser() and returns context.createContextAsUser(UserHandle.of(userId), 0). When sDebug is set it logs the user id and the content resolver's user id.
- FillUi.java, FillUi(...) constructor: new field mUserContext = Helper.getUserContext(mContext). Four RemoteViews inflation sites now pass mUserContext to applyWithTheme: response.getPresentation(), headerPresentation (mHeader), footerPresentation (mFooter) and each dataset presentation in the loop. The decor layout is still inflated through LayoutInflater.from(mContext). dump() prints mUserContext. The constructor gets @SuppressWarnings("AndroidFrameworkRequiresPermission") with the comment 'System has all permissions, see b/228957088'.
- DialogFillUi.java, DialogFillUi(...) constructor: mUserContext = Helper.getUserContext(mContext). Three presentation.applyWithTheme call sites now use mUserContext: two that add content to a container, and the per-dataset remote views in the loop. The autofill_fill_dialog layout is still inflated from mContext.
- SaveUi.java, SaveUi(...) constructor: the anonymous ContextThemeWrapper is now built over Helper.getUserContext(context) instead of context, so the LayoutInflater that inflates autofill_save uses the foreground-user context.
- Session.java, getServiceIcon(FillResponse) and the matching custom service label block: the PackageManager getDrawable(...) and getText(...) calls for response.getIconResourceId() and getServiceDisplayNameResourceId() are wrapped in Binder.clearCallingIdentity()/restoreCallingIdentity(token).
Completeness
- The fix switches every RemoteViews application site shown in the diff to the foreground-user context: 4 in FillUi, 3 in DialogFillUi, and SaveUi's whole wrapped context.
- The user comes from ActivityManager.getCurrentUser() (the global foreground user), not from the autofill session's own user id. The material does not show how this behaves when the two differ.
- The Session.java changes only clear the calling identity around the icon/label fetch. They do not change which context resolves the resources (still mService.getMaster().getContext()).
- FillUi and DialogFillUi still inflate their own layouts with the system context. SaveUi's own autofill_save layout is now inflated with the foreground-user context.
Behavior changes
- Service-supplied RemoteViews in the fill, fill-dialog and save UIs are applied with a Context for the current foreground user.
- SaveUi's whole Context, including its startActivity override and LayoutInflater, now wraps the foreground-user context.
- Helper.getUserContext adds a debug log line when sDebug is set, and FillUi.dump prints mUserContext.
- Session's custom service icon/label resource fetch now runs with cleared Binder calling identity.
Per major
- Android 14: same fix: platform/frameworks/base f08b9104a6e9 in android-security-14.0.0_r24 (RESTRICT AUTOMERGE cherry-pick, Change-Id I8a2c9625...). Patched region fully present at android-security-14.0.0_r29 (8/8 lines).
- Android 15: same fix: 3ca035e4cdf3 in android-security-15.0.0_r12, with the same content. In FillUi the mUserContext assignment comes after the mMaxInputLengthForAutofill assignment. Patched region fully present at android-security-15.0.0_r17 (8/8 lines).
- Android 16: not affected per the bulletin (not listed). Patched-region lines present at android-security-16.0.0_r8 (8/8).
- Android 17: not affected per the bulletin (not listed). Patched-region lines present at android-security-17.0.0_r1 (8/8).
Unknowns
- Which resource or content resolution inside the RemoteViews was reachable as user 0, and what that exposed. The material says only that inflation happened as the system_server user.
- Why the Binder identity clearing in Session's icon/label fetch was needed, and how it changes outcomes.
- Whether an Android 13 commit exists, what it contains, and whether the Android 14 diff applies to 13.
- Behavior when the autofill session's user differs from ActivityManager.getCurrentUser().