Type Confusion in V8 (CVE-2026-15776)
A V8 fast path for RegExp.prototype[Symbol.matchAll] stored a HeapNumber through a Smi-typed store that skips the write barrier, leaving an old JSRegExp.lastIndex pointing at young-space memory. After a young GC reclaimed that memory, the stale pointer caused a crash, and the reporter chained it with a known sandbox escape to reach the v8CTF target.
Originally disclosed on Chrome VRP
- Fix shipped in 7 days
VULNERABILITY DETAILS
Pure JavaScript can make RegExp.prototype[Symbol.matchAll] store a young
HeapNumber into an old JSRegExp.lastIndex field through a fast path typed as
Smi.
That Smi store lowers to StoreObjectFieldNoWriteBarrier, so the old-to-new
edge is not recorded. A later young GC can reclaim/reuse the young HeapNumber
while the old JSRegExp.lastIndex field still points at the stale young-space
address.
Minimal trigger shape:
- A fake receiver passes
flags: "g"andlastIndex: 1073741823(Smi::kMaxValueon x64 pointer-compression builds). constructor[Symbol.species]returns a different fastJSRegExp.matchAlliterator-next handles an empty match and advances the species regexp'slastIndex.AdvanceStringIndexFastproduces1073741824, which is aHeapNumber.FastStoreLastIndex(JSRegExp, Smi)stores it through the Smi/no-barrier overload.
Relevant current-source refs:
src/builtins/regexp-match-all.tq:178-188
FastLoadLastIndex -> AdvanceStringIndexFast -> FastStoreLastIndex
src/builtins/builtins-regexp-gen.h:217-220
AdvanceStringIndexFast(...) is declared TNode<Smi> but casts
AdvanceStringIndex(...): Number
src/builtins/builtins-regexp-gen.cc:163-168
FastStoreLastIndex(TNode<JSRegExp>, TNode<Smi>) stores JSRegExp::kLastIndexOffset
src/codegen/code-stub-assembler.cc:4043-4046
StoreObjectField(TNode<Smi>) uses StoreObjectFieldNoWriteBarrier
Expected behavior: the fast path should not store a heap object through a Smi no-write-barrier store. A non-Smi result should use a generic tagged-object store with the normal write barrier, or the path should deopt/fallback before writing.
Actual behavior: valid JavaScript reaches the Smi store with a HeapNumber,
causing stale/corrupt lastIndex state after GC.
I also paired this RegExp primitive with an already known sandbox escape and used the combined chain to flag the Chrome 150 v8CTF target.
VERSION
Chrome Version:
d8 / V8 15.2.0 (candidate)
V8 source commit: 0c7a9d0d8c05491e8053d7259a1a6b11e75c1907
Release d8 build id: 0c3af5e5a4d734b5
ASAN d8 build id: cd9b6305dec563bd
The combined exploitability check was against Chrome for Testing M150 in the v8CTF environment.
Operating System:
Ubuntu 24.04.4 LTS x86_64
Linux 6.8.0-101-generic
REPRODUCTION CASE
Please attach the files in attachments/ directly.
Invariant break, no flags
File:
attachments/poc_invariant_lastindex_heapnumber.js
Command:
d8 attachments/poc_invariant_lastindex_heapnumber.js
Observed:
1073741824 number
This shows the fast path stored Smi::kMaxValue + 1 into lastIndex as a
HeapNumber.
Release crash, no flags
File:
attachments/poc_missing_barrier_crash.js
Command:
d8 attachments/poc_missing_barrier_crash.js
Observed 5/5 locally:
Received signal 11 SEGV_ACCERR ...
exit=139
Supporting files:
attachments/release_crash_summary.txt
attachments/release_crash_sample.txt
attachments/release_build_info.txt
ASAN crash
Command:
ASAN_OPTIONS=symbolize=1:detect_leaks=0 \
out.gn/x64.asan/d8 --disable-in-process-stack-traces \
attachments/poc_missing_barrier_crash.js
The --disable-in-process-stack-traces flag is only used so ASAN owns the
crash report instead of V8's in-process signal handler.
Supporting files:
attachments/asan_stack.txt
attachments/asan_build_info.txt
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash:
d8 process crash. In Chrome this is renderer-reachable V8 code.
Crash State:
AddressSanitizer: SEGV READ
#0 Builtins_TypeOfHandler
#3 v8::internal::Invoke(...) src/execution/execution.cc:475
#5 v8::Script::Run(...) src/api/api.cc:2048
#6 v8::Shell::ExecuteSource(...) src/d8/d8.cc:1150
Full symbolized ASAN output is in:
attachments/asan_stack.txt
Client ID:
N/A
CREDIT INFORMATION
Reporter credit:
Salvatore Gulizia (nickname: Serotav)
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 AdvanceStringIndexFast helper is typed as returning a Smi but can return a HeapNumber, and FastStoreLastIndex then writes it via a Smi no-write-barrier store, so the old-to-new edge is never recorded.
Impact
In Chrome this is renderer-reachable V8 code that crashes the process, and the reporter paired it with an already known sandbox escape to flag the v8CTF target.
What the attacker needed
Ability to run JavaScript in V8; a young GC after the store
The fix
The fast path should not store a heap object through a Smi no-write-barrier store; a non-Smi result should use a generic tagged-object store with the normal write barrier, or the path should deopt or fall back before writing.
How it was found
- Pass a fake receiver with global flags and lastIndex set to the maximum Smi value.
- Have constructor[Symbol.species] return a different fast JSRegExp.
- Let the matchAll iterator-next handle an empty match and advance the species regexp's lastIndex.
- AdvanceStringIndexFast produces a value one above the maximum Smi, which is a HeapNumber.
- FastStoreLastIndex stores that HeapNumber through the Smi no-barrier overload.
- Run a young GC so the stale young-space address is reclaimed, then observe the crash.
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, Chrome's JavaScript engine, sometimes stores small numbers directly inside an object and larger numbers as separate heap objects. A write barrier is bookkeeping that tells the garbage collector an old object now points at a new one; skipping it lets the collector free memory that is still referenced. Here a large number was written through a path meant only for small numbers, so after garbage collection the stored value pointed at freed memory and the engine crashed.
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.