Inappropriate implementation in WebRTC (CVE-2026-14015)
A potential time-of-check to time-of-use flaw in WebRTC's window capturer on Windows caches the window rectangle before a full-screen capture but does not verify that the window stayed in place afterwards. An attacker could move a shared popup window during capture so that the cropped frame exposes pixels from an underlying native window.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 35 days
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 Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in WebRTC's CroppingWindowCapturer on Windows. During a window capture operation, the window coordinates are validated and cached before the full-screen capture occurs, but the post-capture verification fails to check if the window moved in the interim. If an attacker-controlled sharing window is moved between these steps, it can crop the screen using stale coordinates, potentially exposing pixels from underlying native windows.
Affected files:
third_party/webrtc/modules/desktop_capture/cropping_window_capturer.ccthird_party/webrtc/modules/desktop_capture/cropping_window_capturer_win.cc
Estimated timestamp from git blame: 2026-04-27
Bug Description and Root Cause
A potential position Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in the WebRTC CroppingWindowCapturer component on Windows.
During CaptureFrame() in third_party/webrtc/modules/desktop_capture/cropping_window_capturer.cc (line 48), the capturer queries and caches the crop-rectangle in last_window_rect_ before triggering the full-screen pixel capture:
void CroppingWindowCapturer::CaptureFrame() {
if (ShouldUseScreenCapturer()) {
// We record the window position here at capture time; it may differ at
// frame delivery time.
last_window_rect_ = GetWindowRectInVirtualScreen();
...
screen_capturer_->CaptureFrame();
} else {
window_capturer_->CaptureFrame();
}
}
However, during the post-capture callback OnCaptureResult() (line 90), the sanity check re-reads the live window position (via ShouldUseScreenCapturer()) and verifies its visibility and Z-order at that new location, but it never compares this new position against the cached last_window_rect_:
void CroppingWindowCapturer::OnCaptureResult(
DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame> screen_frame) {
if (!ShouldUseScreenCapturer()) { // Re-reads live rect, updates window_region_rect_, runs IsTopWindow()
...
window_capturer_->CaptureFrame();
return;
}
...
std::unique_ptr<DesktopFrame> cropped_frame =
CreateCroppedDesktopFrame(std::move(screen_frame), last_window_rect_); // Crops full-screen using STALE last_window_rect_
...
}
Because ShouldUseScreenCapturer() overwrites the internal window_region_rect_ with the live coordinates but no logic verifies that last_window_rect_ still matches the updated window rect, a window translation (such as moving the sharing window via programmatic JavaScript APIs) that occurs between the caching step and the screen capture step will go completely undetected. The capturer then crops the screen frame using the stale coordinates, potentially leaking the pixels of whatever application window was previously covered by the sharing window.
Potential Attack Scenario / Trigger Steps
Note: The following are suggested/potential steps to trigger the vulnerability. Our tooling agent does not currently have the capability to run code or compile POCs to verify this behavior live.
- Setup: A victim native application window (e.g., containing sensitive personal or financial information) is positioned at screen region A.
- Targeting: An attacker-controlled web page opens a popup window and positions it at region A so that it completely covers the victim window and is topmost.
- Initiating Media Capture: The attacker triggers
getDisplayMedia({video: true})and induces the user to select the attacker's popup window in the picker UI. - Timing the Race:
- At T0,
CaptureFrame()runs.ShouldUseScreenCapturer()checks the popup, storing coordinates A. - At T1,
last_window_rect_is cached as A. - Immediately after this (and before the pixel grab completes), the attacker's page calls
popup.moveTo(B)to shift the popup to region B (an empty or non-sensitive desktop area). This exposes the victim window at region A. - At T3, the screen capturer performs the virtual screen pixel acquisition. Region A now contains the pixels of the exposed victim window.
- At T4,
OnCaptureResult()executes and callsShouldUseScreenCapturer(). It queries the popup's live coordinates (now B), confirms that the popup is visible and topmost at B, and succeeds. - At T5,
CreateCroppedDesktopFramecrops the captured virtual screen using the stale coordinates A.
- At T0,
- Impact: The pixels of the victim window at region A are delivered to the attacker's media stream, potentially disclosing cross-window pixel data without explicit user consent.
Suggested Fix
In CroppingWindowCapturer::OnCaptureResult(), after the second ShouldUseScreenCapturer() call succeeds, compare the newly-read window rect (converted to virtual screen coordinates) against last_window_rect_. If they differ (meaning the window moved during capture), discard the screen frame and fall back to capturing via the window capturer or return a temporary error:
if (!ShouldUseScreenCapturer()) {
RTC_LOG(LS_INFO) << "Window no longer on top when ScreenCapturer finishes";
window_capturer_->CaptureFrame();
return;
}
DesktopRect current_window_rect = GetWindowRectInVirtualScreen();
if (current_window_rect != last_window_rect_) {
RTC_LOG(LS_WARNING) << "Window moved during capture";
window_capturer_->CaptureFrame();
return;
}
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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 post-capture check re-reads the live window position but never compares it with the cached rectangle used for cropping, so a window move between caching and pixel capture goes undetected.
Impact
The pixels of the victim window could be delivered to the attacker's media stream, potentially disclosing cross-window pixel data without explicit user consent.
What the attacker needed
Windows host; victim window at a known screen region; attacker popup covering that region; user selects the popup in the picker
The fix
The report suggests comparing the newly read window rectangle against the cached one after the second check and, if they differ, discarding the screen frame and falling back to window capture or returning a temporary error.
How it was found
- Place a victim native application window at screen region A.
- Open an attacker-controlled popup and position it over region A, topmost.
- Trigger getDisplayMedia and get the user to select the attacker's popup.
- After the window rectangle is cached, move the popup to region B before the pixel grab completes.
- The screen capture then grabs region A, which now shows the victim window.
- The post-capture check sees the popup at B and passes, then crops using the stale region A coordinates.
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 a window in a browser, the browser sometimes captures the whole screen and then cuts out just the window you picked. This report says the browser remembers where the window was before taking the picture, but does not check whether the window moved while the picture was being taken. If a malicious page moves its own popup at the right moment, the cut-out could show a different window that was hidden underneath.
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.