JavaScript is dynamically typed and V8 runs it at near-native speed. The trick is speculation: V8 watches what your objects look like, bets that they will keep looking that way, and generates specialised machine code. The bug in this series is what happens when the bet is wrong in a way the engine did not re-check.

JavaScript is dynamically typed and V8 runs it at near-native speed. The trick
is speculation: V8 watches what your objects look like, bets that they will
keep looking that way, and generates specialised machine code. The bug in this
series is what happens when the bet is wrong in a way the engine did not
re-check.
A page's JavaScript goes through four stages:
Maglev and Turbofan are where the speed comes from, and where the assumptions
live. Both are in scope for CVE-2026-85046: the corpus names the flaw as the
Maglev and Turbofan inline implementation of Array.prototype.sort.
V8 does not look up properties by name at runtime. It gives every object a
hidden map (a shape descriptor) and compiles property access as an offset
into that shape. Two objects with the same properties in the same order share
a map; adding a property creates a new map and invalidates the old assumption.
Arrays have an extra dimension: the element kind.
The element kind is part of the array's type. A fast path that reads a
PACKED_SMI array as raw 64-bit integers is making a bet about that kind. If
the kind changes and the code keeps reading the old way, a pointer is
interpreted as a number or a number as a pointer — which is exactly the
primitive a V8 exploit needs.
An inline cache is a small bet at a call site: "the last time this ran, the
receiver had map M, so use offset O". If a different map arrives, the cache
misses, the engine takes the slow path, and may deoptimise the function
back to bytecode.
Deoptimisation is the safety net. The bug class in this series is a path where
the net does not catch the change — where the optimised code keeps using the
entry assumption after a callback has mutated the object underneath it.
Array.prototype.sort takes a user-supplied comparator, and the specification
allows that comparator to do anything — including mutating the array being
sorted. A correct inlined implementation therefore has to:
Step 3 is the one that is easy to get wrong, because the fast path is written
for the common case where the comparator is pure. The corpus's defect is
precisely an incomplete step 3.
V8 has hardening that makes exploitation harder even when a confusion exists:
pointer compression, the sandbox heap, external pointer tables, and the
renderer sandbox around the whole process. Those defences are why this CVE is
code execution inside the sandbox rather than an immediate host takeover.
They raise the cost of the second step; they do not remove the first.

Next: Part 6 — the small failures first: deopt, speculation and the
invalidation points that were missed before the big one.