CVE-2025-22424 AI-generated analysis
platform/frameworks/base, PackageManagerService (services/core/java/com/android/server/pm/ComputerEngine.java); on Android 17 also platform/packages/modules/IntentResolver
PackageManager's ComputerEngine.resolveContentProvider now splits a "userId@authority" name into its user and authority parts before resolving, and the cross-user permission helper checks INTERACT_ACROSS_USERS(_FULL) against an explicit UID instead of using Context#checkCallingOrSelfPermission.
Root cause
ComputerEngine.resolveContentProvider passed the caller-supplied authority string unchanged to mComponentResolver.queryProvider and isAuthorityRedirectedForCloneProfile. Callers may supply an authority of the form "[email protected]". The userId encoded in the name was not stripped and was not used to select the target user, so the lookup and the later cross-user checks worked on the wrong user/authority pair. Separately, checkCrossUserPermission relied on hasPermission(String), which according to the commit message uses Context#checkCallingOrSelfPermission. That checked the calling or self identity rather than the callingUid argument the method was given.
How the fix works
- Commit 1 (e786773b7ff0), ComputerEngine.java: adds hasPermission(String permission, int uid), which calls mContext.checkPermission(permission, pid=-1, uid). checkCrossUserPermission now uses this overload with callingUid for both INTERACT_ACROSS_USERS_FULL and INTERACT_ACROSS_USERS.
- Commit 1, ComputerEngine.java: to keep legacy behavior, three call sites that previously passed a callingUid parameter now pass Binder.getCallingUid(). These are queryIntentServicesInternal (enforceCrossUserOrProfilePermission; its message also changes from "query intent receivers" to "query intent services"), the enforceCrossUserPermission call near line 4595 (a path with MATCH_APEX handling), and getComponentEnabledSetting.
- Commit 1, PackageManagerComponentLabelIconOverrideTest.kt: the mocked Context gains a stub for checkPermission(eq(INTERACT_ACROSS_USERS_FULL), anyInt(), anyInt()) that returns PERMISSION_GRANTED.
- Commit 2 (98b6fa464f3e), ComputerEngine.resolveContentProvider: imports android.content.ContentProvider and computes authorityWithoutUserId = ContentProvider.getAuthorityWithoutUserId(name) and userId = ContentProvider.getUserIdFromAuthority(name, userId). It passes authorityWithoutUserId and the parsed userId to mComponentResolver.queryProvider, and passes authorityWithoutUserId to isAuthorityRedirectedForCloneProfile.
- Android 16 commit (02fc7472ebb2), ComputerEngine.resolveContentProvider: moves the mUserManager.exists(userId) check and updateFlagsForComponent(flags, userId) below the authority parsing, so they use the parsed userId.
Completeness
- Authority parsing is applied only in ComputerEngine.resolveContentProvider. The material shows no change to other provider lookup paths.
- In the Android 14 commit, mUserManager.exists(userId) and updateFlagsForComponent(flags, userId) still run before parsing, so they use the caller-supplied userId rather than the one embedded in the authority. The Android 16 commit 02fc7472ebb2 reorders them. The material does not show whether that reorder was applied to 14 or 15.
- The UID-based hasPermission overload is used only in checkCrossUserPermission. The old hasPermission(String) remains, and this fix does not change any of its other callers.
- Three enforcement call sites were deliberately switched to Binder.getCallingUid() to keep legacy behavior. On those paths, the explicit callingUid parameter is no longer the UID that gets authorized.
Behavior changes
- resolveContentProvider with a "userId@authority" name now resolves the provider for the embedded user and the bare authority instead of looking up the literal string.
- isAuthorityRedirectedForCloneProfile receives the authority without the user prefix.
- checkCrossUserPermission now checks permissions for the given UID with pid -1 through Context.checkPermission. Results may differ from the previous check when callingUid differs from the calling identity.
- queryIntentServicesInternal, the path near line 4595, and getComponentEnabledSetting enforce cross-user permission against Binder.getCallingUid() rather than the supplied callingUid.
- The SecurityException message for queryIntentServicesInternal now reads "query intent services".
Per major
- Android 14: Same fix: two commits in android-security-14.0.0_r19 (e786773b7ff0 for the UID-based permission check, then 98b6fa464f3e for authority parsing). 8/8 lines of the patched region are present at android-security-14.0.0_r31. The material does not show whether the Android 16 reorder of the user-exists check was applied.
- Android 15: Resolved by bug_id in android-security-15.0.0_r7. The material shows febc0a24abdc (the UID-based permission check; the enforceCrossUserPermission call near line 4651 sits inside an if (!forceAllowCrossUser) block, otherwise the change matches 14). A 15 counterpart of the authority-parsing commit is not shown. 8/8 lines of the patched region are present at android-security-15.0.0_r19.
- Android 16: Adapted/extended: the parsing code is already present, and commit 02fc7472ebb2 in android-security-16.0.0_r7 moves mUserManager.exists(userId) and updateFlagsForComponent below the parsing. 8/8 lines are present at android-security-16.0.0_r10.
- Android 17: Resolved by change_id through a different change: platform/packages/modules/IntentResolver e4b1a233fb17 in android-security-17.0.0_r3 makes CallerUriReadAccessValidatorModule.packageName return activityModelRepository.value.launchedFromPackage instead of context.packageName. 2/3 lines of the patched region are present at android-security-17.0.0_r3. The material does not show the ComputerEngine changes on 17.
Unknowns
- Which callers pass user-qualified authorities to resolveContentProvider, and which internal callers pass a callingUid that differs from the calling identity.
- Whether the Android 16 reorder (02fc7472ebb2) was backported to 14 and 15.
- Whether the authority-parsing commit exists on Android 15 (only febc0a24abdc is shown).
- How the Android 17 IntentResolver change relates to the ComputerEngine changes, and why only 2/3 lines are present at android-security-17.0.0_r3.
- The exact body of the existing hasPermission(String) (only the commit message says it uses checkCallingOrSelfPermission).