Access violation on JS::Zone::Zone at address 0xe5e5e601 after allocation failure on marker->init()
A memory allocation failure during garbage collection marker initialisation leads to an access violation in JS::Zone::Zone when creating new Workers. An attacker could crash the browser by exhausting memory and repeatedly creating Workers.
Originally disclosed on Mozilla
- Fixed in 4 days
- Paid in 13 days
- Disclosed after 4 days
After allocate large memory then execute new Worker repeatedly, Firefox able to crash on JS::Zone::Zone(JSRuntime*, JS::shadow::Zone::Kind) at address 0xe5e5e601
I able to reproduce the access violation after commit Bug 1865597 - Add error checking when initializing parallel marking and disable on error
After investigation, I found the memory allocation failure is occur on GC.cpp GCRuntime::updateMarkersVector on if (!marker->init()) { return false; } it return false; when Firefox process OOM. I've attached .patch that simulate the memory allocation failure.
Tested on
- Firefox Nightly 122.0a1 (2023-12-06) (32-bit) on Windows 11
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 code did not properly handle the failure of marker->init() during garbage collection, leading to use of an uninitialised or invalid pointer.
Impact
An attacker could crash the browser (denial of service) by causing memory exhaustion and creating Workers.
What the attacker needed
Ability to run JavaScript in Firefox; memory exhaustion
How it was found
- Allocate a large amount of memory to cause memory pressure.
- Repeatedly execute `new Worker` to create new workers.
- Observe the access violation crash at JS::Zone::Zone.
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 out of memory, it should handle that gracefully. Here, a failure to set up part of the garbage collector (which cleans up unused memory) was not handled properly, so the browser crashed when trying to create a new background task (a Worker).
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.