Out of bounds write in V8 (CVE-2025-9132)
A mismatch between the number of suspend points counted by the parser and those emitted by the bytecode compiler causes an out-of-bounds write in the constant pool of a V8 BytecodeArray. An attacker could craft JavaScript that triggers this write, corrupting a switch table entry and potentially leading to memory corruption or code execution.
Originally disclosed on Chrome VRP
- Fix shipped in 16 days
We are tracking this issue with the public ID BIGSLEEP-436210783. Please use this identifier for reference in any future communication.
Vulnerability Details
The below sample triggers a bug in the JavaScript parser, causing invalid bytecode to be emitted.
When parsing async and/or generator functions, the resulting bytecode will make use of suspend points to indicate the different positions where execution might restart from (e.g. after a yield). These are effectively implemented as a big switch statement at the start of the function switching on the generator state and then jumping to the respective position. During parsing, the number of these suspend points is computed via FunctionState::AddSuspend and then during bytecode compilation the suspend points are emitted via BytecodeGenerator::BuildSuspendPoint. What appears to happen in the sample below is a mismatch between these two, where the parser only counts N suspend points but the bytecode compiler generates N+1 such points. Since the jump tables used for switch statements are implemented as a range of Smi values inside a BytecodeArray’s constant pool, this effectively leads to an out-of-bounds write inside the constant pool (manifesting as a DCHECK failure: Debug check failed: case_value < case_value_base_ + size() (2 vs. 2)). It appears that the switch table from which the OOB write happens is always followed by a second switch table. As such, the OOB write would corrupt the first entry of the next switch table. Since the Smi values represent relative offsets into the BytecodeArray to which execution would jump, this will often cause a jump into the middle of another bytecode. In the sample below, this will lead to the execution of an invalid bytecode opcode, resulting in a nullptr dereference. However, by modifying the code of the function it is possible to influence the bytecode instruction that will be jumped into. With that, it should be possible to execute unexpected-but-valid bytecode opcodes to cause further memory corruption.
The bug appears to have been introduced by https://crrev.com/c/6594471 which allowed using await using inside c-style for loops.
Affected Version(s)
Current HEAD (f697fbd47c40208a31984bf138587a579679c031) and current Stable.
Reproduction
Test Case
The following testcase causes a DCHECK failure in debug builds and a segmentation fault in release builds as described above.
async function* bug() {
for (await using x = { [Symbol.asyncDispose]() {} }; 1; ) {}
}
async function run() {
for await (const x of bug()) {}
}
run();
Build Instructions
Follow the instructions at https://v8.dev/docs/build. The crash was verified on a debug build:
gm.py x64.debug
Command
./out/x64.debug/d8 crash.js
Reporter Credit
Google Big Sleep
Disclosure Policy
This bug is subject to a 90-day disclosure deadline. If a fix for this issue is made available to users before the end of the 90-day deadline, this bug report will become public 30 days after the fix was made available. Otherwise, this bug report will become public at the deadline. The scheduled deadline is 2025-11-02.
For more information, visit https://goo.gle/bigsleep
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 a mismatch in suspend point counting between the parser and bytecode generator, introduced by a change allowing `await using` inside C-style for loops.
Impact
The out-of-bounds write corrupts a switch table entry, often causing a jump into the middle of bytecode and a nullptr dereference; by modifying the function code, an attacker could potentially execute unexpected bytecode opcodes to cause further memory corruption.
What the attacker needed
Ability to run JavaScript in V8
How it was found
- Build V8 in debug mode using gm.py x64.debug.
- Run the provided JavaScript test case with d8.
- Observe the DCHECK failure in debug builds or segmentation fault in release builds.
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. When it compiles async or generator functions, it uses a jump table to remember where to resume after a yield. A bug caused the table to be one entry too small, so writing the extra entry overwrote memory that belonged to the next table. This could crash the browser or, with careful crafting, let an attacker run malicious 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.