Assertion failure: payload->toStackSlot()->width() == LStackSlot::width(LDefinition::GENERAL), at jit/shared/CodeGenerator-shared.cpp:603
A crafted JavaScript program triggers an assertion failure in the JIT compiler's code generation, causing a crash. The report does not claim any attacker impact beyond the crash.
- Fixed in 4 days
- Paid in 5 days
- Disclosed after 4 days
Steps to reproduce:
Steps to reproduce
Version: c081f3f7d21922047379fe76320cfbc3abf7f2b3 (2026-01-16) Args: js --fuzzing-safe test.js
Test case:
try {
for (;;) {
function a() {
a;
}
for (let b = 0; b < 5; b++) {
new SharedArrayBuffer();
a(BigInt.asUintN(64, BigInt(b)));
}
}
} catch {}
Actual results
[71353] Assertion failure: payload->toStackSlot()->width() == LStackSlot::width(LDefinition::GENERAL), at js/src/jit/shared/CodeGenerator-shared.cpp:603
#01: ???[dist/bin/js +0x2b50d23]
#02: ???[dist/bin/js +0x2b51cb5]
#03: ???[dist/bin/js +0x2bb41de]
#04: ???[dist/bin/js +0x2bb4140]
#05: ???[dist/bin/js +0x2e8d88a]
#06: ???[dist/bin/js +0x2e23865]
#07: ???[dist/bin/js +0x2e21a25]
#08: ???[dist/bin/js +0x2eeab02]
#09: ???[dist/bin/js +0x2fcb3fb]
#10: ???[dist/bin/js +0x301308e]
#11: ???[dist/bin/js +0x36594a6]
#12: ???[dist/bin/js +0x368b8fd]
#13: ???[dist/bin/js +0x368b518]
#14: ???[dist/bin/js +0x3699ca4]
#15: ???[/lib/x86_64-linux-gnu/libc.so.6 +0x9caa4]
#16: ???[/lib/x86_64-linux-gnu/libc.so.6 +0x129c6c]
#17: ??? (???:???)
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==71353==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x58a8abc47d3b bp 0x774bd99fe540 sp 0x774bd99fe4d0 T71355)
==71353==The signal is caused by a WRITE memory access.
==71353==Hint: address points to the zero page.
#0 0x58a8abc47d3b in MOZ_CrashSequence(void*, long) dist/include/mozilla/Assertions.h:237:3
#1 0x58a8abc47d3b in js::jit::CodeGeneratorShared::encodeAllocation(js::jit::LSnapshot*, js::jit::MDefinition*, unsigned int*, bool) js/src/jit/shared/CodeGenerator-shared.cpp:602:9
#2 0x58a8abc48cb4 in js::jit::CodeGeneratorShared::encode(js::jit::LSnapshot*) js/src/jit/shared/CodeGenerator-shared.cpp:726:5
#3 0x58a8abcab1dd in void js::jit::CodeGeneratorX86Shared::bailout<js::jit::BailoutLabel>(js::jit::BailoutLabel const&, js::jit::LSnapshot*) js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp:520:3
#4 0x58a8abcab13f in js::jit::CodeGeneratorX86Shared::bailoutFrom(js::jit::Label*, js::jit::LSnapshot*) js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp:549:3
#5 0x58a8abf84889 in js::jit::CodeGenerator::visitLexicalCheck(js::jit::LLexicalCheck*) js/src/jit/CodeGenerator.cpp:21714:3
#6 0x58a8abf1a864 in js::jit::CodeGenerator::generateBlock(js::jit::LBlock*, unsigned long, js::jit::IonScriptCounts*, bool) js/src/jit/CodeGenerator.cpp:8664:7
#7 0x58a8abf18a24 in js::jit::CodeGenerator::generateBody() js/src/jit/CodeGenerator.cpp:8573:10
#8 0x58a8abfe1b01 in js::jit::CodeGenerator::generate(js::jit::WarpSnapshot const*) js/src/jit/CodeGenerator.cpp:17454:8
#9 0x58a8ac0c23fa in js::jit::GenerateCode(js::jit::MIRGenerator*, js::jit::LIRGraph*, js::jit::WarpSnapshot const*) js/src/jit/Ion.cpp:1674:17
#10 0x58a8ac0c23fa in js::jit::CompileBackEnd(js::jit::MIRGenerator*, js::jit::WarpSnapshot*) js/src/jit/Ion.cpp:1704:28
#11 0x58a8ac10a08d in js::jit::IonCompileTask::runTask() js/src/jit/IonCompileTask.cpp:52:24
#12 0x58a8ac10a08d in js::jit::IonCompileTask::runHelperThreadTask(js::AutoLockHelperThreadState&) js/src/jit/IonCompileTask.cpp:30:5
#13 0x58a8ac7504a5 in js::GlobalHelperThreadState::runTaskLocked(JS::HelperThreadTask*, js::AutoLockHelperThreadState&) js/src/vm/HelperThreads.cpp:667:11
#14 0x58a8ac7828fc in js::GlobalHelperThreadState::runOneTask(JS::HelperThreadTask*, js::AutoLockHelperThreadState&) js/src/vm/HelperThreads.cpp:623:3
#15 0x58a8ac7828fc in js::HelperThread::threadLoop(js::InternalThreadPool*) js/src/vm/InternalThreadPool.cpp:324:25
#16 0x58a8ac782517 in js::HelperThread::ThreadMain(js::InternalThreadPool*, js::HelperThread*) js/src/vm/InternalThreadPool.cpp:251:11
#17 0x58a8ac790ca3 in void js::detail::ThreadTrampoline<void (&)(js::InternalThreadPool*, js::HelperThread*), js::InternalThreadPool*&, js::HelperThread*>::callMain<0ul, 1ul>(std::integer_sequence<unsigned long, 0ul, 1ul>) js/src/threading/Thread.h:226:5
#18 0x58a8ac790ca3 in js::detail::ThreadTrampoline<void (&)(js::InternalThreadPool*, js::HelperThread*), js::InternalThreadPool*&, js::HelperThread*>::Start(void*) js/src/threading/Thread.h:215:11
#19 0x774bdaf01aa3 in start_thread nptl/pthread_create.c:447:8
#20 0x774bdaf8ec6b in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
==71353==Register values:
rax = 0x0000000000000000 rbx = 0x0000000000000000 rcx = 0x000000000000025b rdx = 0x0000774bdb069563
rdi = 0x0000774bdb06a700 rsi = 0x0000000000000000 rbp = 0x0000774bd99fe540 rsp = 0x0000774bd99fe4d0
r8 = 0x0000000000000000 r9 = 0x0000000000000003 r10 = 0x0000000000000002 r11 = 0x0000000000000293
r12 = 0x0000774bd87d0000 r13 = 0x0000774bd87a1770 r14 = 0x0000774bd879dc68 r15 = 0x0000774bd99fe5ac
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV dist/include/mozilla/Assertions.h:237:3 in MOZ_CrashSequence(void*, long)
==71353==ABORTING
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 mismatch between the stack slot width expected for a value and the width recorded during JIT code generation, triggered by the interaction of lexical checks and BigInt operations.
Impact
The engine crashes (assertion failure and segmentation fault), which could be used for denial of service but the report does not demonstrate memory corruption or code execution.
What the attacker needed
Ability to run JavaScript in the engine; fuzzing-safe build or debug build with assertions
How it was found
- Run the JavaScript engine with the fuzzing-safe flag on the provided test case.
- The test case loops forever, creating a function and calling it with BigInt values inside a loop that also allocates SharedArrayBuffer objects.
- The JIT compiler processes the code and hits the assertion during code generation.
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 in the JavaScript engine's just-in-time compiler, which turns JavaScript into machine code while the program runs. A specific loop with a function and BigInt values makes the compiler's internal bookkeeping inconsistent, so it hits a safety check and aborts. The result is a crash, not a way to run attacker code.
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.