Race in V8 (CVE-2026-5893)
A race condition in V8's handling of growable shared array buffers allows an out-of-bounds write when Object.values or Object.entries is called on a TypedArray while another thread grows the buffer. An attacker could potentially cause memory corruption or a crash.
- Fix shipped in 41 days
Steps to reproduce the problem
run with: Download worker.js and poc.js and put them in the same directory. d8 poc.js
Problem Description
Root Cause
The root cause is inconsistent length snapshots within one logical operation, plus missing write-side capacity bounds.
- Allocation uses old length (snapshot A)
- Writing re-reads a new length (snapshot B, possibly larger)
- When
snapshot B > snapshot A,values_or_entries->set(count++, ...)writes out of bounds
This is a classic shared-memory TOCTOU problem under GSAB + length-tracking TypedArray concurrent growth.
Trigger Path and Call Chain
Key call chain:
Object.values(ta)/Object.entries(ta)enters the fast path.FastGetOwnValuesOrEntriesallocates the result array using one length snapshot:src/objects/js-objects.cc:2240src/objects/js-objects.cc:2249
- Then it enters TypedArray element collection:
src/objects/js-objects.cc:2254src/objects/elements.cc:3719
TypedElementsAccessor::CollectValuesOrEntriesImplreads the current length again and writes in a loop:- Length read:
src/objects/elements.cc:3726 - Write site:
src/objects/elements.cc:3733
- Length read:
In the PoC, a worker concurrently executes sab.grow(...), making step-2 allocation length smaller than step-4 write length, which causes OOB writes.
Additional Comments
Introduced by commit
commit 3160edf011b11347dd741c1c09a7fcb57bb479c4
[rab/gsab] ResizableArrayBuffer / GrowableSharedArrayBuffer part 1
Detailed list of changes:
https://docs.google.com/document/d/15i4-SZDzFDW7FfclIYuZEhFn-q-KpobCBy23x9zZZLc/edit?usp=sharing
Bug: v8:11111
Change-Id: I931003bd4552cf91d57de95af04a427a9e6d6ac9
Summary
Debug check failed: IsInBounds(index).
Custom Questions
Type of crash:
tab
Crash state:
# Fatal error in ../../src/objects/fixed-array-inl.h, line 160
# Debug check failed: IsInBounds(index).
#
#
#
#FailureMessage Object: 0x7ffcc5f29308
==== C stack trace ===============================
/home/qy/new2/v8/out/x64.debug/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x29) [0x7d3f31b090e9]
/home/qy/new2/v8/out/x64.debug/libv8_libplatform.so(+0x4e29d) [0x7d3f31a6a29d]
/home/qy/new2/v8/out/x64.debug/libv8_libbase.so(V8_Fatal(char const*, int, char const*, ...)+0x205) [0x7d3f31add2f5]
/home/qy/new2/v8/out/x64.debug/libv8_libbase.so(+0x53b8c) [0x7d3f31adcb8c]
/home/qy/new2/v8/out/x64.debug/libv8_libbase.so(V8_Dcheck(char const*, int, char const*)+0x4d) [0x7d3f31add3ed]
/home/qy/new2/v8/out/x64.debug/libv8.so(v8::internal::TaggedArrayBase<v8::internal::FixedArray, v8::internal::TaggedArrayShape, v8::internal::HeapObjectLayout>::set(unsigned int, v8::internal::Tagged<v8::internal::Object>, v8::internal::WriteBarrierMode)+0x81) [0x7d3f2bbb9fe1]
/home/qy/new2/v8/out/x64.debug/libv8.so(+0xa852a36) [0x7d3f2cc52a36]
/home/qy/new2/v8/out/x64.debug/libv8.so(+0xa8508cb) [0x7d3f2cc508cb]
/home/qy/new2/v8/out/x64.debug/libv8.so(v8::internal::FastGetOwnValuesOrEntries(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSReceiver>, bool, v8::internal::Handle<v8::internal::FixedArray>*)+0x5f1) [0x7d3f2cdcc7f1]
/home/qy/new2/v8/out/x64.debug/libv8.so(v8::internal::GetOwnValuesOrEntries(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSReceiver>, v8::internal::PropertyFilter, bool, bool)+0x8b) [0x7d3f2cdcd89b]
/home/qy/new2/v8/out/x64.debug/libv8.so(v8::internal::JSReceiver::GetOwnValues(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSReceiver>, v8::internal::PropertyFilter, bool)+0x4a) [0x7d3f2cdce0ba]
/home/qy/new2/v8/out/x64.debug/libv8.so(+0xaf3b29d) [0x7d3f2d33b29d]
/home/qy/new2/v8/out/x64.debug/libv8.so(v8::internal::Runtime_ObjectValues(int, unsigned long*, v8::internal::Isolate*)+0x151) [0x7d3f2d33af21]
/home/qy/new2/v8/out/x64.debug/libv8.so(+0x8c289bd) [0x7d3f2b0289bd]
Trace/breakpoint trap (core dumped)
Reporter credit:
QYmag1c
Additional Data
Category: Security
Chrome Channel: Not sure
Regression: N/A \
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
The code takes two separate length readings during one operation and does not re-check the allocated capacity before writing, so a concurrent growth between the readings leads to an out-of-bounds write.
Impact
The out-of-bounds write could lead to memory corruption, potentially allowing code execution or causing a crash.
What the attacker needed
Ability to run JavaScript in V8; use of growable shared array buffers; concurrent worker thread
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.
This is a bug in the JavaScript engine V8. When you ask for the values of a special kind of array that can grow while another thread changes its size, the engine can write past the end of an allocated memory area. That can crash the program or, in theory, let an attacker run harmful code.
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.