CVE-2025-22426 AI-generated analysis
platform/frameworks/base, PackageManagerService (services/core/java/com/android/server/pm/ComputerEngine.java, content provider resolution)
Moves the mUserManager.exists(userId) check and updateFlagsForComponent() in ComputerEngine.resolveContentProvider so they run after the userId has been parsed out of the authority string, so a user id embedded in the provider name is validated before the provider is resolved.
Root cause
ComputerEngine.resolveContentProvider first checked mUserManager.exists(userId) and computed flags for the userId parameter. Only after that did it re-derive userId from the authority string via ContentProvider.getUserIdFromAuthority(name, userId), so the user id carried in the name was never checked for existence. According to the commit message, packageState.getUserStateOrDefault(userId) inside queryProvider then returned PackageUserStateInternal.DEFAULT, and an ApplicationInfo was obtained for a user that was never created. The commit message says this is not the intended behaviour.
How the fix works
- services/core/java/com/android/server/pm/ComputerEngine.java:resolveContentProvider: the two lines 'if (!mUserManager.exists(userId)) return null;' and 'flags = updateFlagsForComponent(flags, userId);' are removed from the function entry.
- The same two lines are re-inserted immediately after 'authorityWithoutUserId = ContentProvider.getAuthorityWithoutUserId(name)' and 'userId = ContentProvider.getUserIdFromAuthority(name, userId)'. The existence check and flag adjustment now operate on the effective userId (the one embedded in the name when present), before mComponentResolver.queryProvider is called.
- No other logic is changed. The later checkAuthorityGrants / cross-user enforcement path is untouched, and the fix is purely a reordering (3 lines moved).
Completeness
- Covers the single entry point ComputerEngine.resolveContentProvider. Per index search, IPackageManagerBase.resolveContentProvider, PackageManagerInternalBase.resolveContentProvider, ContentProviderHelper.getProviderInfoLocked and UriGrantsManagerService.getProviderInfo all reach it, so all of those callers get the corrected check.
- Both the existence check and updateFlagsForComponent now use the parsed userId. Before the fix, flags were also computed for the wrong user.
- The fix adds no validation inside mComponentResolver.queryProvider or around packageState.getUserStateOrDefault(userId); it relies on the early return in resolveContentProvider. Any other path that reaches queryProvider with an unvalidated userId is not addressed by this diff (the material shows none).
- The later cross-user permission logic (checkAuthorityGrants, enforceCrossUser, isAuthorityRedirectedForCloneProfile) is unchanged.
Behavior changes
- resolveContentProvider now returns null when the user id embedded in the authority string does not exist. Before, it resolved the provider using default user state.
- updateFlagsForComponent is now applied using the parsed (effective) userId rather than the userId parameter. This may change the flags used for the query when the name carries a different user id.
- No new exceptions or error codes. The only observable difference is a null result when the user is invalid.
Per major
- Android 14: same fix: platform/frameworks/base 1329a9c3ce3c in android-security-14.0.0_r28, an identical 3-line reorder in ComputerEngine.resolveContentProvider; 8/8 lines of the patched region present at android-security-14.0.0_r31.
- Android 15: same fix: platform/frameworks/base 1cbbf73a3c71 in android-security-15.0.0_r16, an identical diff at a different line offset (4732); 8/8 lines present at android-security-15.0.0_r19.
- Android 16: same fix: platform/frameworks/base 02fc7472ebb2 in android-security-16.0.0_r7, an identical diff at line offset 4787; 8/8 lines present at android-security-16.0.0_r10.
- Android 17: the resolver linked a different commit: platform/packages/modules/IntentResolver e4b1a233fb17 in android-security-17.0.0_r3. It changes UriCallerReadAccessValidator.kt so that CallerUriReadAccessValidatorModule.packageName uses activityModelRepository.value.launchedFromPackage instead of context.packageName. 2/3 lines of the patched region are present. The material does not show the ComputerEngine.resolveContentProvider reorder for Android 17.
Unknowns
- Whether the Android 17 branch contains the ComputerEngine.resolveContentProvider reorder. On 17 the material only links an IntentResolver change (e4b1a233fb17) to this CVE and does not explain how it relates to the ComputerEngine fix.
- What concrete privilege escalation results from resolving a provider for a non-existent user. The bulletin only rates it High EoP, and the commit message describes the unexpected result, not the consequence.
- Whether the explicit userId parameter path (no user id in the name) was ever affected. From the code, it was already checked both before and after the fix.