Closed Bug 2039571 Opened 6 months ago Closed 6 months ago

pwn2own 2026 bug - JavaScript Promise Integration in WASM

Categories

(Core :: JavaScript: WebAssembly, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2008358
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- disabled
firefox150 --- disabled
firefox151 --- disabled
firefox152 --- fixed

People

(Reporter: freddy, Unassigned)

Details

Attachments

(7 files)

Attached file exp.js —

TBD

Attached file testcase.html —
Attached file module.wat —
Attached file wat2js.sh —
Attached file credit.txt —
Attachment #9586365 - Attachment description: index.html → testcase.html
Attachment #9586365 - Attachment filename: index.html → testcase.html
Keywords: bugmon
Component: Security → JavaScript: WebAssembly

The write up refers to the old JS-PI implementation and bug 2008358 that we fixed as part of it. I haven't been able to reproduce on the Nightly yet, so there's a chance we have fixed this.

Attached file poc-shell.js —

Claude translated exploit to just use the JS shell builtins. Shell code replaced with -2.458343745902715e+255 (0xf4).

I can reproduce this issue in a 4-13-2026 nightly JS shell build, but not on a 5-12-2026 JS shell build (5f15185120f488edb4b4f2f38599fff543b9aa5a). Bug 2008358 was fixed by bug 2023217 on 4-16-2026.

From the writeup:

Ion's GVN pass merges `WasmArrayDataPointer` loads across JSPI suspension points because `wasmCallAliasSet()` explicitly excludes `WasmArrayDataPointer` from its clobber set, trusting the GC to rewrite any stale spill slots after an array moves. But `Instance::updateFrameForMovingGC` is never called for JSPI-suspended stacks — only `Instance::traceFrame` runs (via `TraceSuspendableStack`), and `traceFrame` skips `StackMap::Kind::ArrayDataPointer` entries. The combined result is that after a minor GC moves a WasmGC array while a JSPI stack is suspended, the Ion-cached `data_` pointer is stale: it still points at the array's old nursery location. Subsequent `array.get` or `array.set` operations on the resumed stack read from or write to freed memory.

Bug 2023217 fixed this by tracing suspended stacks for moving GCs and updating array data pointers [1]. That lines up with this issue being reproducible in 4-13-2026, but not 5-12-2026.

I'll test some more builds just to be triple sure, but this is has been fixed already.

[1] https://searchfox.org/firefox-main/rev/923c4d7d35ebb5693f5bda5dec9083f7c4f993b3/js/src/wasm/WasmStacks.cpp#697-726

Quick manual bisect:

Reproduces: https://ftp.mozilla.org/pub/firefox/nightly/2026/04/2026-04-15-21-21-14-mozilla-central/
No longer reproduces: https://ftp.mozilla.org/pub/firefox/nightly/2026/04/2026-04-16-09-37-20-mozilla-central/

That confirms that bug 2023217 (landed 4-16) fixed this.

We also enabled JS-PI in Nightly only last week, so this never was enabled with the bug in it.

Severity: -- → S3
Status: NEW → RESOLVED
Closed: 6 months ago
Duplicate of bug: 2008358
Priority: -- → P3
Resolution: --- → DUPLICATE

Unable to reproduce bug 2039571 using build mozilla-central 20260514091837-3710783bfb55. Without a baseline, bugmon is unable to analyze this bug.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Keywords: bugmon
Attachment #9586368 - Attachment mime type: application/x-sh → text/plain
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: