Skip to content
Memory corruption Advisory Advanced CVE-2026-12461

Out of bounds read in WebRTC (CVE-2026-12461)

A size-tracking variable in the WebRTC window capture code is not updated when a resize step fails partway through, leaving a smaller staging texture paired with a stale larger size. A later frame at the original size then copies more data than the texture holds, causing an out-of-bounds read in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 19 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 state desynchronization issue in WgcCaptureSession::ProcessFrame can lead to an out-of-bounds read of mapped Direct3D 11 staging memory. If a resize occurs and recreating the frame pool fails, the staging texture is left resized to a smaller dimension while the tracking state retains the old larger size. Subsequent frame processing at the original size bypasses reallocation and reads past the boundaries of the mapped texture.

Affected files:

  • third_party/webrtc/modules/desktop_capture/win/wgc_capture_session.cc

Estimated timestamp from git blame: 2022-03-09

Summary of Root Cause

In WgcCaptureSession::ProcessFrame (located in third_party/webrtc/modules/desktop_capture/win/wgc_capture_session.cc), the capture session's size-tracking member size_ is synchronized non-atomically when a captured window size changes.

When a resize to a smaller size is detected in ProcessFrame:

  1. CreateMappedTexture is invoked (line 592), which successfully reallocates mapped_texture_ to the new smaller size (e.g., $A imes A$).
  2. frame_pool_->Recreate is then called (line 598). If this allocation fails (for example, due to transient GPU memory pressure), the function returns early on line 602.
  3. Because of the early return, the session's overall size-tracking variable size_ is not updated to the new size and remains at the old larger size (e.g., $S imes S$).

If the captured window is then resized back to the larger size $S$:

  1. SizeHasChanged(S, S) evaluates to false because both the incoming frame size and the stale tracking member size_ are $S$. The resize block is completely bypassed.
  2. The copy dimensions image_height and image_width are computed as min(size_, new_size) = S (lines 615-616).
  3. The code maps mapped_texture_ (which is still sized $A imes A$) and enters a loop copying $S$ rows of $S imes 4$ bytes using memcpy (lines 719-730).
  4. In production builds, RTC_DCHECK_GE checks are disabled. This results in an out-of-bounds memory read from the mapped staging texture buffer.

Potential Steps to Trigger

Note: These are suggested/potential steps modeled from static analysis; our tooling agent does not currently have the capability to run code or compile a working proof-of-concept.

  1. A web page requests screen or window capture using getDisplayMedia, and the user selects a window of size $S$ (e.g., $1000 \times 1000$).
  2. The attacker triggers transient GPU memory pressure (e.g., by spawning multiple heavy WebGL/WebGPU contexts or massive resource allocations) to prepare for an allocation failure.
  3. The captured window is resized to a smaller dimension $A$ (e.g., $500 \times 500$).
  4. ProcessFrame enters the resize block, reallocates mapped_texture_ to $A$, but fails to recreate the frame pool due to GPU memory pressure, returning early.
  5. The captured window is resized back to the larger size $S$.
  6. On the next frame capture, the code bypasses resizing because size_ was never updated from $S$. It attempts to copy a larger frame region out of the smaller staging texture, resulting in an out-of-bounds read of adjacent mapped memory in the browser process.

Suggested Fix

Ensure that if any part of the resizing sequence fails, the session either rolls back the staging texture, marks the session as permanently failed, or updates size_ defensively. For instance, in wgc_capture_session.cc:

C++
    hr = frame_pool_->Recreate(direct3d_device_.Get(), kPixelFormat,
                               num_buffers(), new_size);
    if (FAILED(hr)) {
      RecordGetFrameResult(GetFrameResult::kRecreateFramePoolFailed);
      // Ensure the session size is synchronized or invalidated on failure
      size_ = new_size; 
      return hr;
    }

Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 size-tracking member is only updated after the frame pool recreation succeeds, so an early return on failure leaves it stale while the mapped texture has already been shrunk.

Impact

An out-of-bounds read of adjacent mapped memory in the browser process could occur, though the report is based on static analysis and no working proof-of-concept was produced.

What the attacker needed

User grants screen capture; attacker can cause GPU memory pressure; window resized smaller then larger

The fix

The resizing sequence should roll back the staging texture, mark the session as failed, or update the size defensively when any step fails.

How it was found

  1. A page requests screen or window capture and the user picks a window of the larger size.
  2. The attacker creates GPU memory pressure to make an allocation fail.
  3. The captured window is resized to a smaller size.
  4. The texture is reallocated to the smaller size but the frame pool recreation fails and the function returns early.
  5. The window is resized back to the larger size.
  6. The next frame bypasses resizing and copies a larger region from the smaller texture.

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 window being screen-shared changes size, the code resizes a buffer that holds the picture. If one part of that resize fails, the code forgets to record the new, smaller size, so it still believes the buffer is big. The next frame then copies too much data out of the small buffer, reading memory it should not touch.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.