Assertion failure: !values_.has(def) (Discarding a definition still in the set) in js/src/jit/ValueNumbering.cpp
A crafted JavaScript input triggers an assertion failure in the SpiderMonkey JIT compiler's value numbering pass, where a definition is discarded while still present in a set. An attacker could cause a debug build of the JavaScript engine to crash, but the text does not claim any further impact.
- Fixed in 5 days
- Paid in 7 days
- Disclosed after 5 days
Created attachment 9492891 poc.js
Reproduce
- Clone the Firefox mirror from https://github.com/mozilla/gecko-dev
- Run build command:
mkdir fuzzbuild_OPT.OBJ && cd fuzzbuild_OPT.OBJ && ../configure --enable-address-sanitizer --disable-jemalloc --enable-debug --enable-optimize --disable-shared-js --enable-application=js --enable-gczeal && make -j64in the js/src directory of the firefox checkout - Run poc:
fuzzbuild_OPT.OBJ/dist/bin/js poc.js
- my test spidermonkey commit hash
commit bd57b566959758d0455c6e37afca00648c8e4ff0 (HEAD -> master, origin/master, origin/HEAD)
Author: Michael Froman <[address removed]>
Date: Fri May 16 14:05:49 2025 -0500
Bug 1963852 - Vendor libwebrtc from 2c8f5be692
Upstream commit: https://webrtc.googlesource.com/src/+/2c8f5be6924d507ee74191b1aeadcec07f747f21
Publish guidelines for organizational contributions to WebRTC
Bug: None
Change-Id: Ie17600e64fb5054ed3baa0f424bdd3adfa728c37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370440
Commit-Queue: Harald Alvestrand <[address removed]>
Reviewed-by: Fredrik Solenberg <[address removed]>
Cr-Commit-Position: refs/heads/main@{#44272}
Bisect
Debug Log
[1571101] Assertion failure: !values_.has(def) (Discarding a definition still in the set), at gecko-dev/js/src/jit/ValueNumbering.cpp:326
#01: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x528fcb2]
#02: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x528f34b]
#03: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x5298054]
#04: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x529873c]
#05: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x529945c]
#06: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x529cbd1]
#07: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x5c07fcc]
#08: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x63a8a87]
#09: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x6334399]
#10: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x6339d9d]
#11: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x62a7704]
#12: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x62d41dc]
#13: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x3427378]
#14: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x342708d]
#15: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x34a294b]
#16: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x34a20bb]
#17: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x34d391b]
#18: ???[/home/sakura/gecko-dev/js/src/fuzzbuild_OPT.OBJ/dist/bin/js +0x2d48e67]
#19: ???[/lib/x86_64-linux-gnu/libc.so.6 +0x94ac3]
#20: ???[/lib/x86_64-linux-gnu/libc.so.6 +0x126a40]
#21: ??? (???:???)
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 the value numbering pass removes a definition from its tracking structure while the definition is still referenced in a set, violating an internal invariant.
What the attacker needed
Debug build of SpiderMonkey; ability to run a crafted script
How it was found
- Clone the Firefox source mirror.
- Configure and build the JavaScript shell with debug and sanitizer options.
- Run the provided proof-of-concept script with the built shell.
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.
A JavaScript engine compiles code to run faster, and one step tries to remove duplicate calculations. A bug in that step makes the engine's internal safety check fail, so a debug build stops with an error. The report only shows a crash in a special debug build, not a way to take over a system.
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.