Skip to content
DoS Disclosed report Advanced

Assertion failure: allocSitesSpace_.isEmpty(), at jit/JitScript.cpp:61

A debug assertion in the JavaScript engine's JIT inlining code fails when a crafted script is run repeatedly under fuzzing options. The reporter could not make it reproduce reliably, so it is unclear whether an attacker could do more than crash a debug build.

Gary Kwong Follow

Originally disclosed on Mozilla

  • Fixed in 38 hours
  • Paid in 7 days
  • Disclosed after 38 hours
Text
Created attachment 9487525
Console.app stack from macOS

'''js
abcd1 = 5;
function ff() {
  for (
    let ii = 10;
    ii;
    (() => {
      ii--;
      function fff() {
        fff;
      }
      v = { 1() {}, h(xx) {} };
    })()
  )
    for (let i, jjj = 1; jjj--, jjj; ) {}
  this.oomTest(ff);
}
ff();
'''

Backtraces are from unreduced testcase, which is also just as intermittent.

'''
[13030] Assertion failure: allocSitesSpace_.isEmpty(), at /Users/p4m1/trees/mozilla-central/js/src/jit/JitScript.cpp:61
#01: js::jit::ICScript::~ICScript()[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x16dca1c]
#02: js::jit::ICScript::addInlinedChild(JSContext*, mozilla::UniquePtr<js::jit::ICScript, JS::DeletePolicy<js::jit::ICScript>>, unsigned int)[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x16de8d0]
#03: js::jit::TrialInliner::createInlinedICScript(JSFunction*, js::BytecodeLocation)[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x10cb384]
#04: js::jit::TrialInliner::maybeInlineCall(js::jit::ICEntry&, js::jit::ICFallbackStub*, js::BytecodeLocation)[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x10cba40]
#05: js::jit::TrialInliner::tryInlining()[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x10c70e0]
#06: js::jit::DoTrialInlining(JSContext*, js::jit::BaselineFrame*)[/Users/p4m1/shell-cache/js-dbg-64-fzli-darwin-arm64-bff55607678c/js-dbg-64-fzli-darwin-arm64-bff55607678c +0x10c68bc]
/snip
'''

The intermittence is making it very difficult to bisect. If someone can make this testcase reliable, a bisection window can be produced easily.

Run with `--fuzzing-safe --ion-eager --fast-warmup --inlining-entry-threshold=64`, compile with `AR=ar 'PATH="/Users/USER/trees/depot_tools:/Users/USER/.local/state/fnm_multishells/772_1747172985416/bin:/usr/share/doc/git/contrib/diff-highlight:/Users/USER/.local/bin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/USER/.deno/bin:/Users/USER/.cargo/bin:/usr/bin:/bin:/usr/sbin:/sbin"' sh ../configure --enable-debug --enable-fuzzing --enable-js-fuzzilli --disable-shared-js --with-ccache --enable-gczeal --enable-rust-simd --disable-tests`, tested on m-c rev bff55607678c.

I'm not sure if the testcase reproduces without fuzzilli configs, in any case run this testcase between 500-1000 times, and maybe more, it might be reproducible.

Setting s-s as a start. Jan, this is likely in your ballpark for now.

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 bug in the trial-inlining code that manages inlined script data, where an internal list expected to be empty is not when the object is destroyed.

Impact

The result is an assertion failure that crashes a debug build; the report does not show memory corruption or any effect on release users.

What the attacker needed

Debug build with fuzzing options; run the script many times

How it was found

  1. Run the engine with the listed fuzzing and JIT options.
  2. Execute the provided script, which calls the engine's out-of-memory test helper on a function.
  3. Repeat the run between 500 and 1000 times or more until the assertion fires.

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 crash report for a JavaScript engine. A special check built into a testing version of the engine failed while it was optimising a script, which stops the program. The author could not trigger it every time, so it is not yet known whether normal users are affected.

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.