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

Type Confusion in V8 (CVE-2026-1862)

Syn4pse Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 6 days

VULNERABILITY DETAILS

Summary

MaglevGraphBuilder::VisitThrowReferenceErrorIfHole incorrectly eliminates TDZ checks for module variables because CanBeTheHoleValue does not include LoadTaggedField in its whitelist. This causes the_hole_value (HOLE_TYPE) to leak into JS when accessing uninitialized module bindings, leading to type confusion. This issue is similar to crbug.com/450618029

Suggested Fix

Add Opcode::kLoadTaggedField to the CanBeTheHoleValue() whitelist, or special-case Cell::kValueOffset reads to return Tribool::kMaybe to prevent hole check elimination for module variable accesses.

Attached fix.diff which adds kLoadTaggedField to the CanBeTheHoleValue() whitelist:

Diff
diff --git a/src/maglev/maglev-ir.h b/src/maglev/maglev-ir.h
--- a/src/maglev/maglev-ir.h
+++ b/src/maglev/maglev-ir.h
@@ -734,6 +734,9 @@ constexpr bool CanBeTheHoleValue(Opcode opcode) {
   switch (opcode) {
     case Opcode::kInitialValue:
     case Opcode::kCallRuntime:
+    case Opcode::kLoadTaggedField:
     // TODO(victorgomes): Should we have a list of builtins that could
     // return the hole?
     case Opcode::kCallBuiltin:

Details

When accessing module variables, Ignition generates the following bytecode sequence:

  • LdaModuleVariable
  • ThrowReferenceErrorIfHole "<name>"
  • Return

The ThrowReferenceErrorIfHole bytecode is critical for TDZ enforcement and must be preserved to prevent the_hole_value from leaking.

In MaglevGraphBuilder::VisitLdaModuleVariable, module variable accesses are compiled to read from a Cell via LoadTaggedField(Cell::kValueOffset). The issue is that ValueNode::IsTheHole returns kFalse for LoadTaggedField nodes because CanBeTheHoleValue does not include Opcode::kLoadTaggedField in its whitelist:

C++
constexpr bool CanBeTheHoleValue(Opcode opcode) {
  switch (opcode) {
    case Opcode::kInitialValue:
    case Opcode::kCallRuntime:
    // TODO(victorgomes): Should we have a list of builtins that could
    // return the hole?
    case Opcode::kCallBuiltin:
    case Opcode::kGeneratorRestoreRegister:
    case Opcode::kRootConstant:
    case Opcode::kLoadContextSlot:
    case Opcode::kLoadContextSlotNoCells:
    case Opcode::kLoadFixedArrayElement:
    case Opcode::kPhi:
      return true;
    default:
      return false;
  }
}

As a result, when MaglevGraphBuilder::VisitThrowReferenceErrorIfHole checks IsTheHole() and gets kFalse, it skips inserting the hole check entirely. Additionally, MaglevGraphOptimizer::VisitThrowReferenceErrorIfHole removes any existing ThrowReferenceErrorIfHole nodes when IsTheHole() == kFalse.

C++
ReduceResult MaglevGraphBuilder::VisitThrowReferenceErrorIfHole() {
  // ThrowReferenceErrorIfHole <variable_name>
  compiler::NameRef name = GetRefOperand<Name>(0);
  ValueNode* value = GetAccumulator();
  switch (value->IsTheHole()) {
    case Tribool::kTrue:
      return BuildThrow(Throw::kThrowAccessedUninitializedVariable,
                        GetConstant(name));
    case Tribool::kFalse:
      return ReduceResult::Done();
    case Tribool::kMaybe:
      DCHECK(value->is_tagged());
      return AddNewNode<ThrowReferenceErrorIfHole>({value}, name);
  }
}

This causes the_hole_value to leak into JavaScript, which then triggers crashes when the value is used (e.g., in Map.delete() or JSON.stringify()).

VERSION

V8 commit: 5853269075baaf304cd5be09d941a6c3e9671847

V8 Version: 14.6.101

REPRODUCTION CASE

Build args on commit 5853269075baaf304cd5be09d941a6c3e9671847:

is_component_build = false
is_debug = false
v8_enable_backtrace = true
dcheck_always_on = true
is_asan=true
v8_static_library=true

Run ./d8 --module --allow-natives-syntax poc.js, you would observe the DCHECK failure as the stack.txt shows.

The original report as published on the Chromium issue tracker, by Chaoyuan Peng (@ret2happy). 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.

What is known

A high-severity memory corruption bug in V8 (Google Chrome). Chrome VRP made it public on 3 February 2026 as CVE-2026-1862. Fixed in version 144.0.7559.132.

About 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.

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

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 by Syn4pse

View all

9 more disclosed reports, best first.

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.