Inappropriate Implementation in Media Stream (CVE-2025-1921)
In a sandboxed document with only allow-scripts, the devicechange event fires when the MacBook lid is closed, leaking the presence of the internal camera. An attacker could use this to infer camera details despite the sandbox blocking direct access.
- Fix shipped in 60 days
Steps to reproduce the problem
https://jsfiddle.net/wyfvm0jd/
- Connect a macbook with an internal camera (maybe affects other manufacturers, not sure) to a second display.
- In a sandboxed document with only "allow-scripts", listen for the
navigator.mediaDevices.ondevicechangeevent. - Close the lid of the macbook.
Problem Description
The event is not supposed to fire in this case. The document is not allowed to access the camera details. This can be checked by requesting a new MediaStream from the camera, it's correctly blocked. Note that if an external camera is connected (I tested with an USB one), then the event doesn't fire, even for the internal one.
Summary
devicechange event leaks for macbook's internal camera in sandboxed documents.
Custom Questions
Reporter credit:
Kaiido
Additional Data
Category: Security
Chrome Channel: Canary
Regression: N/A
What the report shows
This is a Chrome VRP report about the Media Stream feature, specifically the devicechange event exposed through navigator.mediaDevices. The researcher, credited as Kaiido, reported an inappropriate implementation that leaks information about the presence of a camera to a document that should not be able to see it. The platform records it as CVE-2025-1921, severity medium, with a bounty of 1000.00 USD, disclosed on 2025-03-04. The report itself is short and does not describe a fix or a patch.
The claim is narrow: in a sandboxed document, the devicechange event fires when the machine's internal camera changes state, even though the document is not permitted to learn anything about that camera.
The reproduction steps are given as a link to a fiddle plus a numbered list:
https://jsfiddle.net/wyfvm0jd/
1. Connect a macbook with an internal camera (maybe affects other manufacturers, not sure) to a second display.
2. In a sandboxed document with only "allow-scripts", listen for the `navigator.mediaDevices.ondevicechange` event.
3. Close the lid of the macbook.
The researcher notes that the hardware detail may not be specific to one manufacturer, but is unsure. The second display is part of the setup as written; the report does not explain why it matters.
The expected behaviour is that the event does not fire at all in this configuration, because the document is not allowed to access camera details. The researcher confirms the restriction is otherwise enforced: requesting a new MediaStream from the camera is correctly blocked. So the sandbox is doing its job for media capture, but the change notification still reaches the page.
One further observation is recorded: when an external camera is connected (tested with a USB camera), the event does not fire, not even for the internal camera. That asymmetry is the interesting part of the finding, because it suggests the leak is tied to how the internal camera's state change is surfaced rather than to device enumeration in general.
The summary is one line: devicechange event leaks for macbook's internal camera in sandboxed documents. The additional data lists the category as Security, the Chrome channel as Canary, and regression as N/A.
Root cause
The report does not name a component or a code path. What it implies is that the devicechange notification is delivered to a document whose sandbox flags do not grant access to media device information, so the event dispatch is not gated by the same permission check that blocks getUserMedia. In other words, the authorisation check exists on the capture path but not, or not completely, on the notification path. The fact that an external camera does not trigger the same event suggests the internal camera's state transition is handled by a different mechanism that bypasses the check. Treat this as likely rather than confirmed: the report gives behaviour, not a diagnosis.
Impact
The leak is a small piece of state: whether the internal camera's availability changed, observed by a page that is sandboxed to scripts only. The realistic impact is a side channel that reveals something about the physical state of the machine (for example, that a lid was closed) to embedded or untrusted content. The report makes no claim beyond the event firing when it should not.
How this kind of bug works
Browsers expose device state through several surfaces: enumeration (enumerateDevices), capture (getUserMedia), and change notification (devicechange). Each surface needs its own authorisation decision, because they reveal different amounts of information. Enumeration and capture are usually gated by permissions policy, sandbox flags and user permission prompts. Change notification is easy to overlook: it carries no device data by itself, so it can look harmless, but the timing of the event still tells the page that hardware appeared, disappeared or changed state. When one surface is checked and another is not, the unchecked one becomes an oracle. Sandboxed iframes are the classic place to look, because the sandbox removes capabilities that the surrounding document has, and any code path that forgets to consult the sandbox flags will behave as if the frame were trusted.
How to test for it
- Identify every API that reports device or hardware state: media device enumeration and change events, permission status objects, and any event that fires on hardware transitions.
- Build a document that is deliberately restricted: a sandboxed iframe with only scripts allowed, or a context where the relevant permissions policy is denied.
- Confirm the restriction works first. Attempt the privileged operation (requesting a stream, reading labels) and verify it is refused. A finding is only meaningful if the baseline is blocked.
- Register listeners for the notification APIs and then cause a real state change on the hardware, such as plugging or unplugging a device, or changing a physical state that the platform tracks.
- A positive result is the event firing in the restricted context while the privileged operation stays blocked. Record both observations together.
- Compare device classes. If one class of device triggers the event and another does not, note the difference; it often points at the code path responsible.
Common false positives: the event firing in a context that actually has permission; the page inferring the change from something else, such as a timer or a resize; and test setups where the restriction was not applied to the frame that received the event. Always re-run with the privileged call to prove the context is genuinely restricted.
How it is fixed
Hunting notes
This class of bug hides where a capability has more than one entry point. Look at event-driven APIs that accompany a permissioned operation: change events, status events, and lifecycle notifications. Recon signals include features with separate enumeration and notification surfaces, recent refactors that moved permission checks, and any behaviour that differs between device classes. To get a report accepted, show the restricted context, show the privileged operation being refused in that same context, and show the event arriving anyway, with a minimal reproduction that does not depend on unrelated page behaviour.
What happened, in plain words
This is a bug report filed in Google's Chrome Vulnerability Reward Program (VRP), a scheme that pays people for finding and reporting security problems in the Chrome browser. The researcher, credited as Kaiido, found a small information leak in a Chrome feature called Media Stream. The platform records the issue as CVE-2025-1921, rates it medium severity, and paid a bounty of 1000.00 USD. It was disclosed on 2025-03-04. The report is short and does not describe a fix or a patch.
To follow it, you need three ideas. A camera here is the built-in webcam of a laptop. A document is a web page loaded in the browser. A sandboxed document is a page that the browser has deliberately stripped of powers: it can run scripts, but it cannot do many of the things a normal page can, such as reading your camera. Think of it like a visitor allowed into one room of a house but not given keys to the rest.
The feature at the centre of the report is navigator.mediaDevices, the part of the browser that lets a page ask about and use cameras and microphones. It offers two things that matter here. One is the ability to request a MediaStream, which is a live feed of audio or video from a device. The other is an event called devicechange, a notification the browser sends to the page when a device is plugged in, unplugged or changes state. An event is simply a message the browser delivers to code that has asked to be told about it.
The claim is narrow. In a sandboxed document, the devicechange event fires when the laptop's internal camera changes state, even though that document is not allowed to learn anything about the camera.
The reproduction steps are given as a link to a fiddle (a small, shareable test page) plus a numbered list:
https://jsfiddle.net/wyfvm0jd/
1. Connect a macbook with an internal camera (maybe affects other manufacturers, not sure) to a second display.
2. In a sandboxed document with only "allow-scripts", listen for the `navigator.mediaDevices.ondevicechange` event.
3. Close the lid of the macbook.
Line by line: the first line is the test page. Step 1 sets up the hardware, a MacBook with its built-in camera attached to a second display. The researcher notes the behaviour may not be specific to one manufacturer but is unsure. The second display is part of the setup as written; the report does not explain why it matters. Step 2 creates the restricted page. The sandbox setting allow-scripts means the page may run JavaScript and nothing else, so it should have no access to camera details. The page registers a listener, code that waits for the devicechange event. Step 3 closes the laptop lid, which changes the state of the internal camera.
The expected behaviour is that the event does not fire at all, because the document is not allowed to access camera details. The researcher confirms the restriction is otherwise enforced: requesting a new MediaStream from the camera is correctly blocked. So the sandbox does its job for actually capturing video, but the change notification still reaches the page.
One further observation is recorded: when an external camera is connected (tested with a USB camera), the event does not fire, not even for the internal camera. That difference is the interesting part, because it suggests the leak is tied to how the internal camera's state change is surfaced rather than to device listing in general.
The summary is one line: devicechange event leaks for macbook's internal camera in sandboxed documents. The additional data lists the category as Security, the Chrome channel as Canary (Chrome's early, experimental build), and regression as N/A.
In general, how this kind of bug works
Browsers expose device state through several surfaces: listing devices (enumerateDevices), capturing from them (getUserMedia), and notifying about changes (devicechange). Each surface needs its own permission decision, because each reveals a different amount of information. Listing and capturing are usually gated by permissions policy, sandbox flags and user prompts. Change notification is easy to overlook: the event carries no device data by itself, so it can look harmless, but its timing still tells the page that hardware appeared, disappeared or changed state. When one surface is checked and another is not, the unchecked one becomes an oracle, a way to ask a question the page is not supposed to be able to ask. Sandboxed frames are the classic place to look, because the sandbox removes powers the surrounding page has, and any code path that forgets to consult the sandbox flags will behave as if the frame were trusted.
The report does not name a component or a code path. What it implies is that the devicechange notification is delivered to a document whose sandbox flags do not grant access to media device information, so the event dispatch is not gated by the same check that blocks getUserMedia. The authorisation check exists on the capture path but not, or not completely, on the notification path. The fact that an external camera does not trigger the same event suggests the internal camera's state transition is handled by a different mechanism that bypasses the check. Treat this as likely rather than confirmed: the report gives behaviour, not a diagnosis.
The leak is a small piece of state: whether the internal camera's availability changed, observed by a page that is sandboxed to scripts only. The realistic impact is a side channel that reveals something about the physical state of the machine, for example that a lid was closed, to embedded or untrusted content. The report makes no claim beyond the event firing when it should not.
To test for this kind of bug:
- Identify every API that reports device or hardware state: media device listing and change events, permission status objects, and any event that fires on hardware transitions.
- Build a document that is deliberately restricted: a sandboxed iframe with only scripts allowed, or a context where the relevant permissions policy is denied.
- Confirm the restriction works first. Attempt the privileged operation (requesting a stream, reading labels) and verify it is refused. A finding is only meaningful if the baseline is blocked.
- Register listeners for the notification APIs and then cause a real state change on the hardware, such as plugging or unplugging a device, or changing a physical state that the platform tracks.
- A positive result is the event firing in the restricted context while the privileged operation stays blocked. Record both observations together.
- Compare device classes. If one class of device triggers the event and another does not, note the difference; it often points at the code path responsible.
Common false positives: the event firing in a context that actually has permission; the page inferring the change from something else, such as a timer or a resize; and test setups where the restriction was not applied to the frame that received the event. Always re-run with the privileged call to prove the context is genuinely restricted.
This class of bug hides where a capability has more than one entry point. Look at event-driven APIs that accompany a permissioned operation: change events, status events and lifecycle notifications. Recon signals include features with separate listing and notification surfaces, recent refactors that moved permission checks, and any behaviour that differs between device classes. To get a report accepted, show the restricted context, show the privileged operation being refused in that same context, and show the event arriving anyway, with a minimal reproduction that does not depend on unrelated page behaviour.
Glossary
- CVE: a public identifier assigned to a known security vulnerability so people can refer to it unambiguously.
- VRP: Vulnerability Reward Program, a scheme that pays researchers for reporting security bugs.
- Bounty: the money paid to a researcher for an accepted report.
- Severity: a rating of how serious a bug is, here medium.
- Media Stream: the browser feature that provides live audio and video from devices such as cameras and microphones.
- Document: a web page loaded in the browser.
- Sandbox: a browser restriction that removes powers from a page, such as access to devices.
allow-scripts: a sandbox setting that lets a page run JavaScript and nothing more.- Event: a message the browser delivers to code that has registered to be told about it.
- Listener: code that waits for a particular event and runs when it arrives.
devicechange: the event that fires when a media device is added, removed or changes state.navigator.mediaDevices: the browser object through which a page asks about and uses cameras and microphones.getUserMedia: the call that requests a live stream from a camera or microphone.enumerateDevices: the call that lists available media devices.- MediaStream: the live feed of audio or video returned when capture is granted.
- Permissions policy: browser rules that decide which features a page or frame may use.
- Oracle: a way for a page to learn a fact it is not supposed to be able to learn.
- Side channel: an indirect signal that reveals information, here through the timing of an event.
- False positive: a test result that looks like a bug but is not one.
- Regression test: an automated test that checks a fixed bug stays fixed.
- Canary: Chrome's early, experimental build channel.