Skip to content
Memory corruption Disclosed report Advanced CVE-2026-74941

OOB Write in GPU process - WebGL2 transform-feedback capacity underflow

A WebGL2 transform-feedback session could be paused, have its bound buffer shrunk, and then be resumed, causing the write-capacity check to underflow and accept an oversized draw. An attacker could then write shader-controlled data far past the small buffer inside the GPU process, corrupting the compositor or crashing it.

Jacolon Walker Follow

Originally disclosed on Mozilla

  • Fixed in 15 days
  • Paid in 57 days
  • Disclosed after 15 days

Created attachment 9608946 poc.html

I found this while investigating another potential memory corruption. So if it isnt clear or needs more info, let me know. GPU security is new territory for me (still learning along with some other subsystems).

Summary

A web page can trigger an out-of-bounds write in the GPU/compositor process using default-on WebGL2, with no pref, flag, or user gesture. During a transform-feedback session, ResumeTransformFeedback recomputes the write capacity from the bound buffer's current size but never resets the accumulated write position. If the page shrinks the transform-feedback buffer while the session is paused, the recomputed capacity becomes smaller than the preserved position, and the draw-time guard remainingCapacity = mActive_VertCapacity - mActive_VertPosition (both size_t) underflows to roughly SIZE_MAX. An arbitrarily large transform-feedback draw is then accepted, and the GPU writes attacker-controlled shader output far past the now 16-byte buffer.

Tested on and affects Release 152 (confirmed on 152.0.4 and 152.0.5, aarch64), Beta 153, and Nightly 154 (confirmed on 154.0a1, BuildID 20260712224325, ASan).

Steps to reproduce

Open poc.html in Firefox; it runs on load with no user gesture. It:

  1. binds a 16 MB buffer as the transform-feedback target, begins transform feedback, and draws 100,000 points to advance the internal write cursor, then pauses;
  2. unbinds the transform-feedback object, rebinds the same buffer as ARRAY_BUFFER, and shrinks it to 16 bytes with bufferData (this succeeds only because the transform-feedback object is unbound at that moment; getError is 0);
  3. rebinds the transform-feedback object, resumes, and draws 10,000,000 points. The capacity check underflows, the oversized draw is accepted (getError is 0), and the GPU performs a roughly 640 MB transform-feedback write against the 16-byte buffer.

Two PoC files are provided. poc.html is the canonical, self-driving trigger described above. poc_asan_crash_forcing.html is the same trigger tuned to force the crash on demand: it omits the buffer spray and loops oversized resumed draws so the write marches into unmapped GPU VA. Which outcome you observe depends on the GPU process footprint. With a near-empty GPU process the oversized write overshoots into unmapped VA and the GPU process aborts under ASan; with a populated GPU process (other tabs, or the default start page) the write lands in mapped memory and corrupts the compositor silently instead. To reproduce the ASan crash reliably, run poc_asan_crash_forcing.html in a fresh about:blank profile so the GPU process starts near-empty.

 ./BrowserBuild/ASan/dist/Nightly.app/Contents/MacOS/firefox poc_asan_crash_forcing.html

On a shipping Release build (tested on Firefox 152.0.5, aarch64) there is no crash. The write instead lands in the live compositor surface: the page turns black, the browser stays interactive (you can type but cannot see), and attacker-controlled shader values are painted into the display.

A matched control isolates the cause. Growing the same buffer to 680 MB instead of shrinking it, with the identical draw and workload, never faults across repeated runs, so the crash is the out-of-bounds write and not memory pressure.

Impact

Any origin can trigger a GPU-process out-of-bounds write with no user interaction. The write value is attacker-controlled through the shader varyings, and its extent is attacker-controlled through the draw count. Two outcomes were observed. The first is a browser-wide can be a DoS. The second, on shipping Release, is silent corruption of the live compositor surface with attacker-influenced data, with no crash. Although I have observed the second more in both the Release and ASan build as well.

The written values are attacker-chosen. Replacing the shader's per-vertex ramp with a constant paints that constant's bytes as a solid color into the compositor: a constant of 0x00FF00FF renders as the predicted magenta, reaching the browser chrome (window border and URL bar) as well as page content. The attacker therefore controls what is written into the browser's own display surface, and the layout is authorable: emitting different values across vertex-index ranges paints distinct color bands rather than a single color, so the attacker also controls where the content lands. This is a display-defacement and UI-spoofing capability, though a pixel-precise overlay of a specific element would need finer control over which surface and offset the write reaches.

On Apple Silicon the GPU hardware MMU bounds the write to the GPU process, but within that process it is a controlled, readable primitive. Grooming an attacker-allocated buffer over the freed region, and keeping the write below the fault boundary, lands arbitrary per-vertex 32-bit values in that buffer, which the page reads back verbatim through getBufferSubData. A second PoC (evidence/poc_readback.html) writes three different fixed constants and reads them back the same way, with a per-vertex gl_VertexID counter incrementing inside the recovered buffer, so the write is controlled, readable, and lands in attacker-allocatable GPU memory such as other buffers, textures, and compositor and video-decode surfaces. The reclaimed region is zero-initialized before the write, so the readback returns the attacker's own values rather than other allocations' contents, making this a controlled write rather than an information disclosure. It is not, by itself, code execution: that would additionally require targeting a GPU-process control structure and a separate GPU-sandbox escape. On GL backends that do not clamp transform-feedback writes to the bound range (Windows ANGLE/D3D, Linux GL, Android GLES), the same page content is a controlled out-of-bounds write without the macOS grooming step.

Affected components (potential could be more or something overlooked)

The original report as published on Mozilla's Bugzilla, by Jacolon Walker. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 ResumeTransformFeedback recomputes the write capacity from the buffer's new size but does not reset the accumulated write position, so the size_t subtraction underflows.

Impact

Any origin could trigger a GPU-process out-of-bounds write with no user interaction, causing either a browser-wide denial of service or silent corruption of the live compositor surface with attacker-chosen data; on Apple Silicon the GPU MMU bounds the write to the GPU process, and it is not by itself code execution.

What the attacker needed

Victim opens a malicious web page; no user gesture needed; default-on WebGL2

How it was found

  1. Bind a large buffer as the transform-feedback target, begin transform feedback, draw many points to advance the write cursor, then pause.
  2. Unbind the transform-feedback object, rebind the same buffer as an array buffer, and shrink it to a tiny size.
  3. Rebind the transform-feedback object, resume, and draw a very large number of points so the capacity check underflows and the oversized write is accepted.

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.

WebGL lets a web page draw 3D graphics using the graphics card. Transform feedback is a feature where the graphics card writes drawing results back into a memory buffer the page controls. Here, the page could shrink that buffer while the drawing was paused, and a size check then wrapped around to a huge number, so the graphics card wrote far more data than the buffer could hold, corrupting memory in the browser's graphics process.

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 Mozilla

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.