Skip to content
DoS Disclosed report Advanced CVE-2024-5695

Access-violation read on MozJemallocPHC::moz_arena_realloc -> AllocInfo::Get (after malloc failure on MaybePageRealloc)

A crash occurs in Firefox's jemalloc allocator when a memory allocation fails inside the PHC MaybePageRealloc path, leading to an access violation in AllocInfo::Get. An attacker could potentially trigger a tab crash by causing memory pressure while a page runs heavy allocations, though the report only demonstrates a crash under low-memory conditions.

Irvan Kurniawan Follow

Originally disclosed on Mozilla

  • Fixed in 9 days
  • Paid in 14 days
  • Disclosed after 9 days

Created attachment 9400552 PHC-MaybePageRealloc.patch

When run JetStream2 WSL benchmark on low memory condition, I notice the Firefox tab able to crash on access-violation on jemalloc AllocInfo::Get, after some debugging I found it occur after newPtr = MozJemalloc::moz_arena_malloc failure on PHC.cpp MaybePageRealloc function.

Steps to reproduce:

  1. Apply PHC-MaybePageRealloc.patch
  2. After Firefox was compiled
  3. Visit https://browserbench.org/JetStream2.0/
  4. After loading benchmark is completed
  5. Click Start Test
  6. On WSL benchmark, firefox tab crashed with access-violation on AllocInfo::Get

(If the tab is not crashed, reload the JetStream page, then re-click the Start Test button)

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 the failure return from the underlying allocation call in MaybePageRealloc is not handled before AllocInfo::Get is called on the resulting pointer.

Impact

Under low-memory conditions a Firefox tab could crash; the report does not claim memory corruption or code execution.

What the attacker needed

A debug patch applied; custom Firefox build; low memory condition; victim loads a heavy benchmark page

How it was found

  1. Apply the provided patch and compile Firefox.
  2. Open the JetStream2 benchmark page.
  3. Wait for the benchmark to finish loading.
  4. Click Start Test.
  5. Observe the tab crash with an access violation in AllocInfo::Get, reloading and retrying if it does not crash first time.

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 runs low on memory, it sometimes has to ask the operating system for more. This report shows that when that request failed in a particular part of Firefox's memory manager, the code kept going and read from a bad location, which crashed the tab. A crash is not the same as letting someone run their own code, but it can still be used to disrupt a user.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.