Skip to content
Memory corruption Write-up Advanced

Two Winning Pwn2Own JIT Vulnerabilities in Mozilla Firefox

Two JIT compiler bugs in Mozilla Firefox's IonMonkey engine were demonstrated at Pwn2Own. One gave incorrect alias information for Array.slice, and the other was a type confusion from a missing shape check, both leading to memory corruption that could be turned into arbitrary read/write and code execution.

zerodayinitiative.com

Published on zerodayinitiative.com

Every year some of the greatest security researchers around the globe gather together for the Pwn2Own event to demonstrate their skills by compromising widely used applications. This year’s event recently completed and did not disappoint.

The author, on zerodayinitiative.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the JIT made unsound assumptions: Array.slice was marked as having limited side effects despite Symbol.species callbacks, and a 2017 commit dropped the unknown-properties flag copy so an object's shape was not rechecked after a prototype change.

Impact

A crafted page could crash the renderer with controlled registers and, with further work, achieve arbitrary read/write and shellcode execution; the competition demos also included a separate sandbox escape to take over the system.

What the attacker needed

Victim visits a crafted web page; affected Firefox version; JIT compilation of attacker JS

The fix

Mozilla patched both underlying bugs, as noted in the linked security advisory.

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 write-up has not been written yet. The Original tab links to the source.

Firefox runs JavaScript through a just-in-time compiler, which turns hot code into fast machine code. Both bugs made that compiler reason incorrectly about the types or side effects of objects, so a crafted web page could corrupt memory and eventually run attacker code. The write-up is a high-level summary and does not include the actual exploit code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.