Improper synchronization in ScreenCapture (CVE-2026-131062)
A browser-wide singleton for the macOS screen capture picker stores request callbacks in member variables, so a second capture request overwrites the first. Under specific user interaction patterns, a screen capture stream intended for a trusted tab could be delivered to an attacker-controlled tab without further confirmation.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 6 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential race condition in NativeScreenCapturePickerMac allows a malicious website to hijack a screen capture stream intended for a trusted tab. Because the browser-wide singleton stores request callbacks in member variables, a subsequent capture request can unconditionally overwrite them. Under specific user interaction patterns, the native macOS picker selection can be misrouted to the attacker's origin without further confirmation.
Affected files:
content/browser/media/capture/native_screen_capture_picker_mac.mmchrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc
Estimated timestamp from git blame: 2025-09-09
Potential Race Condition in NativeScreenCapturePickerMac
Location:
content/browser/media/capture/native_screen_capture_picker_mac.mm(specifically lines 196-201 and 314-374)chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc
Vulnerability Mechanics
NativeScreenCapturePickerMac is a browser-wide singleton class (owned by InProcessVideoCaptureProvider) that facilitates screen-sharing via the macOS system picker API (SCContentSharingPicker) introduced in macOS 14.0/15.0+.
The class stores request-specific callbacks (picker_callback_, cancel_callback_, and error_callback_) as instance member variables of this singleton. When Open() is invoked, these member variables are unconditionally overwritten via move-assignment:
picker_callback_ = std::move(picker_callback);
cancel_callback_ = std::move(cancel_callback);
error_callback_ = std::move(error_callback);
The macOS system picker overlay is non-modal system UI, meaning it does not prevent a user from switching to other browser tabs or windows while the picker is active. If the user switches tabs and triggers another screen-share prompt, a subsequent call to Open() can occur before the first request is resolved or canceled. This overwrites the singleton's active callbacks.
When the user eventually makes a selection in the macOS picker interface, the callback of the latest request is invoked instead of the one associated with the tab for which the selection was initiated. On macOS, delegated source lists (such as window or screen lists) are automatically accepted (ShouldAutoAccept returns true in DesktopMediaListController::ShouldAutoAccept), meaning the resulting media stream is instantly delivered to the active callback's origin with no secondary confirmation step.
Potential Step-by-Step Exploitation Scenario
Note: These are potential steps derived from static analysis of the codebase; our tooling does not currently have the capability to execute live code or run proofs-of-concept.
- Preconditions: The victim runs macOS 14.0+ (preferably macOS 15.0+ with
SCContentSharingPickeractive) and has themedia::kUseSCContentSharingPickerflag enabled. - Setup: The user has two tabs open in the same window: Tab A (a trusted origin like Google Meet) and Tab B (an attacker-controlled origin).
- Initiation: Tab B requests screen capture via
navigator.mediaDevices.getDisplayMedia(...). Chrome displays a tab-modal desktop media picker dialog (Dialog B) on Tab B. - Navigation: The user switches to Tab A. Dialog B is hidden by the browser's web-modal dialog manager because Tab B is no longer active.
- Victim Action: The user initiates a screen-share request on Tab A, displaying Dialog M. The user clicks "Share Window" in Dialog M, which calls
NativeScreenCapturePickerMac::Open(). This setsactive_picker_source_id_to1, assigns Tab A's callback topicker_callback_, and opens the macOS system picker overlay. - Tab Switch: While the macOS system picker overlay is visible, the user switches back to Tab B.
- Attacker Action: Dialog B reappears on Tab B. The user, confused by seeing a stale Chrome dialog while the macOS picker is active, clicks "Share Window" on Dialog B. This invokes
NativeScreenCapturePickerMac::Open()a second time. This incrementsactive_picker_source_id_to2and overwritespicker_callback_with Tab B's callback. Tab A's original callback is destroyed. - Delivery: The user makes a selection in the macOS system picker. Since
streamisnilfor the initial selection event, the callback resolves the session ID to the latestactive_picker_source_id_(which is2).picker_callback_(now pointing to Tab B) is invoked, and the live stream is routed to the attacker's tab (Tab B) without further confirmation.
Suggested Fix
Instead of storing callbacks as member variables in the NativeScreenCapturePickerMac singleton, associate callbacks with their respective DesktopMediaID::Id (session ID). For example, maintain a map of active sessions (sessions_) that contains both the CaptureSession state and the associated callbacks for each unique session:
struct CaptureSession {
// ...
base::OnceCallback<void(webrtc::DesktopCapturer::Source)> picker_callback;
base::OnceClosure cancel_callback;
base::OnceClosure error_callback;
};
When a picker event is received from the OS, resolve the correct session using the target session ID or stream map and invoke the callback specifically stored within that session's struct, rather than referencing a singleton-wide member variable.
Evaluated with Chrome root at commit: 208ca3371d87589335b108c431b95a36d768dc47
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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 singleton stores per-request callbacks in shared member variables that are overwritten by each new request, so the latest request's callback is used for any pending selection.
Impact
A live screen capture stream could be delivered to an attacker-controlled origin without further confirmation, but only under specific user interaction patterns and with the macOS picker flag enabled.
What the attacker needed
MacOS 14.0+ with SCContentSharingPicker; media::kUseSCContentSharingPicker flag enabled; victim has two tabs open; victim switches tabs during picker
The fix
Callbacks should be associated with their respective session ID in a map rather than stored as singleton-wide member variables.
How it was found
- The victim has two tabs open: a trusted origin and an attacker-controlled origin.
- The attacker tab requests screen capture, showing a tab-modal picker dialog.
- The user switches to the trusted tab, hiding the attacker's dialog.
- The user starts a screen share on the trusted tab, opening the macOS system picker.
- While the system picker is visible, the user switches back to the attacker tab and clicks its share button, overwriting the callback.
- The user makes a selection in the system picker, and the stream is routed to the attacker tab.
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 you share your screen, the browser asks which window or screen to share. This report says that if two tabs ask to share at nearly the same time, the browser can mix up which tab gets the result. That could mean a stream you meant for a trusted site is sent to a malicious one.
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.