Android security tags, read closely by Lightrion

CVE-2023-40096 AI-generated analysis

platform/frameworks/av, services/audiopolicy (AudioPolicyService, OpRecordAudioMonitor / AppOps record-audio monitoring)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (6 corrections). Verify against the commit before relying on it.

AudioPolicyService::OpRecordAudioMonitor now registers its AppOps watcher with AppOpsManager::WATCH_FOREGROUND_CHANGES only for apps that target SDK U or later, after an interim revert that removed the flag for all apps. For those apps, foreground and background transitions are watched, so background recording can be silenced.

Root cause

In services/audiopolicy/service/AudioPolicyService.cpp, OpRecordAudioMonitor::onFirstRef() calls checkOp() and then mAppOpsManager.startWatchingMode(mAppOp, packageName, mOpCallback). Without the AppOpsManager::WATCH_FOREGROUND_CHANGES flag, the watcher is not registered for foreground-state changes. A foreground-only record op is therefore not re-evaluated when the app goes to the background. An earlier commit, 7370c8442e66 ("Listen for foreground AppOps changes"), had passed the flag unconditionally. The two commits in the material first revert it, because it broke VOIP apps that record in the background, and then re-apply it based on the app's targetSdk.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings