Firefox SpiderMonkey JIT Miscompilation and Use-After-Free (CVE-2026-2764)
Published: 2026-08-16 • Researcher: SneakyNachos
- Severity
- High
- CVE
- CVE-2026-2764 / MFSA 2026-13
- Category
- binary
- Affected product
- Mozilla Firefox (SpiderMonkey JavaScript Engine)
- Affected versions
- Firefox before 148, ESR before 115.33 and 140.8
- Disclosed
- 2026-08-16
- Patch status
- Unverified
Tags
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-08-16 |
| Last Updated | 2026-08-16 |
| Author / Researcher | SneakyNachos |
| CVE / Advisory | CVE-2026-2764 / MFSA 2026-13 |
| Category | binary |
| Severity | High |
| CVSS Score | 8.8 (browser RCE) |
| Status | Patched |
| Tags | firefox, spidermonkey, jit, uaf, type-confusion, wasm, browser, ionmonkey, baseline, proxy, CVE-2026-2764 |
Affected Target
| Field | Value |
|---|---|
| Software / System | Mozilla Firefox (SpiderMonkey JavaScript Engine) |
| Versions Affected | Firefox before 148, ESR before 115.33 and 140.8 |
| Language / Platform | JavaScript (SpiderMonkey jsshell PoCs) |
| Authentication Required | None – victim visits attacker-controlled page |
| Network Access Required | Remote – deliver via web page |
Summary
CVE-2026-2764 is a JIT miscompilation vulnerability in Firefox SpiderMonkey (IonMonkey/Baseline) that leads to type confusion and use-after-free. On new Ctor(...arr) / Reflect.construct with a Proxy as newTarget, the proxy get trap fires while the engine is between spreading arguments and creating this. The callback can mutate or free the spread array while the engine continues with stale assumptions.
Two PoC variants (verbatim Mozilla regression tests): type confusion (int swapped to object mid-spread) and UAF (elements store freed via GC mid-spread).
Vulnerability Details
Root Cause
PortableBaselineInterpret.cpp routed scripted-constructor this-creation through CreateThisFromIC which re-read IC state. The fix (hg 1b58f51668d3) calls js::CreateThis directly with properly rooted values.
Attack Flow
- JIT warmup: Iterate class hierarchy with super(…arr) to trigger compilation
- Proxy trigger: Reflect.construct with Proxy newTarget whose get handler mutates/frees the array
- Type confusion: arr[0] swapped from int to object after spread snapshot
- UAF: arr.length = 0; gc() frees elements store mid-spread
Impact
- Type confusion primitive leads to addrof/fakeobj
- UAF leads to dangling pointer access
- Full chain: type confusion -> TypedArray corruption -> arbitrary R/W -> WASM JIT shellcode
Environment / Lab Setup
| |
Proof of Concept
Two JS files mirrored from SneakyNachos/CVE-2026-2764-but-with-wasm. Both are verbatim Mozilla regression tests.
poc-typeconfusion.js (28 lines)
Proxy get handler swaps arr[0] from integer to “oops” after JIT-compiled spread snapshot.
poc-uaf.js (36 lines)
Proxy get handler sets sharedArr.length = 0 and calls gc(), freeing elements store mid-spread.
Detection and Indicators of Compromise
Remediation
| Action | Detail |
|---|---|
| Patch | Update Firefox to 148+, ESR to 115.33+ or 140.8+. |
| Workaround | Disable JIT via about:config (performance impact). |
| Verification | Run PoCs in jsshell – patched builds print “no crash” messages. |
References
- MFSA 2026-13
- Bugzilla 2012608 (restricted)
- Fix: hg 1b58f51668d3, 3adad00d0042, tests 57885d520e85
- SneakyNachos/CVE-2026-2764-but-with-wasm (upstream)
Notes
Two minimal JS files screened (28 and 36 lines). Verbatim Mozilla regression tests – no exploitation payload. Type confusion produces assertion failure; UAF produces segfault. No binaries, no network activity. Author documents splice plan for WASM JIT shellcode stage. Verified against 2026-02-09 mozilla-central nightly jsshell.