Type Confusion in V8 (CVE-2026-1862)
- 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 --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:
LdaModuleVariableThrowReferenceErrorIfHole "<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:
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.
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.
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.