Insufficient validation of untrusted input in GetUserMedia (CVE-2026-17795)
The browser process treated a media capture session ID as a global bearer token, so a renderer for one origin could pass another origin's session ID to the video and audio capture endpoints and receive live frames or audio. An attacker origin without camera or microphone permission could therefore consume an already-active victim capture session.
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Media capture endpoints accept cross-origin MediaStream session IDs
Summary
A compromised renderer for one origin can attach attacker-origin audio/video consumers to a different origin's already-granted microphone or camera capture session.
The browser process returns MediaStreamDevice.session_id values to the renderer when a media stream is opened. Normal Blink code uses those session IDs only for tracks owned by the current document. However, the browser-side live capture endpoints treat the renderer-supplied session ID as a global bearer token:
media.mojom.VideoCaptureHost.Start()accepts a victim-origin camerasession_idand starts delivering video frames to an attacker-originVideoCaptureObserver.blink.mojom.RendererAudioInputStreamFactory.CreateStream()accepts a victim-origin microphonesession_idand creates an attacker-origin audio input stream backed by the victim microphone device.
The attacker origin does not need camera or microphone permission. The victim origin has the permission and owns the active session. The violation is that the browser process does not validate that the supplied session ID belongs to the bound caller frame / origin before connecting the live media consumer.
This report uses MojoJS only to model the compromised-renderer condition and send raw Mojo messages. No browser patch is required.
Impact
This is a browser-side media permission and origin-ownership bypass for already-active capture sessions.
Expected security property:
MediaStreamDevice.session_id should only authorize stream consumers created by the frame / document / origin that owns the corresponding media stream. A renderer-supplied session ID should not let another origin attach a live media consumer to a victim-origin camera or microphone session.
Actual behavior:
The browser process accepts the victim-origin session ID from the attacker-origin Mojo caller and connects the attacker-controlled observer/client to the live capture pipeline.
For video, the attacker receives OnBufferReady() callbacks and shared-memory video buffers for the victim camera session, even though the attacker origin has not been granted camera permission. For audio, the attacker receives a browser-created AudioInputStream and a ReadWriteAudioDataPipe; after record(), the shared-memory audio data changes, proving the attacker-origin stream is backed by the victim-origin microphone session.
The PoC handoff of the victim session_id is intentional: it models a compromised renderer with access to a live victim MediaStreamDevice. The vulnerability is that the browser process fails to validate session ownership before returning live camera/microphone data to the caller.
Affected Code
MediaStreamDevice exposes the session token over Mojo:
171 struct MediaStreamDevice {
...
180 mojo_base.mojom.UnguessableToken? session_id;
181 media.mojom.DisplayMediaInformation? display_media_info;
182 };
media.mojom.VideoCaptureHost.Start() accepts a renderer-supplied session ID and attacker-supplied observer:
94 interface VideoCaptureHost {
95 // Start the |session_id| session with |params|. The video capture will be
96 // identified as |device_id|, a new id picked by the renderer process.
97 // |observer| will be used for notifications.
98 Start(mojo_base.mojom.UnguessableToken device_id,
99 mojo_base.mojom.UnguessableToken session_id,
100 VideoCaptureParams params,
101 pending_remote<VideoCaptureObserver> observer);
VideoCaptureHost::Start() binds the attacker observer and connects the client using the supplied session_id:
274 void VideoCaptureHost::Start(
275 const base::UnguessableToken& device_id,
276 const base::UnguessableToken& session_id,
277 const media::VideoCaptureParams& params,
278 mojo::PendingRemote<media::mojom::VideoCaptureObserver> observer) {
...
291 DCHECK(!device_id_to_observer_map_.contains(device_id));
292 auto& observer_in_map = device_id_to_observer_map_[device_id];
293 observer_in_map.Bind(std::move(observer));
...
303 controllers_[controller_id] = base::WeakPtr<VideoCaptureController>();
304 ConnectClient(session_id, params, controller_id,
305 render_frame_host_delegate_->render_frame_host_id(),
306 base::BindOnce(&VideoCaptureHost::OnControllerAdded,
307 weak_factory_.GetWeakPtr(), device_id));
308 }
The later ConnectClient() lookup obtains the origin for the supplied session but does not reject if the session belongs to another frame or origin:
590 std::optional<url::Origin> origin =
591 media_stream_manager_->GetOriginByVideoSessionId(session_id);
592 media_stream_manager_->video_capture_manager()->ConnectClient(
593 session_id, params, controller_id, render_frame_host_id, this,
594 std::move(origin), std::move(done_cb));
By contrast, nearby captured-surface-control methods demonstrate the expected owner check pattern: they look up the request by session ID and then compare the stored requesting RFH with the bound caller RFH before proceeding:
2352 DeviceRequest* const request = FindRequestByVideoSessionId(session_id);
...
2358 if (request->requesting_render_frame_host_id != capturer_rfh_id) {
2359 result = CapturedSurfaceControlResult::kUnknownError;
2360 return nullptr;
2361 }
The audio stream endpoint has the same bearer-token shape. RendererAudioInputStreamFactory.CreateStream() accepts a renderer-supplied microphone session ID:
18 interface RendererAudioInputStreamFactory {
...
21 CreateStream(
22 pending_remote<RendererAudioInputStreamFactoryClient> client,
23 mojo_base.mojom.UnguessableToken session_id,
24 media.mojom.AudioParameters params,
25 bool automatic_gain_control,
26 uint32 shared_memory_count,
27 media.mojom.AudioProcessingConfig? processing_config);
RenderFrameAudioInputStreamFactory::Core::CreateStream() resolves that session ID through the global audio input device manager and then creates an input stream for the bound caller frame. There is no ownership comparison between the session owner and process_id_ / frame_id_:
238 void RenderFrameAudioInputStreamFactory::Core::CreateStream(
...
241 const base::UnguessableToken& session_id,
...
253 const blink::MediaStreamDevice* device =
254 media_stream_manager_->audio_input_device_manager()->GetOpenedDeviceById(
255 session_id);
...
285 } else {
286 forwarding_factory_->CreateInputStream(
287 process_id_, frame_id_, device->id, audio_params, shared_memory_count,
288 automatic_gain_control, std::move(processing_config),
289 std::move(client));
AudioInputDeviceManager::GetOpenedDeviceById() is a session-ID lookup over opened devices:
83 const blink::MediaStreamDevice* AudioInputDeviceManager::GetOpenedDeviceById(
84 const base::UnguessableToken& session_id) {
85 DCHECK_CURRENTLY_ON(BrowserThread::IO);
86 auto device = GetDevice(session_id);
87 if (device == devices_.end())
88 return nullptr;
90 return &(*device);
91 }
Proof
The attached PoC serves two local origins:
attacker origin: http://127.0.0.1:8820/index.html
victim origin: http://localhost:8821/victim.html
The victim top-level window first obtains camera or microphone permission through the normal Web API. Its renderer then opens the granted device through MediaStreamDispatcherHost.OpenDevice() and sends the resulting raw MediaStreamDevice.session_id to the attacker page to model a compromised renderer with access to a live victim MediaStreamDevice.
The attacker page then binds the live media consumer endpoints directly:
VideoCaptureHost.Start(attackerDeviceId, victimVideoSessionId, params, attackerObserver)
RendererAudioInputStreamFactory.CreateStream(client, victimAudioSessionId, params, ...)
The attached evidence-video-real-device.log is a manual real-device video run. The victim origin received camera permission and opened the camera session. The attacker origin still had camera permission state prompt, and enumerateDevices() exposed no camera label or device id to the attacker origin. Despite that, Chrome delivered camera frames to the attacker-origin observer:
[victim http://localhost:8821] normal getUserMedia returned video track label="Elgato Facecam Neo (0fd9:0081)" readyState="live"
[victim http://localhost:8821] OpenDevice success=true label="05d5d38a-1234-4cd7-a356-8d91b20cfc6b"
[victim http://localhost:8821] victim video device ... sessionId={"high":"0x94611bfb48a654a","low":"0x2f3f4ef26ce61644"}
[attacker http://127.0.0.1:8820] attacker camera permission=prompt
[attacker http://127.0.0.1:8820] attacker enumerateDevices videoinput[0] label="" deviceId=""
[attacker http://127.0.0.1:8820] calling VideoCaptureHost.Start(... victimSessionId={"high":"0x94611bfb48a654a","low":"0x2f3f4ef26ce61644"})
[attacker http://127.0.0.1:8820] video observer state=STARTED
[attacker http://127.0.0.1:8820] video observer newBuffer id=0 handleKeys=gpuMemoryBufferHandle
[attacker http://127.0.0.1:8820] video observer bufferReady count=1 bufferId=0 pixelFormat=6 coded={"width":640,"height":480}
[attacker http://127.0.0.1:8820] SUCCESS: attacker-origin VideoCaptureObserver received a frame from the victim-origin camera session.
The attached evidence-audio-real-device.log is a manual real-device microphone run. The victim origin received microphone permission and opened the microphone session. The attacker origin still had microphone permission state prompt, and enumerateDevices() exposed no microphone label or device id to the attacker origin. Despite that, Chrome created and started an attacker-origin audio input stream backed by the victim microphone session:
[victim http://localhost:8821] normal getUserMedia returned audio track label="Microphone (AT2020USB-X) (0909:0052)" readyState="live"
[victim http://localhost:8821] OpenDevice success=true label="945cace1-a51a-4a3b-835f-c77916a6640e"
[victim http://localhost:8821] victim audio device ... sessionId={"high":"0x5044e1e651aebd0d","low":"0xb2c2a2c7c0c013e9"}
[attacker http://127.0.0.1:8820] attacker microphone permission=prompt
[attacker http://127.0.0.1:8820] attacker enumerateDevices audioinput[0] label="" deviceId=""
[attacker http://127.0.0.1:8820] calling RendererAudioInputStreamFactory.CreateStream(victimSessionId={"high":"0x5044e1e651aebd0d","low":"0xb2c2a2c7c0c013e9"})
[attacker http://127.0.0.1:8820] audio streamCreated initiallyMuted=false streamId={"high":"0xed33d162ce5399da","low":"0xcbaca4731fb0560e"}
[attacker http://127.0.0.1:8820] audio sharedMemory.mapBuffer(0, 4096) => result=0 hasBuffer=true
[attacker http://127.0.0.1:8820] SUCCESS: attacker-origin renderer created and started an audio input stream using the victim-origin microphone session id.
[attacker http://127.0.0.1:8820] audio sharedMemory snapshot 1 checksum=106098 prefix=0,0,0,0,0,0,0,0,161,213,106,177,10,0,0,0
For manual real-device verification, grant camera/microphone permission only to the victim origin and do not grant those permissions to the attacker origin. The attacker page logs its own permission state before invoking the raw Mojo endpoints.
Tested Versions
Source review:
Chromium checkout: 39ce5ba88b12b39e7a45c7ea603043cecff53d9b
Commit: Add hovered scrollbar arrow color id
Manual real-device reproduction:
Windows Chromium ASAN 149.0.7805.0
MojoJS enabled
Real Elgato Facecam Neo camera
Real AT2020USB-X microphone
Steps to Reproduce
Place these PoC files in one directory:
server.py
index.html
attacker.js
victim.html
victim.js
Start the PoC server:
MOJO_GEN_DIR=/path/to/chromium/src/out/<build>/gen python3 server.py
Launch Chrome or Chromium with MojoJS enabled:
/path/to/chrome --user-data-dir=/tmp/mediastream-session-profile --no-first-run --enable-blink-features=MojoJS http://127.0.0.1:8820/index.html
Manual video flow:
- On the attacker page, click
1. Open victim camera window. - In the new
http://localhost:8821/victim window, clickStart victim camera session. - Grant camera permission when Chrome prompts for the victim origin.
- Do not grant camera permission to the attacker origin.
- Click
2. Attach attacker video consumer. - Observe that the victim origin logs
OpenDevice success=trueand a victimsessionId. - Observe that the attacker origin logs
attacker camera permission=promptand blank camera device labels, then a rawVideoCaptureHost.Start()call with the victim session ID, followed byvideo observer state=STARTED,video observer newBuffer,video observer bufferReady, and the video success line.
Manual audio flow:
- On the attacker page, click
3. Open victim microphone window. - In the new
http://localhost:8821/victim window, clickStart victim microphone session. - Grant microphone permission when Chrome prompts for the victim origin.
- Do not grant microphone permission to the attacker origin.
- Click
4. Attach attacker audio consumer. - Observe that the victim origin logs
OpenDevice success=trueand a victimsessionId. - Observe that the attacker origin logs
attacker microphone permission=promptand blank microphone device labels, then a rawRendererAudioInputStreamFactory.CreateStream()call with the victim session ID, followed byaudio streamCreated, successful shared-memory mapping, the audio success line, and a changed audio shared-memory checksum.
Suggested Fix Direction
Do not treat MediaStreamDevice.session_id as a global bearer token for live capture consumers.
Before VideoCaptureHost::Start() connects a client for a renderer-supplied session ID, validate that the resolved media request belongs to the same bound RenderFrameHost / requester context as the VideoCaptureHost. The captured-surface-control helper already shows the expected pattern: resolve the request by session ID, then compare request->requesting_render_frame_host_id against the bound caller RFH before allowing the operation.
Similarly, before RenderFrameAudioInputStreamFactory::Core::CreateStream() creates an input stream for a renderer-supplied session ID, validate that the opened audio device/session belongs to the factory's bound frame. If the session was opened by another frame, process, storage key, or origin, fail before calling CreateInputStream().
Related Report
This is related to issue 514080030, which reported media.mojom.ImageCapture.takePhoto() accepting a cross-origin active camera source id. This report covers a separate set of live capture endpoints and a different browser-side token: MediaStreamDevice.session_id. Here, VideoCaptureHost.Start() accepts a victim camera session ID and delivers live video frames to the attacker origin, and RendererAudioInputStreamFactory.CreateStream() accepts a victim microphone session ID and creates an attacker-origin audio input stream. The common security boundary is media-session ownership validation in the browser process, but the affected endpoints and demonstrated impact are distinct.
Attached Files
server.py
index.html
attacker.js
victim.html
victim.js
evidence-video-real-device.log
evidence-audio-real-device.log
Credit: Mihnea Nicolau
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 browser process resolved the renderer-supplied session ID to a live capture device but never checked that the session belonged to the calling frame or origin before connecting the consumer.
Impact
An attacker origin without camera or microphone permission could receive live video frames or audio from another origin's active capture session, though the proof relies on a compromised renderer already holding the victim session ID.
What the attacker needed
Compromised renderer with victim session ID; victim origin holds active capture session; attacker origin has no media permission
The fix
The browser should validate that the resolved media session belongs to the bound frame or origin before connecting a capture consumer, as the captured-surface-control code already does.
How it was found
- Open the attacker page and use it to open the victim window.
- In the victim window, start a camera or microphone session and grant permission to the victim origin only.
- Leave the attacker origin without camera or microphone permission.
- From the attacker page, attach the attacker video or audio consumer using the victim session ID.
- Observe the victim logs a successful device open and session ID, while the attacker logs a prompt permission state and blank device labels.
- Observe the attacker receives video buffers or a started audio stream backed by the victim device.
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.
When a site uses your camera or microphone, the browser creates a session and gives it a long random ID. The bug is that the browser accepted that ID from any page, not just the page that owned the session, so a malicious page could ask for the same live feed. The attacker page never needed its own camera or microphone permission.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.