SEGV on unknown address 0xe5e5e5f5 in mozilla::ClientWebGLContext::GetExtension
A 32-bit Firefox build crashes with a use-after-free in the WebGL extension lookup when memory is exhausted and a worker-heavy page repeatedly calls getExtension. An attacker could crash the browser, and the freed-memory access may be exploitable.
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 2 months
Created attachment 9293252 crash.html
I found in Firefox 32-bit after filling with a lot of memory (approximate 3000MB) then create a lot new Worker construction afterward call webgl getExtension('OES_vertex_array_object') repeatedly Firefox able to crash on 0xe5e5e5f5 address in mozilla::ClientWebGLContext::GetExtension.
I observe on stdout before Firefox crash it show WARNING: Call to mmap failed: Operation not permitted and Failed to allocate internal command buffer.. It's look like after Firefox freed the memory, but it fail to allocate new memory on the target address due to low address spaces, so when getExtension('OES_vertex_array_object') is called it still point to freed memory which leads to UAF.
Reproducible on:
- Firefox Nightly 106.0a1 (2022-09-05) (32-bit) on Arch Linux using AMD Ryzen 7 5700G
- Firefox Nightly 106.0a1 (2022-09-05) (32-bit) on Arch Linux using Intel i5-1035G1
- Firefox 104.0.1 (32-bit) on Arch Linux using AMD Ryzen 7 5700G
- Firefox 104.0.1 (32-bit) on Arch Linux using Intel i5-1035G1
Steps to reproduce:
- Open Firefox 32-bit
- Visit attached crash.html
- Firefox crashed in
mozilla::ClientWebGLContext::GetExtensionon address0xe5e5e5f5
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 a use-after-free: the WebGL context's extension data was freed after a failed allocation, but GetExtension still dereferenced the stale pointer.
Impact
The browser crashes; the use-after-free could potentially be exploited for code execution, though the report only demonstrates a crash.
What the attacker needed
32-bit Firefox; memory exhaustion (~3000MB); victim visits a crafted page
How it was found
- Open the 32-bit Firefox build.
- Visit the attached crash page.
- Firefox crashes in the WebGL extension lookup.
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 program frees memory it should stop using it. Here Firefox ran out of memory, failed to get new memory, but a WebGL call still used the old freed memory, so the browser crashed. A web page could trigger this.
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.