Skip to content
DoS Disclosed report Advanced

AddressSanitizer: SEGV on unknown address or Assertion failure: isAllocated(alloc), at gc/BufferAllocatorInternals.h:260

A crafted JavaScript snippet using the gczeal testing function triggers a crash in the garbage collector's buffer allocator, where an assertion about whether an allocation is nursery-owned fails. The reporter suspects a recent change migrating PrivateScriptData to the buffer allocator as the regressor, but the text does not confirm exploitability beyond a denial-of-service crash.

Gary Kwong Follow

Originally disclosed on Mozilla

  • Fixed in 37 hours
  • Paid in 6 days
  • Disclosed after 37 hours
Text
Created attachment 9546644
debug stack

'''js
gczeal(8, 1);
function f() {
  let a = [
    {
      g: function () {},
    },
  ];
  "12345678" + undefined;
}
f();
'''

'''
(gdb) bt
#0  0x00005555578fe6ee in MOZ_CrashSequence (aAddress=0x0, aLine=260)
    at /home/msf2/shell-cache/js-dbg-64-linux-x86_64-8ce9d585aca5-609457/objdir-js/dist/include/mozilla/Assertions.h:237
#1  js::gc::AllocSpace<js::gc::SmallBufferRegion, 16384ul, 16ul>::isNurseryOwned (this=0x5cfe610c000, alloc=0x5cfe610cf10)
    at /home/msf2/trees/firefox/js/src/gc/BufferAllocatorInternals.h:260
#2  0x00005555578d858a in js::gc::BufferAllocator::isNurseryOwned (this=this@entry=0x7ffff5b0c7b0, alloc=0x0, alloc@entry=0x5cfe610cf10)
    at /home/msf2/trees/firefox/js/src/gc/BufferAllocator.cpp:809
#3  0x00005555578db55f in js::gc::BufferAllocator::traceEdge (this=0x7ffff5b0c7b0, trc=0x7ffff5e256d0, owner=0x0, bufferp=0x7ffffffface8, name=<optimized out>)
    at /home/msf2/trees/firefox/js/src/gc/BufferAllocator.cpp:967
#4  0x00005555586624f6 in js::gc::TraceBufferEdgeInternal (trc=0x7ffff5e256d0, maybeOwner=0x0, bufferp=0x104, name=0x0, zone=<optimized out>)
    at /home/msf2/trees/firefox/js/src/gc/BufferAllocator-inl.h:136
#5  js::TraceBufferRoot<js::PrivateScriptData> (trc=0x7ffff5e256d0, bufferp=0x104, name=0x0, zone=<optimized out>) at /home/msf2/trees/firefox/js/src/gc/Tracer.h:237
/snip
'''

'''
398a31295dff-608240
398a31295dffbb51630b93f70e196e94f2728daa is the first interesting commit
commit 398a31295dffbb51630b93f70e196e94f2728daa
Author: Jon Coppeard <[address removed]>
Date:   Thu Feb 12 15:26:29 2026 +0000

    Bug 2002790 - Migrate to using the buffer allocator for PrivateScriptData r=jandem

    Differential Revision: https://phabricator.services.mozilla.com/D282829
'''

Run with `--fuzzing-safe --no-threads --ion-eager`, compile with `AR=ar sh ~/trees/firefox/js/src/configure --enable-debug --enable-debug-symbols --with-ccache --enable-nspr-build --enable-ctypes --enable-gczeal --enable-rust-simd --disable-tests`, tested on gh rev 8ce9d585aca55919997d1a05506c69e309369167.

An ASan build crashes at `js::gc::detail::ChunkPtrHasStoreBuffer` at the top of the stack.

Jon, is bug 2002790 a likely regressor?

The original report as published on Mozilla's Bugzilla, by Gary Kwong. 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 regression from migrating PrivateScriptData to the buffer allocator, leaving an allocation that the allocator's nursery-ownership check does not recognise.

What the attacker needed

Gczeal testing function enabled; debug or ASan build

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.

This is a bug report for the JavaScript engine inside Firefox. A short script that uses a special testing function for the garbage collector (the part that frees unused memory) makes the browser's engine crash instead of running normally. The reporter narrowed it down to a recent code change and asked the developer whether that change caused it.

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 Gary Kwong

View all

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