Race in Speech (CVE-2026-7960)
A race condition in the speech recognition startup flow allows a compromised renderer to bypass the microphone permission prompt by detaching an iframe during an asynchronous check. This results in silent, untracked audio capture from the user's default microphone.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 40 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A Time-of-Check Time-of-Use (TOCTOU) race condition in the speech recognition startup flow allows a compromised renderer to potentially bypass the microphone permission prompt. By detaching a requesting iframe during the asynchronous startup process, the browser incorrectly grants access under the assumption that the request originated from a privileged extension. This results in silent, untracked audio capture from the user's default microphone.
Affected files:
chrome/browser/speech/chrome_speech_recognition_manager_delegate.cccontent/browser/speech/speech_recognition_manager_impl.cccontent/browser/speech/speech_recognition_dispatcher_host.cccontent/browser/speech/speech_recognizer_impl.cc
Estimated timestamp from git blame: 2021-07-14
Microphone permission bypass via TOCTOU between StartRequestOnUI and CheckRenderFrameType FromID checks
A potential Time-of-Check Time-of-Use (TOCTOU) race condition exists in the speech recognition implementation that could allow a compromised renderer to bypass the microphone permission prompt and silently capture user audio transcripts. This represents a critical capability bypass for microphone access.
Technical Summary
When a speech recognition request is initiated via media::mojom::SpeechRecognizer::Start(), the following asynchronous sequence occurs across thread hops:
- Initial Check (UI Thread):
SpeechRecognitionDispatcherHost::StartRequestOnUIis called on the UI thread. It performs aRenderFrameHost::FromIDcheck to ensure the frame exists and gathers context before returning to the IO thread. - Session Creation (IO Thread):
SpeechRecognitionManagerImpl::CreateSessionallocates a new session. It posts a task to the UI thread (FrameSessionTracker::CreateObserverForSession) to monitor the frame's lifetime and clean up the session upon frame destruction. - Permission Check (UI Thread): The flow continues via
ChromeSpeechRecognitionManagerDelegate::CheckRenderFrameTypeback on the UI thread to determine if a permission prompt is required.
The Race Condition
A compromised renderer can initiate a request and then immediately detach the child iframe (e.g., via document.body.removeChild(iframe)). If the RenderFrameHost is destroyed on the UI thread after step 1 but before the checks in steps 2 and 3, two critical logic errors are triggered.
First, FrameSessionTracker::CreateObserverForSession (content/browser/speech/speech_recognition_manager_impl.cc:108) silently returns early because RenderFrameHost::FromID returns null. The session is now untracked and will not be automatically aborted.
Second, CheckRenderFrameType (chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc:175-183) implements flawed fallback logic:
if (!render_frame_host) {
// This happens for extensions. Manifest should be checked for permission.
allowed = true;
check_permission = false;
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), check_permission, allowed));
return;
}
The code incorrectly assumes that a null RenderFrameHost implies the request originated from a privileged extension, granting permission by default (allowed = true, check_permission = false). In reality, a null value here indicates that the frame has been destroyed during the race window.
Exploitation and Impact
Upon returning to the IO thread, SpeechRecognitionManagerImpl::RecognitionAllowedCallback receives ask_user = false and is_allowed = true. It dispatches EVENT_START and entirely skips calling MakeMediaAccessRequest, which means the permission UI is bypassed and site settings are ignored.
When SessionStart is called (speech_recognition_manager_impl.cc:890), it finds an empty list of authorized devices (since the prompt was skipped) and falls back to the user's default audio input device (kDefaultDeviceId). SpeechRecognizerImpl::CreateAudioCapturerSource (speech_recognizer_impl.cc:823) then binds directly to the audio service and begins silent microphone capture.
Because the session is untracked (step 2 failed), and SpeechRecognitionDispatcherHost is self-owned on the IO thread, the leaked session continues to transcribe audio indefinitely. The transcripts are returned to the renderer-controlled SpeechRecognitionSessionClient remote, which the attacker still controls from the main frame.
Suggested Steps to Reproduce
Note: These are potential steps, our tooling agent doesn't yet have the ability to run code to confirm them.
- From a compromised renderer process, create a child
iframeand request themedia::mojom::SpeechRecognizerinterface via theBrowserInterfaceBroker. - Send a
Start()request withaudio_forwarderunset (forcinguse_microphone = true) and provide a renderer-controlledSpeechRecognitionSessionClientremote. - Immediately detach the child
iframe. - If the race is won (the detach lands on the UI thread after
StartRequestOnUIbut beforeCheckRenderFrameType),CheckRenderFrameTypewill encounter a nullRenderFrameHostand incorrectly grant access. - Observe that the default microphone is activated without any user prompt, and transcripts are received by the renderer's client remote. Spawning multiple iframes and repeating this pattern can make the race condition highly reliable.
Suggested Fix
Do not rely solely on the absence of a RenderFrameHost to authorize extension requests in CheckRenderFrameType. Instead, explicitly check the requesting process's context or origin to verify it is indeed a privileged extension before granting allowed = true. Additionally, if a request requires a valid RenderFrameHost and it becomes null during the startup flow, the session should be immediately aborted rather than proceeding with default permissions.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the code incorrectly assumes that a null RenderFrameHost means the request came from a privileged extension, granting permission by default, and it fails to abort the session when the frame is destroyed during the asynchronous startup.
Impact
A compromised renderer could silently capture audio from the user's default microphone without any permission prompt, and the session may continue indefinitely.
What the attacker needed
Compromised renderer process; ability to create and detach iframes; race condition won
The fix
The code should not rely solely on a null RenderFrameHost to authorize extension requests; it should explicitly verify the requesting process's context or origin, and abort the session if the frame becomes null during startup.
How it was found
- From a compromised renderer, create a child iframe and request the SpeechRecognizer interface.
- Send a Start() request with audio_forwarder unset and provide a renderer-controlled client remote.
- Immediately detach the child iframe.
- If the race is won, CheckRenderFrameType sees a null RenderFrameHost and grants access.
- Observe that the default microphone is activated without a prompt and transcripts are received.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A race condition is when a program checks something and then uses it later, but the situation changes in between. Here, the browser checks if a frame exists, but if the frame is removed at just the right moment, the browser mistakenly thinks the request came from a trusted extension and grants microphone access without asking the user. This means a malicious website could listen in without any prompt.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.