CVE-2025-48573 AI-generated analysis
platform/frameworks/base, MediaSessionService (services/core/java/com/android/server/media/MediaSessionRecord.java)
Removes the temporary allowlist grant (tempAllowlistTargetPkgIfPossible) that system_server made to the media session owner whenever a controller invoked MediaController.sendCommand, so this call no longer propagates while-in-use / background-FGS-launch privileges.
Root cause
In MediaSessionRecord's session callback wrapper, sendCommand(packageName, pid, uid, command, args, cb) called mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(), pid, uid, packageName, reason) before forwarding the command to the session's callback (mCb.onCommand). This temporarily allowlists the session-owning package (getUid()/getPackageName()) on behalf of the calling controller (pid/uid/packageName). Per the commit message, this propagates while-in-use (WIU) permissions and background foreground-service-launch (BFSL) capability. The commit states that sendCommand is only meant for exchanging technical information and should not be a way to grant another app these privileges. The same removed lines appear in the Android 14, 15 and 16 diffs.
How the fix works
- services/core/java/com/android/server/media/MediaSessionRecord.java : sendCommand (session callback wrapper inside MediaSessionRecord): deletes the three lines that build the reason string (TAG + ":" + command) and call mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(), pid, uid, packageName, reason). The method now only forwards to mCb.onCommand(packageName, pid, uid, command, args, cb) inside the existing try/catch for RemoteException.
- Single-commit fix. It adds no new checks; it removes the privilege grant from this path.
Completeness
- Covers exactly one entry point: the sendCommand path of the session callback wrapper. Forwarding of the command itself is unchanged, so the session app still receives the command; the only difference is the missing allowlist grant.
- Sibling methods in the same class still call mService.tempAllowlistTargetPkgIfPossible: sendMediaButton (only when KeyEvent.isMediaSessionKey is true), sendCustomAction (reason TAG + ":custom-" + action) and prepare (reason TAG + ":prepare"), per the code context at android-security-14.0.0_r29. The commit message does not mention these methods, and this fix does not change them.
- The internal eligibility logic of tempAllowlistTargetPkgIfPossible is not shown in the material and is not modified.
Behavior changes
- A session-owning app no longer receives a temporary allowlist entry as a side effect of a controller calling MediaController.sendCommand. Per the commit message, this entry covered while-in-use permissions and permission to start a foreground service. Apps that depended on this grant may lose the ability to start a foreground service from the background in this flow; the exact effect depends on tempAllowlistTargetPkgIfPossible, which is not shown.
- No new exception, error code or API surface change. The command is still delivered to the session callback.
Per major
- Android 14: same fix: commit 21481e44fa92 in android-security-14.0.0_r24 removes the 3-line allowlist call from sendCommand (the catch block uses Log.e). At android-security-14.0.0_r29 the code context shows sendCommand without the call (7/8 lines of the patched region present).
- Android 15: same fix: commit c88cb354b7fa in android-security-15.0.0_r12, the same 3-line removal (the class extends MediaSessionRecordImpl and the catch block uses Slog.e). 7/8 lines of the patched region are present at android-security-15.0.0_r17.
- Android 16: same fix: commit 039030a6b0e7 in android-security-16.0.0_r3, the same 3-line removal. 7/8 lines of the patched region are present at android-security-16.0.0_r8.
- Android 17: not affected per the bulletin. At android-security-17.0.0_r1, 6/8 lines of the patched region are present. The material does not show the exact code.
Unknowns
- The implementation of MediaSessionService.tempAllowlistTargetPkgIfPossible (what caller state it requires and exactly what it grants) is not in the material.
- Whether Android 13 (listed as affected by the bulletin) received a corresponding commit is not shown.
- The material does not say whether Google intentionally kept the allowlist grant in sendCustomAction, prepare and sendMediaButton.