Assertion failure: baselineScript_, at js/src/jit/JitScript.h:479
An assertion failure occurs in the JavaScript engine's baseline JIT compiler when attaching a cache stub for a typed element property access. An attacker could potentially trigger this assertion, causing a denial of service in the js-shell.
Originally disclosed on Mozilla
- Fixed in 7 days
- Paid in 14 days
- Disclosed after 7 days
Steps to reproduce:
On git commit 3279ccb472284368de49190d73acb13926a757ec I observed an assertion violation in the js-shell. Unfortunately, reproduction this assertion is a bit convoluted.
The 6 input files are provided via the reprl/fuzzing interface, hence the attached python script instead of a simple js file.
Furthermore, reproduction works in 10% of trials only. The script's `SPIDERMONKEY` must be adapted to point to the js-shell.
Precautiously marking as s-s.
I uploaded a pernosco session here but the source seems to missing, not sure what I did wrong there.
https://pernos.co/debug/5z_QVrXs3ZkRL1NaiXTQfg/index.html
'''
#0 js::jit::AttachBaselineCacheIRStub (cx=cx@entry=0x7ffff662e100, writer=..., kind=<optimized out>,
outerScript=0x382c863a1330, icScript=icScript@entry=0x7ffff549e400, stub=stub@entry=0x7ffff549ea70,
name=0x555555a30c8a "GetProp.TypedElement")
at js/src/jit/BaselineCacheIRCompiler.cpp:2602
#1 0x0000555557cdd497 in js::jit::TryAttachStub<js::jit::GetPropIRGenerator, js::jit::CacheKind, JS::Handle<JS::Value>&, JS::Handle<JS::Value>&> (name=0x5555559d70d6 "GetElem", cx=cx@entry=0x7ffff662e100, frame=<optimized out>,
stub=stub@entry=0x7ffff549ea70, args=..., args=..., args=...)
at js/src/jit/BaselineIC.cpp:497
#2 0x0000555557cdca6b in js::jit::DoGetElemFallback (cx=0x7ffff662e100, frame=0x7fffffffbea0,
stub=0x7ffff549ea70, lhs=..., rhs=..., res=...) at js/src/jit/BaselineIC.cpp:708
#3 0x000035c7531ab627 in ?? ()
#4 0x0000000000000101 in ?? ()
#5 0x00007fffffffbb18 in ?? ()
#6 0x0000000000000000 in ?? ()
'''
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 logic error in the baseline JIT compiler's cache stub attachment for typed element property accesses, causing an assertion to fail.
What the attacker needed
Access to js-shell; ability to run fuzzing script
How it was found
- Use the provided Python script with the reprl/fuzzing interface.
- Set the SPIDERMONKEY environment variable to point to the js-shell.
- Run the script; reproduction succeeds about 10% of the 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.
This report describes a crash in a JavaScript engine's optimising compiler. The crash happens because the engine's internal checks fail when it tries to speed up a property access on a typed array. A crash like this can stop the program from working, which is a denial of service.
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.