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.
- 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:
- run firefox on Mac OS X
- Open crash_minimized.html
- 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.
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
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
- Run Firefox on macOS.
- Open the provided minimal HTML file.
- 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.