Skip to content
Memory corruption Advisory Advanced CVE-2025-2137

Out of bounds read in V8 (CVE-2025-2137)

After the parent of a SlicedString is updated, its map object can become outdated, which leads to out-of-bounds memory reads during JSON serialisation. An attacker could trigger this to read memory beyond the intended string buffer, as shown by the corrupted output.

zeroxiaobai@ Follow

Originally disclosed on Chrome VRP

Bounty$2,000 Medium View original
  • Fix shipped in 14 days

VULNERABILITY DETAILS

After updating the parent of a SlicedString, its map object may become outdated, leading to Out-of-Band memory reads during JSON serialization.

VERSION

V8 commit: be6d95e1118064c533c56e0547627374bd2bd434

REPRODUCTION CASE

Build args:

is_component_build = false
is_debug = false
target_cpu = "arm64"
v8_target_cpu = "arm64"
v8_enable_sandbox = true
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
dcheck_always_on = false

Shell args:

./out/arm64.release/d8 --allow-natives-syntax bug.js

Shell output:

expect:  "bbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
found:  "扢扢扢扢扢扢扢扢扢扢扢扢扢扢啢\u0001切Β\u0000猀牴唀\u0001昀Ἤߺ\u0000猀"

CREDIT INFORMATION Reporter credit: [email protected]

The original report as published on the Chromium issue tracker, by zeroxiaobai@. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

This is a Chrome VRP advisory for an out-of-bounds read in V8, the JavaScript engine used by Chrome. The researcher is credited as zeroxiaobai@, the weakness is classified as an out-of-bounds read, the severity is medium, and the bounty was 2,000 USD. The report was disclosed on 10 March 2025 under CVE-2025-2137.

The affected code is identified only by a V8 commit hash:

Text
[redacted]

The researcher's summary is short: after the parent of a SlicedString is updated, its map object may become outdated, and this leads to out-of-bounds memory reads during JSON serialisation.

The reproduction uses a release-style build of d8, the V8 shell, built with the following arguments:

Text
is_component_build = false
is_debug = false
target_cpu = "arm64"
v8_target_cpu = "arm64"
v8_enable_sandbox = true
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
dcheck_always_on = false

The shell is then run against a test file called bug.js with native syntax enabled:

Bash
./out/arm64.release/d8 --allow-natives-syntax bug.js

The output shows a mismatch between the expected and the actual serialised string:

Text
expect:  "bbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
found:  "扢扢扢扢扢扢扢扢扢扢扢扢扢扢啢\u0001切��Β\u0000猀牴唀\u0001昀Ἤߺ\u0000猀"

The expected value is a run of b characters. The found value starts with characters that are not b at all and continues with control characters and other code points, which is the visible symptom of the engine reading past the intended string data. The report does not include the contents of bug.js, so the exact JavaScript that triggers the condition is not shown. It also does not describe a fix commit or the patch itself.

Root cause

The report points to string slicing. A SlicedString in V8 is a view over another string: it stores a reference to a parent string plus an offset and a length, rather than copying the characters. When the parent of such a sliced string is updated, the report says the sliced string's map object may become outdated. A stale map means the engine's assumptions about the object's layout no longer hold, so later operations that trust the map, here JSON serialisation, can read memory outside the intended bounds. The report states this as the cause; the precise mechanism inside the engine is not elaborated.

Impact

The report describes out-of-bounds memory reads during JSON serialisation. In the observed case the effect is a corrupted serialised value: the output contains data that was never part of the string. The report does not claim code execution, memory disclosure to a remote party, or a sandbox escape, and it does not describe an exploit. The severity assigned by the program is medium.

How this kind of bug works

Out-of-bounds reads in a JavaScript engine come from a mismatch between what the engine believes about an object and what is actually in memory. Engines optimise aggressively: strings are shared, sliced and represented in several forms, and objects carry a map (hidden class) that tells the engine their layout and type. If an operation mutates an object in a way that leaves a dependent object's map or metadata stale, subsequent code can compute a length or an offset from the wrong assumptions and read past the end of a buffer.

String representations are a common source of this. A slice that references a parent avoids copying, so the parent's lifetime and contents matter. If the parent changes and the slice is not updated consistently, the slice can point at data that no longer matches its recorded length. Serialisation routines then walk the string according to the stale length and read adjacent memory.

The general defences are type and bounds checks at the points where the engine trusts its own metadata, heap verification in debug builds, and careful invalidation of dependent objects whenever a shared backing store is mutated. Sandboxing and process isolation limit what a read can reach, but they do not remove the bug.

How to test for it

This class of bug is found by stressing the engine's optimised paths, not by sending HTTP requests. A practical method:

  1. Identify operations that create views over shared data: string slicing, substring, concatenation of ropes, array buffers and typed array views, and any API that returns a window onto existing memory.
  2. Build a test that creates such a view, then mutates or replaces the underlying object through a different path, and finally forces the engine to consume the view, for example by serializing it to JSON, comparing it, or hashing it.
  3. Run the test under a debug or verification build of the engine where heap checks and assertions are enabled, so that a stale map or an out-of-bounds access is reported rather than silently tolerated.
  4. Compare the consumed value against the value the language semantics require. A positive result is a mismatch, a crash, or a verification failure that disappears when the mutation step is removed.

Common false positives are ordinary bugs in the test itself, such as comparing against the wrong expected value, relying on unspecified behaviour, or triggering a known and already-fixed issue on an old build. Always confirm the result reproduces on the stated version and that removing the suspected trigger removes the symptom.

How it is fixed

The report does not describe a fix commit or the patch itself.

Hunting notes

This bug class tends to hide in optimised engine internals: string representations, view objects, inline caches, and any code that caches layout information across a mutation. Recon signals include recent refactors of slicing or view code, changes to how parents and children share storage, and commits that touch both mutation and serialisation paths. Because the effect can be silent, the strongest evidence is a deterministic mismatch or a verification-build failure with a minimal reproducer, run against the exact commit named in the report. Present the expected and actual values, the build configuration, and the command used, so the program can reproduce it without guesswork.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

This is a bug bounty advisory from the Google Chrome Vulnerability Reward Program (VRP), a scheme that pays people who find and report security flaws in Chrome. The flaw is in V8, the JavaScript engine that Chrome uses to run the code on web pages. The researcher is credited as zeroxiaobai@, the weakness is classified as an out-of-bounds read, the severity is medium, and the bounty was 2,000 USD. The report was disclosed on 10 March 2025 under the identifier CVE-2025-2137.

An out-of-bounds read means a program reads memory it was not supposed to touch, a bit like reading a few lines past the end of a page in a book: you get text, but not the text that belongs to that page. Here the reading happens while the engine turns a string into JSON, the text format used to send data between programs.

The affected code is identified only by a V8 commit hash, a unique fingerprint for one saved version of the source code:

Text
[redacted]

The researcher's summary is short: after the parent of a SlicedString is updated, its map object may become outdated, and this leads to out-of-bounds memory reads during JSON serialisation. A SlicedString is V8's way of representing a piece of a longer string without copying the characters: it keeps a pointer to the original (the parent) plus a start position and a length. A map object is the engine's internal note describing what kind of object something is and how it is laid out in memory. If that note goes stale, the engine works from wrong assumptions.

The reproduction uses d8, the standalone V8 shell (a small program that runs JavaScript with the engine alone, without a browser around it), built with these arguments:

Text
is_component_build = false
is_debug = false
target_cpu = "arm64"
v8_target_cpu = "arm64"
v8_enable_sandbox = true
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
dcheck_always_on = false

Each line switches a build option on or off. target_cpu and v8_target_cpu set the processor type to arm64. v8_enable_sandbox turns on V8's sandbox, an isolation layer that limits what memory the engine can reach. v8_enable_backtrace, v8_enable_disassembler and v8_enable_object_print enable debugging aids that print call stacks, machine code and object contents. v8_enable_verify_heap turns on heap verification, a self-check that looks for corrupted memory. is_debug = false and dcheck_always_on = false mean this is a release-style build rather than a fully instrumented debug one.

The shell is then run against a test file called bug.js with native syntax enabled:

Bash
./out/arm64.release/d8 --allow-natives-syntax bug.js

--allow-natives-syntax lets the test file use special internal functions that ordinary JavaScript cannot call, which is how engine testers reach low-level behaviour. The output shows a mismatch between the expected and the actual serialised string:

Text
expect:  "bbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
found:  "扢扢扢扢扢扢扢扢扢扢扢扢扢扢啢\u0001切��Β\u0000猀牴唀\u0001昀Ἤߺ\u0000猀"

The expected value is a run of b characters. The found value starts with characters that are not b at all and continues with control characters and other code points. That is the visible symptom of the engine reading past the intended string data: the serialised result contains characters that were never part of the string. The report does not include the contents of bug.js, so the exact JavaScript that triggers the condition is not shown, and it does not describe a fix commit or the patch itself.

Root cause

The report points to string slicing. When the parent of such a sliced string is updated, the report says the sliced string's map object may become outdated. A stale map means the engine's assumptions about the object's layout no longer hold, so later operations that trust the map, here JSON serialisation, can read memory outside the intended bounds. The report states this as the cause; the precise mechanism inside the engine is not elaborated.

Impact

The report describes out-of-bounds memory reads during JSON serialisation. In the observed case the effect is a corrupted serialised value: the output contains data that was never part of the string. The report does not claim code execution, memory disclosure to a remote party, or a sandbox escape, and it does not describe an exploit. The severity assigned by the program is medium.

In general, how this kind of bug works

Out-of-bounds reads in a JavaScript engine come from a mismatch between what the engine believes about an object and what is actually in memory. Engines optimise aggressively: strings are shared, sliced and represented in several forms, and objects carry a map (also called a hidden class) that tells the engine their layout and type. If an operation changes an object in a way that leaves a dependent object's map or metadata stale, later code can compute a length or an offset from the wrong assumptions and read past the end of a buffer.

String representations are a common source of this. A slice that references a parent avoids copying, so the parent's lifetime and contents matter. If the parent changes and the slice is not updated consistently, the slice can point at data that no longer matches its recorded length. Serialisation routines then walk the string according to the stale length and read adjacent memory.

The general defences are type and bounds checks at the points where the engine trusts its own metadata, heap verification in debug builds, and careful invalidation of dependent objects whenever a shared backing store is changed. Sandboxing and process isolation limit what a read can reach, but they do not remove the bug.

In general, how to test for it

This class of bug is found by stressing the engine's optimised paths, not by sending HTTP requests. A practical method:

  1. Identify operations that create views over shared data: string slicing, substring, concatenation of ropes, array buffers and typed array views, and any API that returns a window onto existing memory.
  2. Build a test that creates such a view, then changes or replaces the underlying object through a different path, and finally forces the engine to consume the view, for example by serializing it to JSON, comparing it, or hashing it.
  3. Run the test under a debug or verification build of the engine where heap checks and assertions are enabled, so that a stale map or an out-of-bounds access is reported rather than silently tolerated.
  4. Compare the consumed value against the value the language semantics require. A positive result is a mismatch, a crash, or a verification failure that disappears when the change step is removed.

Common false positives are ordinary bugs in the test itself, such as comparing against the wrong expected value, relying on unspecified behaviour, or triggering a known and already-fixed issue on an old build. Always confirm the result reproduces on the stated version and that removing the suspected trigger removes the symptom.

In general, how it is fixed

In general, where to look

This bug class tends to hide in optimised engine internals: string representations, view objects, inline caches, and any code that caches layout information across a change. Recon signals include recent refactors of slicing or view code, changes to how parents and children share storage, and commits that touch both change and serialisation paths. Because the effect can be silent, the strongest evidence is a deterministic mismatch or a verification-build failure with a minimal reproducer, run against the exact commit named in the report. Present the expected and actual values, the build configuration, and the command used, so the program can reproduce it without guesswork.

Glossary

  • Bug bounty: a program that pays researchers for reporting security flaws.
  • Chrome VRP: Google Chrome's Vulnerability Reward Program.
  • V8: the JavaScript engine inside Chrome that executes page scripts.
  • Out-of-bounds read: reading memory outside the area a program intended to access.
  • CVE: a public identifier for a known security vulnerability.
  • Commit hash: a unique fingerprint identifying one saved version of source code.
  • SlicedString: V8's representation of a piece of a longer string, stored as a pointer to the parent plus an offset and length, without copying.
  • Parent string: the original string that a slice refers to.
  • Map object (hidden class): internal metadata describing an object's type and memory layout.
  • Stale map: a map that no longer matches the object's actual layout.
  • JSON: a text format for representing data, used widely to exchange it between programs.
  • Serialisation: converting an in-memory value into a text or byte format such as JSON.
  • d8: the standalone V8 shell used to run JavaScript with the engine alone.
  • Build arguments: options that control how a program is compiled.
  • Sandbox: an isolation layer that limits what memory a component can reach.
  • Heap verification: a self-check that looks for corrupted or inconsistent memory.
  • Native syntax: special internal functions exposed to test scripts, enabled with --allow-natives-syntax.
  • Code execution: the ability of an attacker to run their own code on a target machine.
  • Sandbox escape: breaking out of an isolation layer to reach the wider system.
  • Exploit: a technique that turns a flaw into a concrete attack.
  • Reproducer: a minimal test that reliably triggers a bug.
  • Regression test: a test added to ensure a fixed bug does not return.
  • False positive: a test result that looks like a bug but is not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.