Before a type confusion becomes a CVE, it is a series of small failures: a map that changed, a cache that missed, a deopt that did not happen. This part walks the failure ladder — the ordinary ways a JIT gets assumptions wrong — because the fundamental flaw is one rung above them.

Before a type confusion becomes a CVE, it is a series of small failures: a
map that changed, a cache that missed, a deopt that did not happen. This part
walks the failure ladder — the ordinary ways a JIT gets assumptions wrong —
because the fundamental flaw is one rung above them.
The simplest JIT failure is a shape change. A function is optimised for an
object with fields {host, port}; the page then adds {host, port, user}, and
the object gets a new map. The inline cache misses, the engine deoptimises, and
the slow path handles it. This is normal and safe — the cost is performance,
not correctness.
The lesson: the engine knows how to lose a bet. The bug is never "the map
changed". It is "the code did not notice that the map changed".
Arrays are worse than objects because the element kind is part of the array's
storage. A PACKED_SMI array stores raw integers; a PACKED_ELEMENTS array stores
tagged pointers. If code specialised for SMI reads a tagged pointer as an
integer, it gets a plausible-looking number that is actually an address. If it
reads an integer as a tagged pointer, it gets a fake object.
Element-kind transitions are supposed to be tracked at every store. The
difficult cases are the ones where a callback does the store, because the
optimised code may not be the code doing the mutation.
This is the rung the CVE sits on. Array.prototype.sort is not a pure
function over an array; it is a loop that calls user code between
comparisons. Between two iterations, the comparator can:
A correct inlined sort re-reads the element kind after every callback and
falls back to the generic path if anything changed. An inlined sort that keeps
using the entry assumption is fast, and wrong.
Type feedback is collected during interpretation: "this call site has seen
SMI arrays 1,000 times". Maglev and Turbofan use that feedback to specialise.
The feedback is a statistically reasonable bet, and the engine has invalidation
machinery to revoke the bet when the world changes.
The system is sound only if every invalidation point is wired to the
specialised code. Missing one is not a design flaw in the JIT; it is a bug in
one builtin — but the consequence is a type confusion, because the code keeps
reading memory according to a type that is no longer true.
Once two types are treated as one, exploitation is a matter of construction:
Those two primitives are the foundation of a V8 exploit. From there: a
crafted object with controlled length and elements pointer gives arbitrary
read/write inside the renderer; from there, code execution in the sandbox.
JIT bugs are not exotic. They are the ordinary consequence of optimising a
language whose types are dynamic and whose callbacks are hostile. The engine
loses bets all day and recovers. What makes a CVE is a bet that the engine
does not know it lost.

Next: Part 7 — the first and most fundamental flaw: CVE-2026-85046, the
missing re-check, and the exact sentence the advisory used.