Skip to content
Memory corruption Advisory Advanced CVE-2026-10964

Integer overflow in V8 (CVE-2026-10964)

An integer overflow in V8's LiteralBuffer::ConvertToTwoByte during background parsing of a 1 GiB string literal causes an out-of-bounds write outside the V8 sandbox. An attacker could potentially achieve remote code execution in the renderer by racing heap grooming against the write.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 26 days

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: An integer overflow exists in LiteralBuffer::ConvertToTwoByte during the background parsing of JavaScript strings. By providing a 1 GiB string literal via streaming compilation, an attacker can overflow a signed 32-bit size calculation, causing a massive out-of-bounds write outside the V8 sandbox. A concurrent heap grooming strategy can exploit the resulting race window to achieve remote code execution in the renderer.

Affected files:

  • v8/src/parsing/literal-buffer.cc
  • v8/src/parsing/literal-buffer.h
  • v8/src/codegen/compiler.cc
  • v8/src/parsing/scanner.cc
  • v8/src/parsing/scanner-character-streams.cc
  • third_party/blink/renderer/bindings/core/v8/script_streamer.cc

Estimated timestamp from git blame: 2023-06-13

Summary

A potential integer overflow vulnerability exists in V8's LiteralBuffer::ConvertToTwoByte, which is triggered when parsing a massive (1 GiB) string literal. Because the streaming compilation path (BackgroundCompileTask) does not enforce standard V8 string length limits during parsing, an attacker can force a buffer to grow to 1 GiB. When a non-ASCII character is subsequently encountered, a signed integer overflow occurs during buffer expansion calculation. This results in the reuse of an undersized buffer and a massive out-of-bounds backward sweep across the renderer heap, completely bypassing the V8 sandbox.

Vulnerability Details

In v8/src/parsing/literal-buffer.cc, the ConvertToTwoByte() method converts a string literal buffer from one-byte (Latin-1) to two-byte (UC16) when a non-Latin-1 character is found.

C++
void LiteralBuffer::ConvertToTwoByte() {
  DCHECK(is_one_byte());
  base::Vector<uint8_t> new_store;
  int new_content_size = position_ * base::kUC16Size; // [1] Integer Overflow
  if (new_content_size >= backing_store_.length()) { // [2] Comparison Failure
    new_store = base::Vector<uint8_t>::New(NewCapacity(new_content_size));
  } else {
    new_store = backing_store_;
  }
  uint8_t* src = backing_store_.begin();
  uint16_t* dst = reinterpret_cast<uint16_t*>(new_store.begin());
  for (int i = position_ - 1; i >= 0; i--) { // [3] OOB Write Loop
    dst[i] = src[i];
  }
  // ...
}
  1. Integer Overflow: position_ is a signed int tracking the number of accumulated characters. Normally, String::kMaxLength prevents strings from reaching 1 GiB. However, the background Scanner does not enforce this limit while accumulating literals. When position_ reaches exactly 0x40000000 (1 GiB), position_ * base::kUC16Size (where kUC16Size is 2) overflows to 0x80000000. As signed 32-bit integers are used and Chromium compiles with -fno-strict-overflow, this safely wraps to -2147483648 (INT_MIN).
  2. Comparison Failure: The check new_content_size >= backing_store_.length() evaluates INT_MIN >= 0x40000000. This returns false. The function skips allocating a new 2 GiB buffer and aliases new_store to the existing 1 GiB backing_store_.
  3. Out-of-Bounds Write: The loop expands characters in-place by sweeping backwards. On the first iteration (i = 0x3FFFFFFF), the code reads safely from src[i] but writes to dst[i], which translates to byte offset 0x7FFFFFFE. Since the buffer is only 0x40000000 bytes long, this write lands almost 1 GiB out-of-bounds.

Exploitability and Sandbox Bypass

The LiteralBuffer allocates memory using base::Vector::New, which routes to PartitionAlloc's default Malloc partition. Crucially, this partition is outside the V8 Sandbox.

While the backward write loop sweeps from 0x7FFFFFFE down towards 0x40000000, it will eventually hit the uncommitted PartitionAlloc guard pages that precede the 1 GiB LiteralBuffer allocation, causing a deterministic SIGSEGV crash.

However, this sweeping operation over ~1 GiB of memory takes tens of milliseconds, creating a substantial race window. An attacker can exploit this via concurrent heap grooming on the main thread:

  1. Before the background thread reaches the overflow, the attacker's main thread allocates a massive 1 GiB target object (e.g., a Blink ArrayBuffer).
  2. PartitionAlloc's AddressPoolManager places DirectMap allocations sequentially bottom-up. The Target object will be placed adjacently above the LiteralBuffer.
  3. When the out-of-bounds write starts at offset 0x7FFFFFFE, it lands squarely inside the Target object's payload.
  4. While the background thread sweeps downward (corrupting the Target object), the attacker's main thread can observe the corruption and use it to escape the sandbox before the background thread hits the guard page and crashes.

Suggested Reproduction Steps

Note: These are potential steps as our tooling cannot currently execute code to verify.

  1. Set up an HTTP server to deliver a large JavaScript file with Content-Type: application/javascript; charset=utf-8 and Content-Encoding: gzip (to bypass network fetch limits and optimize delivery).
  2. The script body should contain a string literal starting with 0x40000000 bytes (1 GiB) of ASCII characters (e.g., 'A'), followed by a non-ASCII two-byte character (e.g., \u0100, encoded as 0xC4 0x80 in UTF-8), and ending with a quote.
  3. Navigate Chrome to an HTML page that includes this script via <script src="..."></script>.
  4. The background parser will accumulate 1 GiB of characters. Upon encountering the two-byte character, it triggers the overflow in ConvertToTwoByte, resulting in an OOB write and eventual crash.

Suggested Fix

  1. Immediate Fix: Use base::CheckedNumeric or base::CheckedMul for the new_content_size calculation in LiteralBuffer::ConvertToTwoByte() to safely catch the overflow and trigger a safe OOM crash.
  2. Structural Fix: Enforce v8::String::kMaxLength limits directly within the Scanner or LiteralBuffer during the streaming compilation phase to prevent the buffer from growing beyond safe sizes in the first place.

Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

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

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 signed 32-bit integer overflow in the size calculation for converting a one-byte string buffer to two-byte, combined with a missing length limit in the background scanner.

Impact

The out-of-bounds write could lead to remote code execution in the renderer, but the write eventually hits guard pages causing a crash, and exploitation requires winning a race window.

What the attacker needed

Victim visits a malicious page; page loads a large gzipped script; script contains a 1 GiB string literal

The fix

The calculation should use checked arithmetic to catch the overflow, and the scanner should enforce string length limits during streaming compilation.

How it was found

  1. Set up an HTTP server to deliver a large JavaScript file with gzip encoding.
  2. Create a script containing a 1 GiB ASCII string literal followed by a non-ASCII character.
  3. Navigate Chrome to an HTML page that loads this script via a script tag.
  4. The background parser accumulates the string and triggers the overflow when it encounters the non-ASCII character, causing an out-of-bounds write and 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.

When a program stores text, it sometimes needs to switch from a compact one-byte-per-character format to a two-byte format for special characters. The code calculates how much space is needed, but with a very large input that calculation wraps around to a negative number, so the program thinks it already has enough space and writes past the end of its buffer. This can crash the browser and, with careful timing, might let an attacker run their own 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.

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.