Skip to content
Memory corruption Disclosed report Advanced CVE-2022-46882

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.

Irvan Kurniawan Follow

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:

  1. Open Firefox 32-bit
  2. Visit attached crash.html
  3. Firefox crashed in mozilla::ClientWebGLContext::GetExtension on address 0xe5e5e5f5

The original report as published on Mozilla's Bugzilla, by Irvan Kurniawan. 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 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

  1. Open the 32-bit Firefox build.
  2. Visit the attached crash page.
  3. 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.

More by Irvan Kurniawan

View all

72 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.