Skip to content
Memory corruption Disclosed report Advanced

Mac OS X Firefox WebGL shader Uniform type OOB read in gleRunVertexSubmitImmediate

A WebGL shader in Firefox on macOS could trigger an out-of-bounds read inside the graphics driver's vertex submission code when drawArrays is called with an improperly set buffer and a uniform accessed beforehand. An attacker could crash the browser process by getting a victim to open a crafted HTML page.

pwn2addr Follow

Originally disclosed on Mozilla

  • Fixed in 45 days
  • Paid in 4 months
  • Disclosed after 45 days

Created attachment 9443637 crash_min.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Steps to reproduce:

  1. run firefox on Mac OS X
  2. Open crash_minimized.html
  3. Crash

Actual results:

Vulnerability

I found a vulnerability via drawArrays in webgl which ends up in a wild OOB read in gleRunVertexSubmitImmediate called from gleDrawArraysOrElements_ExecCore.

C++
       switch ( (int)v54 )
                    {
                      case 1:
                        v84 = 0;
                        _Q0.i32[0] = *(_DWORD *)v86;// crash_here
                        v199.i32[0] = *(_DWORD *)v86;
                        break;

Before performing drawArrays, the buffer is not properly set, and the program attempts to access a uniform. When the uniform is accessed before drawArrays is called, an offset is added to a null pointer, leading to an out-of-bounds read.

Version: Firefox 135.0a1 Type of crash: Browser Process

The original report as published on Mozilla's Bugzilla, by Pwn2addr. 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 the WebGL implementation did not properly initialise the vertex buffer before drawArrays, so accessing a uniform added an offset to a null pointer and produced an out-of-bounds read in the driver.

Impact

The browser process crashes, which is a denial of service; the text does not claim code execution.

What the attacker needed

Firefox on macOS; victim opens a crafted HTML page

How it was found

  1. Run Firefox on macOS.
  2. Open the provided minimal HTML file.
  3. The browser process crashes.

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 web pages draw 3D graphics using the graphics card. A shader is a small program that runs on the graphics card, and a uniform is a value passed into it. Here, a page could make the browser read memory outside the area it should, which crashes the browser tab or 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 by pwn2addr

View all

71 more disclosed reports, best first.

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.