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.
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:
- Apply PHC-MaybePageRealloc.patch
- After Firefox was compiled
- Visit https://browserbench.org/JetStream2.0/
- After loading benchmark is completed
- Click Start Test
- 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)
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
- Apply the provided patch and compile Firefox.
- Open the JetStream2 benchmark page.
- Wait for the benchmark to finish loading.
- Click Start Test.
- 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.