Skip to content
DoS Disclosed report

StrictMode+JIT Crash/Assert: (uint32) index < arr->length

Christian Holler Follow

Originally disclosed on Mozilla

  • Fixed in 15 days
  • Paid in 2.6 years
  • Disclosed after 15 days

The following scripts were tested on mozilla-central trunk debug shell:

The attached testcase "min-assertIndexArrLengthCrash.js" will assert

Assertion failure: (uint32) index < arr->length, at jsscriptinlines.h:64

and furthermore crash with an invalid read (beyond array) and segmentation fault with an optimized build:

==15313== Invalid read of size 8 ==15313== at 0x6026E0: js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x476CF6: js::Execute(JSContext*, JSObject*, JSScript*, JSStackFrame*, unsigned int, js::Value*) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x4118F5: JS_ExecuteScript (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x407850: Process(JSContext*, JSObject*, char*, int) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x4085FF: Shell(JSContext*, int, char**, char**) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x408904: main (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== Address 0x805d6e030 is not stack'd, malloc'd or (recently) free'd ==15313== ==15313== ==15313== Process terminating with default action of signal 11 (SIGSEGV) ==15313== Access not within mapped region at address 0x805D6E030 ==15313== at 0x6026E0: js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x476CF6: js::Execute(JSContext*, JSObject*, JSScript*, JSStackFrame*, unsigned int, js::Value*) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x4118F5: JS_ExecuteScript (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x407850: Process(JSContext*, JSObject*, char*, int) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x4085FF: Shell(JSContext*, int, char**, char**) (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== by 0x408904: main (in /scratch/holler/LangFuzz/sources/mozilla-central-hg/js.opt/src/shell/js) ==15313== If you believe this happened as a result of a stack ==15313== overflow in your program's main thread (unlikely but ==15313== possible), you can try to increase the size of the ==15313== main thread stack using the --main-stacksize= flag. ==15313== The main thread stack size used in this run was 8388608.

The attached, slightly modified testcase "min-assertIndexArrLengthCrash.js" will assert instead with:

Assertion failure: !cx->fp()->hasImacropc() && (pc == cx->regs->pc || pc == cx->regs->pc + 1), at jstracer.cpp:5400

but I assume those to be related.

I also quickly verified both test cases on 32-bit, although the crash in optimized build with the first test case looks different here.

Locked as security bug due to possible exploitability (index length assertion and invalid read beyond array).

The original report as published on Mozilla's Bugzilla, by Christian Holler. 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.

What is known

A doS bug in JavaScript Engine. Mozilla made it public on 7 January 2011.

About DoS

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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 Christian Holler

View all

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