CVE-2026-58965 AI-generated analysis
platform/frameworks/base, AudioService / MusicFxHelper (services/core/java/com/android/server/audio)
MusicFxHelper.handleAudioEffectBroadcast no longer relays the caller's audio-effect control intent wholesale as a system broadcast; it rebuilds a fresh intent with only the action and three known extras and resolves the target receiver with PackageManager.MATCH_SYSTEM_ONLY.
Root cause
In services/core/java/com/android/server/audio/MusicFxHelper.java, handleAudioEffectBroadcast(Context, Intent) took the caller-supplied intent (ACTION_OPEN/CLOSE_AUDIO_EFFECT_CONTROL_SESSION with no target package), resolved receivers with pm.queryBroadcastReceivers(intent, 0), added FLAG_INCLUDE_STOPPED_PACKAGES, set intent.setPackage(ril.get(0).activityInfo.packageName) and sent that same object via context.sendBroadcastAsUser(intent, UserHandle.ALL). Two problems: every extra, flag, data and other attribute the caller placed in the intent was forwarded in a broadcast originating from the system to all users; and because the receiver query used flags 0, the first matching receiver could belong to any installed package, not only a system component, so the system-originated broadcast could be delivered to a non-system receiver.
How the fix works
- MusicFxHelper.java:handleAudioEffectBroadcast - receiver query changed from pm.queryBroadcastReceivers(intent, 0) to pm.queryBroadcastReceivers(intent, PackageManager.MATCH_SYSTEM_ONLY), so only system-package receivers can be selected as ril.get(0).
- MusicFxHelper.java:handleAudioEffectBroadcast - instead of mutating and forwarding the caller's intent, a new Intent cleanIntent = new Intent(intent.getAction()) is built. It copies only: EXTRA_PACKAGE_NAME (the already null-checked senderPackageName), EXTRA_AUDIO_SESSION read via getIntExtra with AudioManager.AUDIO_SESSION_ID_GENERATE as default, and EXTRA_CONTENT_TYPE only if present, read via getIntExtra with AudioEffect.CONTENT_TYPE_MUSIC as default. Then FLAG_INCLUDE_STOPPED_PACKAGES and setPackage(ri.activityInfo.packageName) are applied to cleanIntent.
- MusicFxHelper.java:handleAudioEffectBroadcast - setMusicFxServiceWithObserver(cleanIntent, senderUid, senderPackageName) and context.sendBroadcastAsUser(cleanIntent, UserHandle.ALL) now operate on the sanitized intent; the original intent is never sent.
- Android 16/17 commits additionally add MusicFxHelperTest.testBroadcastIntentQueriesSystemOnly and testBroadcastIntentIsSanitized (asserting the broadcast extras key set is exactly EXTRA_PACKAGE_NAME, EXTRA_AUDIO_SESSION, EXTRA_CONTENT_TYPE). The Android 15 commit contains no test change.
Completeness
- Covers the single relay point in handleAudioEffectBroadcast: both the extras payload (allowlist of three extras, ints only) and the receiver selection (MATCH_SYSTEM_ONLY) are addressed in the same function.
- The intent action is copied unchanged from the caller's intent (new Intent(intent.getAction())); the function itself does not validate the action, so filtering of which actions reach this method depends on the caller, which is not shown in the material.
- Caller-supplied flags, data URI, categories, ClipData and component are dropped because cleanIntent is built from scratch; only FLAG_INCLUDE_STOPPED_PACKAGES is re-added.
- Receiver selection still uses ril.get(0) without further ordering or validation beyond MATCH_SYSTEM_ONLY; the TODO about targeting a user-selected panel remains.
- On Android 14 the adapted fix keeps proceeding when EXTRA_PACKAGE_NAME is null (the extra is simply omitted), whereas 15+ returns early on a null sender package; the pre-fix 14 code path had no such check either.
- No other broadcast-relay sites are modified; the material does not show whether any exist.
Behavior changes
- Receivers for the audio effect control session actions in non-system packages are no longer resolved or sent the relayed broadcast.
- The relayed broadcast carries only EXTRA_PACKAGE_NAME, EXTRA_AUDIO_SESSION and (if present) EXTRA_CONTENT_TYPE; any other extras, flags, data or categories supplied by the sender are silently dropped.
- EXTRA_AUDIO_SESSION and EXTRA_CONTENT_TYPE are coerced to int; a missing EXTRA_AUDIO_SESSION becomes AudioManager.AUDIO_SESSION_ID_GENERATE, and a present EXTRA_CONTENT_TYPE that cannot be read as int becomes AudioEffect.CONTENT_TYPE_MUSIC.
- Android 14 only: handleAudioEffectBroadcast in AudioService gains a @RequiresPermission(INTERACT_ACROSS_USERS) annotation (annotation only, no runtime change).
Per major
- Android 14: adapted fix (platform/frameworks/base 5ab158e5e2e6, android-security-14.0.0_r31): the same sanitization and MATCH_SYSTEM_ONLY change is applied to AudioService.handleAudioEffectBroadcast in AudioService.java, without setMusicFxServiceWithObserver, with EXTRA_PACKAGE_NAME copied only if non-null, plus a @RequiresPermission annotation. 8/8 lines of the patched region present.
- Android 15: same fix (platform/frameworks/base e76770e472f7, android-security-15.0.0_r19): MusicFxHelper.java change only, no test added. 7/8 lines of the patched region present per resolver; which line differs is not shown, and the code context at that tag contains the full fix.
- Android 16: same fix (platform/frameworks/base 7925fecbf857, android-security-16.0.0_r10): identical MusicFxHelper.java change plus two new tests in services/tests/servicestests/src/com/android/server/audio/MusicFxHelperTest.java. 7/8 lines present per resolver.
- Android 17: same fix (platform/frameworks/base 2e373a0e5bc7, android-security-17.0.0_r3): identical MusicFxHelper.java change plus the same two tests, with the test file located at services/tests/audio/src/com/android/server/audio/MusicFxHelperTest.java. 7/8 lines present per resolver.
Unknowns
- The entry point that invokes handleAudioEffectBroadcast and what checks (permissions, action filtering) it applies before the call are not shown.
- Which extras or attributes were actually abused in the reported issue, and the concrete EoP outcome, are not described beyond the commit message and bulletin rating.
- Whether setMusicFxServiceWithObserver uses any intent attributes beyond those preserved in cleanIntent is not shown.
- Which line of the patched region the resolver counts as missing on 15, 16 and 17 (7/8) is not shown.
- Whether the 16/17 tests can be carried to Android 15 (existence and contents of a 15 MusicFxHelperTest) is not shown.