CVE-2026-49923 AI-generated analysis
platform/frameworks/base, services/core AccountManagerService (accounts)
AccountManagerService.getAuthToken now only posts the auth-failure notification on behalf of an authenticator if the authenticator's package holds POST_NOTIFICATIONS for the target user; otherwise it logs a warning and skips the notification.
Root cause
In AccountManagerService.getAuthToken, the onResult handler of the anonymous callback takes the KEY_INTENT returned by the account authenticator. When notifyOnAuthFailure is set and customTokens is false, after checkKeyIntent it called doNotification(..., intent, "android", accounts.userId) unconditionally. The notification is posted with package "android" and carries the authenticator-supplied intent and KEY_AUTH_FAILED_MESSAGE. Nothing checked whether the authenticator's own package is allowed to post notifications, so an authenticator without POST_NOTIFICATIONS could have a notification shown through this path.
How the fix works
- services/core/java/com/android/server/accounts/AccountManagerService.java, getAuthToken, onResult handler of the anonymous callback: after the existing checkKeyIntent(Binder.getCallingUid(), result) validation, a new boolean hasNotificationPermission is set to isPermittedForPackage(authenticatorInfo.type.packageName, accounts.userId, android.Manifest.permission.POST_NOTIFICATIONS) when authenticatorInfo is non-null. Otherwise it stays false.
- doNotification(mAccounts, account, result.getString(KEY_AUTH_FAILED_MESSAGE), intent, "android", accounts.userId) is now only invoked when hasNotificationPermission is true. In the else branch a Slog.w states that the authenticator for account.type lacks POST_NOTIFICATIONS, and no notification is posted.
- Control flow is otherwise unchanged: super.onResult(result) is still called, so the result is still delivered to the caller. Only the notification side effect is gated.
Completeness
- Covers only the getAuthToken(notifyOnAuthFailure) path in AccountManagerService. The gate is applied at the single doNotification call shown in the diff.
- Fails closed: if authenticatorInfo is null the notification is skipped rather than posted.
- The existing checkKeyIntent validation of the intent is kept. The fix adds a permission gate on top of it rather than replacing it.
- The material does not show other doNotification call sites in AccountManagerService, so whether any sibling notification path remains ungated cannot be judged from this material.
- The semantics of isPermittedForPackage are not shown in the material.
Behavior changes
- Authenticator packages without POST_NOTIFICATIONS (or with a null authenticatorInfo) no longer get the auth-failure notification from getAuthToken. A Slog.w line is logged instead.
- No new error is returned to the getAuthToken caller; the result bundle is still passed through super.onResult(result).
- Authenticators that hold POST_NOTIFICATIONS see no change.
Per major
- Android 14: same fix: commit b2142726cb61 in android-security-14.0.0_r29, hunk at line ~3258; 4/4 patched lines present at android-security-14.0.0_r31
- Android 15: same fix: commit 7cdef410dc98 in android-security-15.0.0_r17, identical hunk at line ~3324 (offset only); 4/4 lines present at android-security-15.0.0_r19
- Android 16: same fix: commit 0209580ab87a in android-security-16.0.0_r8, identical hunk at line ~3363 (offset only); 4/4 lines present at android-security-16.0.0_r10
- Android 17: same fix: commit 865939513d46 in android-security-17.0.0_r1, identical hunk at line ~3332 (offset only); 4/4 lines present at android-security-17.0.0_r3
Unknowns
- Implementation and exact semantics of isPermittedForPackage are not included in the material.
- Whether other notification-posting paths in AccountManagerService (outside getAuthToken) exist and whether they are gated is not shown.
- Test coverage: the commit message says Test: manual; no automated test is included in the diff.