Mac OS X Firefox WebGL shader attribute type OOB read in gleRunVertexSubmitImmediate
A WebGL drawArrays call with a crafted shader attribute type reaches the graphics driver's vertex submission code, which reads a pointer without validating it, causing an out-of-bounds read. The browser process crashes, and the reporter suggests it may be usable for a sandbox escape.
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 4 months
Created attachment 9443461 crash_minimized.html
Steps to reproduce the problem
- run firefox on Mac OS X
- Open crash_minimized.html
- Crash
Vulnerability
I found a vulnerability via drawArrays in webgl which ends up in a wild OOB read in gleRunVertexSubmitImmediate called from gleDrawArraysOrElements_ExecCore.
if ( (v25 & 0x200000) != 0 )
{
if ( (v25 & 0xBC000) != 0 || (v173 = -1, (*a6 & 0x1000000000LL) != 0) )
{
if ( v28 > 0xF )
v44 = 32 * v28 + 8176;
else
v44 = 16 * v28 + 8432;
v173 = v44;
}
}
v55 = v25 >> 40;
v56 = *a6;
if ( (~*(_DWORD *)a6 & 0x700) != 0 )
{
v57 = (const __m128i *)(*(_QWORD *)(v194 + 8LL * v28) + v184 * v55); // [1]
}
else
{
v57 = (const __m128i *)((char *)v189 + (int)v55 - v171); // [2]
v171 = v55;
}
v189 = v57;
case 6: // crash case
if ( (v26 & 0x1000000) != 0 )
{
a11 = *(__m128 *)v57; // [3]
LODWORD(v32) = 6;
}
- [1] Alternatively, get a pointer from [2], which can be controlled by the drawArrays argument.
- And [3] will read the pointer without any verification, resulting in an OOB read.
The vulnerability may affect sandbox escape as the Browser Process crashes.
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 graphics driver's vertex submission routine trusts an attribute type and offset derived from the WebGL draw call without bounds-checking the resulting pointer before dereferencing it.
Impact
The browser process crashes, and the reporter states the flaw may affect sandbox escape, though no escape is demonstrated.
What the attacker needed
Firefox on Mac OS X; victim opens a crafted page
How it was found
- Run Firefox on Mac OS X.
- Open the attached minimised crash page.
- 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. Firefox passes drawing instructions to the graphics driver, and here a malformed instruction made the driver read memory outside the area it was supposed to, which crashed the browser. A crash alone is not code execution, but crashes in the browser process are taken seriously because they can sometimes be turned into something worse.
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.