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

Buffer overflow in Blink (CVE-2026-79216)

Blink's Web IDL record conversion reserves native capacity based on the initial V8 array length but re-reads the mutable length during callbacks, allowing an attacker with V8 sandbox read/write to cause an out-of-bounds write in native memory. This can lead to a V8 sandbox bypass, with controlled writes reaching Blink/PartitionAlloc memory outside the V8 cage.

Found by XBOW Follow

Originally disclosed on Chrome VRP

Bounty$1,000 Medium View original
  • Fix shipped in 37 days

VULNERABILITY DETAILS

Blink's generic Web IDL record<K,V> conversion reserves a native Vector from a V8 array's length once, but re-reads the mutable V8 length on every loop iteration and appends with UncheckedAppend(). If an attacker who has compromised the V8 sandbox changes the live key array during a JavaScript callback, the loop can append more native elements than were reserved, causing an out-of-bounds write in PartitionAlloc memory.

The vulnerable conversion is generic Blink C++ with no operating-system or architecture guard, so the capacity violation itself is not Linux-specific. The attached PoC was validated on Linux x86-64. Its classification as a V8 sandbox bypass applies to supported 64-bit V8-sandbox configurations; V8's sandbox is available only in 64-bit configurations. We did not test the PoC's heap-layout assumptions on other targets.

The affected implementation is NativeValueTraits<IDLRecord<K,V>>::NativeValue(). The relevant sequence is:

C++
v8::Local<v8::Array> keys;
v8_object->GetOwnPropertyNames(...).ToLocal(&keys);

ImplType result;
result.ReserveInitialCapacity(keys->Length());

for (uint32_t i = 0; i < keys->Length(); ++i) {
  // GetOwnPropertyDescriptor(), property reads, and K/V conversions can call JS.
  ...
  result.UncheckedAppend(
      std::make_pair(std::move(typed_key), std::move(typed_value)));
}

GetOwnPropertyDescriptor(), reads from the descriptor and input object, and key/value conversions are callback-capable. The copied keys array is not directly exposed to the page, but it is inside the V8 sandbox. The stated attacker precondition—arbitrary read/write within that sandbox—allows its elements and length to be changed during one of those callbacks.

The attached PoC uses the public URLSearchParams record overload:

  1. A Proxy's ownKeys trap returns one key, so Blink reserves one pair<String, String>.
  2. During the first get callback, the PoC uses V8's official sandbox-testing API to locate Blink's copied JSArray and replace its elements and length with a prepared 256-key array.
  3. The native loop observes the new length, while the native Vector still has capacity one.
  4. Up to 96 distinct pairs are written through UncheckedAppend() into and beyond that one-element allocation.
  5. The PoC grooms adjacent one-pair URLSearchParams vectors and checks for changed native entries. If it survives the overwrite, it also performs a JavaScript method call that writes back through a corrupted adjacent native vector.

In an instrumented API-enabled Chromium 151.0.7882.0 build at revision 3ddb585438332a1ab87654d620c5e6a488fe7f1b, where this code remained vulnerable, the defining transition was:

Text
initial_keys=1 capacity=1 size=0
after value callback: dynamic_keys=256
append: pos=0 capacity=1
append: pos=1 capacity=1   # first native OOB pair
append: pos=2 capacity=1

This report assumes a compromised V8 sandbox. The Sandbox object in the PoC supplies only that precondition; it is not the vulnerability and is not available in production builds. V8 documents this testing API as a way to emulate common sandbox memory-corruption primitives.

The vulnerability reported here begins when Blink trusts the mutable V8 object after reserving native capacity. Its security impact is a V8 sandbox bypass: controlled writes reach native Blink/PartitionAlloc memory outside the V8 cage.

VERSION

  • Validated Chrome configuration: Stable 150.0.7871.128, Linux x86-64
  • Code-level scope: generic Blink record conversion on all Blink targets; V8-sandbox-bypass impact applies to supported 64-bit sandbox configurations
  • Chromium revision: 81891e5ca708047763816c778216799ef14c66cb
  • V8 revision: 2b2f69158528fdd9d86b778cfcc2d0a1c4f8c59f
  • Chrome GNU build ID: 2f071daf2a0b4aa68bda1729031294d443a989ab
  • OS used for validation: Ubuntu 24.04 x86-64

REPRODUCTION CASE

Attachment: poc.html

The focused testcase intentionally uses V8's testing API to provide the documented compromised-sandbox precondition while isolating the Blink bug. Build at the affected revision with the API enabled. This must be a non-ASan build because Blink changes the behavior of UncheckedAppend() in its Linux x86-64 ASan configuration, as explained under the crash information below:

Bash
gn gen out/idlrecord-poc --args='is_asan=false is_debug=false dcheck_always_on=false symbol_level=1 blink_symbol_level=1 v8_symbol_level=1 v8_enable_sandbox=true v8_enable_memory_corruption_api=true'
autoninja -C out/idlrecord-poc chrome

Then:

Bash
cd idlrecord
python3 -m http.server 8000

/path/to/chromium/src/out/idlrecord-poc/chrome \
  --user-data-dir=/tmp/chrome-idlrecord-poc \
  --js-flags=--sandbox-testing \
  http://127.0.0.1:8000/poc.html

Expected behavior is a renderer crash/hang after the first append beyond capacity or a JSON result with "ok": true, changed adjacent URLSearchParams entries, and a writeBack object showing a JavaScript-driven native slot update. The exact outcome depends on the adjacent PartitionAlloc layout.

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION

Type of crash: renderer process (native Blink heap corruption).

Crash State: No ASan trace is available for the validated Linux x86-64 target because M150's standard ASan configuration changes the vulnerable operation into a checked one. container_annotations.h defines ANNOTATE_CONTIGUOUS_CONTAINER for Linux/ChromeOS x86-64 ASan builds. Under that macro, the M150 Vector::UncheckedAppend() implementation calls push_back(), which grows the vector when it is full, instead of performing the unchecked placement used in release builds. Producing an ASan report would therefore require altering Blink's ASan-specific implementation and would not reproduce the shipped vulnerable operation under Chrome's standard ASan configuration.

In a non-ASan build, the exact first invalid write is deterministic at the source level: after capacity one is reserved, result.UncheckedAppend() at position one writes a second pair<String, String> immediately beyond the allocation. On the validated x86-64 build the pair is 16 bytes; its size is target-dependent. Subsequent positions extend the overwrite.

The final fault location is heap-layout-dependent because the unchecked loop can corrupt several adjacent native objects before one is dereferenced. For triage, the key diagnostic is the allocation stack for ReserveInitialCapacity(1) paired with the write stack at UncheckedAppend().

CREDIT INFORMATION

Reporter credit: Found by XBOW and triaged by Andrés Luksenberg

The original report as published on the Chromium issue tracker, by Found by XBOW and triaged by Andrés Luksenberg. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Blink, Chromium's rendering engine, converts JavaScript values into native C++ types through Web IDL bindings. One of the generic conversions handles record<K,V>, the IDL type behind JavaScript objects that are treated as dictionaries of key/value pairs. The conversion lives in NativeValueTraits<IDLRecord<K,V>>::NativeValue() in third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h.

The conversion takes the property names of the input object as a V8 array, reserves native capacity equal to that array's length, then loops over the array converting each key and value and appending the resulting pair to a native Vector. The bug is that the reservation happens once, while the length is re-read on every iteration, and the append is unchecked.

A public entry point into this conversion is the URLSearchParams record overload, declared in third_party/blink/renderer/core/url/url_search_params.idl. Passing a plain object to that constructor runs the generic record conversion and produces a native vector of pair<String, String>.

Setup

The report assumes an attacker who already has arbitrary read and write inside the V8 sandbox. That precondition is supplied in the proof of concept by V8's official sandbox-testing API, which is documented in V8's src/sandbox/README.md as a way to emulate common sandbox memory-corruption primitives. The Sandbox object used by the PoC is not the vulnerability and is not available in production builds.

The capacity violation itself is generic Blink C++ with no operating-system or architecture guard, so it is not Linux-specific. The PoC was validated on Linux x86-64, and its classification as a V8 sandbox bypass applies to supported 64-bit V8-sandbox configurations, since V8's sandbox is available only in 64-bit configurations. The heap-layout assumptions of the PoC were not tested on other targets.

Versions and identifiers recorded in the report:

Item Value
Validated Chrome configuration Stable 150.0.7871.128, Linux x86-64
Code-level scope Generic Blink record conversion on all Blink targets; sandbox-bypass impact on supported 64-bit sandbox configurations
Chromium revision [redacted]
V8 revision [redacted]
Chrome GNU build ID [redacted]
OS used for validation Ubuntu 24.04 x86-64
Instrumented build API-enabled Chromium 151.0.7882.0 at revision [redacted]

Finding it

The relevant sequence in NativeValue() is:

C++
v8::Local<v8::Array> keys;
v8_object->GetOwnPropertyNames(...).ToLocal(&keys);

ImplType result;
result.ReserveInitialCapacity(keys->Length());

for (uint32_t i = 0; i < keys->Length(); ++i) {
  // GetOwnPropertyDescriptor(), property reads, and K/V conversions can call JS.
  ...
  result.UncheckedAppend(
      std::make_pair(std::move(typed_key), std::move(typed_value)));
}

The capacity is reserved from keys->Length() once. The loop condition then calls keys->Length() again on every iteration, and each iteration appends with UncheckedAppend(), which does not grow the vector when it is full.

GetOwnPropertyDescriptor(), reads from the descriptor and the input object, and the key and value conversions are all callback-capable: they can run JavaScript. The copied keys array is not directly exposed to the page, but it lives inside the V8 sandbox. An attacker with arbitrary read and write inside that sandbox can therefore change the array's elements and its length during one of those callbacks. The loop then observes a larger length while the native vector still has the original capacity, and the appends run past the end of the allocation into PartitionAlloc memory.

Exploitation

The PoC uses the public URLSearchParams record overload. The steps are:

  1. A Proxy's ownKeys trap returns one key, so Blink reserves one pair<String, String>.
  2. During the first get callback, the PoC uses V8's official sandbox-testing API to locate Blink's copied JSArray and replace its elements and length with a prepared 256-key array.
  3. The native loop observes the new length, while the native Vector still has capacity one.
  4. Up to 96 distinct pairs are written through UncheckedAppend() into and beyond that one-element allocation.
  5. The PoC grooms adjacent one-pair URLSearchParams vectors and checks for changed native entries. If it survives the overwrite, it also performs a JavaScript method call that writes back through a corrupted adjacent native vector.

Step 1: reserve capacity one

The Proxy's ownKeys trap returns a single key. GetOwnPropertyNames() produces a one-element keys array, and ReserveInitialCapacity(1) allocates room for exactly one pair.

Step 2: rewrite the copied array during the callback

During the first get callback, JavaScript runs while the native loop is mid-iteration. The PoC uses the sandbox-testing API to find Blink's copied JSArray inside the sandbox and replaces its elements and length with a prepared 256-key array.

Step 3: the loop sees the new length

On the next evaluation of the loop condition, keys->Length() returns 256. The native vector still has capacity one.

Step 4: unchecked appends past the allocation

Each iteration appends with UncheckedAppend(). Up to 96 distinct pairs are written into and beyond the one-element allocation.

Step 5: detect and extend the corruption

The PoC grooms adjacent one-pair URLSearchParams vectors and checks whether their native entries changed. If it survives the overwrite, it performs a JavaScript method call that writes back through a corrupted adjacent native vector.

Instrumented trace

In the instrumented API-enabled Chromium 151.0.7882.0 build at revision [redacted], where the code remained vulnerable, the defining transition was:

Text
initial_keys=1 capacity=1 size=0
after value callback: dynamic_keys=256
append: pos=0 capacity=1
append: pos=1 capacity=1   # first native OOB pair
append: pos=2 capacity=1

Building and running the PoC

The attachment is poc.html. The focused testcase intentionally uses V8's testing API to provide the documented compromised-sandbox precondition while isolating the Blink bug. Build at the affected revision with the API enabled. This must be a non-ASan build, because Blink changes the behaviour of UncheckedAppend() in its Linux x86-64 ASan configuration (see Root cause):

Bash
gn gen out/idlrecord-poc --args='is_asan=false is_debug=false dcheck_always_on=false symbol_level=1 blink_symbol_level=1 v8_symbol_level=1 v8_enable_sandbox=true v8_enable_memory_corruption_api=true'
autoninja -C out/idlrecord-poc chrome

Then serve the directory and launch the build:

Bash
cd idlrecord
python3 -m http.server 8000

/path/to/chromium/src/out/idlrecord-poc/chrome \
  --user-data-dir=/tmp/chrome-idlrecord-poc \
  --js-flags=--sandbox-testing \
  http://[redacted]:8000/poc.html

Expected behaviour is a renderer crash or hang after the first append beyond capacity, or a JSON result with "ok": true, changed adjacent URLSearchParams entries, and a writeBack object showing a JavaScript-driven native slot update. The exact outcome depends on the adjacent PartitionAlloc layout.

Root cause

The mistake is that Blink trusts a mutable V8 object after reserving native capacity. The reservation is derived from the array length at one point in time, but the loop re-reads that length on every iteration and appends without a capacity check. Any callback-capable operation inside the loop, such as GetOwnPropertyDescriptor(), a property read, or a key or value conversion, gives JavaScript a chance to run, and an attacker with sandbox read/write can use that chance to enlarge the copied keys array. The result is an out-of-bounds write in PartitionAlloc memory.

On the validated x86-64 build the pair is 16 bytes, and its size is target-dependent. The first invalid write is deterministic at the source level: after capacity one is reserved, result.UncheckedAppend() at position one writes a second pair<String, String> immediately beyond the allocation. Subsequent positions extend the overwrite. The final fault location is heap-layout-dependent, because the unchecked loop can corrupt several adjacent native objects before one is dereferenced.

ASan does not catch this in Chrome's standard configuration. container_annotations.h defines ANNOTATE_CONTIGUOUS_CONTAINER for Linux/ChromeOS x86-64 ASan builds. Under that macro, the M150 Vector::UncheckedAppend() implementation calls push_back(), which grows the vector when it is full, instead of performing the unchecked placement used in release builds. Producing an ASan report would therefore require altering Blink's ASan-specific implementation and would not reproduce the shipped vulnerable operation. No ASan trace is available for the validated Linux x86-64 target for this reason.

For triage, the key diagnostic is the allocation stack for ReserveInitialCapacity(1) paired with the write stack at UncheckedAppend().

Impact

The vulnerability begins when Blink trusts the mutable V8 object after reserving native capacity. Its security impact is a V8 sandbox bypass: controlled writes reach native Blink and PartitionAlloc memory outside the V8 cage. The attacker must already have arbitrary read and write inside the V8 sandbox, and the bypass applies to supported 64-bit V8-sandbox configurations. The report does not describe impact on targets outside that precondition.

Fix

The code-level problem it identifies is the combination of a one-time ReserveInitialCapacity() with a loop that re-reads the mutable V8 length and appends with UncheckedAppend(); the report does not state which of these was changed.

  • Other IDL entry points that use the generic record<K,V> conversion. A positive result is the same trace shape: a small initial keys length and capacity, a larger dynamic length after a callback, and appends at positions beyond capacity.
  • Other callback-capable operations inside the loop, such as descriptor reads or key and value conversions, used to enlarge the copied keys array. A positive result is a changed native entry in an adjacent object or a crash after the first out-of-bounds append.
  • Non-ASan builds on other 64-bit sandbox configurations. A positive result is a renderer crash or hang after the first append beyond capacity, or the JSON result with "ok": true and changed adjacent URLSearchParams entries.
  • Different heap grooming around one-pair URLSearchParams vectors. A positive result is a writeBack object showing a JavaScript-driven native slot update through a corrupted adjacent vector.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 24 min read.

What happened, in plain words

A web browser is a program that turns files written by web developers into pages you can see and click. Chrome is one such browser, and the part of Chrome that draws pages and runs the scripts inside them is called Blink. Blink is written in C++, a programming language that gives programs direct control over the computer's memory. Web pages, however, are written in JavaScript, a much safer language that normally cannot touch memory directly. So Blink has to translate between the two worlds all the time: it takes a value that exists in JavaScript and turns it into a matching value in C++.

One of those translations is the subject of this report. It handles a JavaScript object that is used like a dictionary: a list of keys, each with a value. For example, a page might hand Blink an object like { "a": "1", "b": "2" }, and Blink turns it into a list of key/value pairs in C++. The translation first counts how many keys there are, sets aside exactly that much room in memory, and then walks through the keys one by one, copying each pair into the reserved space.

The bug is a mismatch between those two moments. The room is set aside once, based on the count at that instant. But the loop that copies the pairs asks for the count again on every pass, and it writes each pair without checking whether there is still room. If the count grows while the loop is running, the loop keeps writing past the end of the reserved space, into memory that belongs to something else. That kind of mistake is called a buffer overflow, or more precisely here an out-of-bounds write.

For the count to grow mid-loop, the attacker needs a way to run JavaScript during the loop, and they need the ability to reach into a protected area of memory called the V8 sandbox. The report is explicit that this second ability is a precondition: the attacker is assumed to already have it. What the report demonstrates is that this precondition can be turned into something worse, a write into memory outside that sandbox. That is why the bug is classified as a V8 sandbox bypass.

The report was filed through Chrome's bug bounty programme, the scheme that pays people for finding and reporting security problems. It was found by XBOW and triaged by Andrés Luksenberg, and it was rated medium severity with a bounty of 1000.00 USD. It was disclosed on 2026-08-25.

Context

What Blink and Web IDL are

Blink is Chromium's rendering engine. Chromium is the open-source project that Chrome is built from, so when this report says "Chromium" it means the same code that ships inside Chrome. Rendering engine means the part that reads a page's instructions and produces what you see.

Web IDL is a description language. It is used to write down, in a formal way, which JavaScript features a browser exposes to web pages and what types those features accept. From those descriptions, tools generate C++ code called bindings, whose job is to take a JavaScript value and convert it into the C++ type the browser's internals expect. Think of IDL as a menu and the bindings as the kitchen staff who turn an order written in the menu's vocabulary into actual ingredients.

One of the generic conversions handles record<K,V>. In IDL, record<K,V> means "an object treated as a dictionary of key/value pairs", where K is the type of the keys and V is the type of the values. The conversion lives in NativeValueTraits<IDLRecord<K,V>>::NativeValue() in third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h. The long path is just the file's address inside the Chromium source tree; native_value_traits_impl.h is a header file, a file of shared C++ code that other files include.

What the conversion does

The conversion takes the property names of the input object as a V8 array. V8 is the JavaScript engine inside Chrome: the program that actually runs JavaScript. A V8 array is the JavaScript engine's own representation of a list. The conversion then reserves native capacity equal to that array's length. Native here means "in C++ memory", as opposed to inside V8. Reserving capacity means asking the memory allocator for a block big enough to hold that many items, so the code does not have to ask again for each item.

After that it loops over the array, converting each key and each value, and appending the resulting pair to a native Vector. A Vector is C++'s name for a growable list, similar to a JavaScript array. Appending means adding an item at the end.

The bug is that the reservation happens once, while the length is re-read on every iteration, and the append is unchecked. Unchecked means the append does not verify that there is room left; it simply writes at the next position. The code trusts that the earlier reservation was enough.

The public entry point

A public entry point is a feature that ordinary web pages can call. Here it is the URLSearchParams record overload, declared in third_party/blink/renderer/core/url/url_search_params.idl. URLSearchParams is the browser feature that handles the query string of a URL, the part after the ? that carries settings such as search terms. It can be built from a plain object, and when it is, the generic record conversion runs and produces a native vector of pair<String, String>, that is, a list of pairs where both the key and the value are text strings.

Setup

The attacker precondition

The report assumes an attacker who already has arbitrary read and write inside the V8 sandbox. Two ideas need unpacking.

A sandbox, in software, is a restricted area. V8 keeps the data belonging to JavaScript inside its own region of memory, the V8 sandbox, so that a bug in JavaScript code cannot easily reach the rest of the browser. Arbitrary read and write means the attacker can read and change any memory inside that region, at will. This is a serious position to be in, but it is still contained: the whole point of the sandbox is that being inside it should not let you reach outside it.

That precondition is supplied in the proof of concept by V8's official sandbox-testing API. An API, short for application programming interface, is a set of functions one program offers to another; here it is a set of functions V8 offers to test code. The report points to V8's src/sandbox/README.md, a documentation file, which describes this API as a way to emulate common sandbox memory-corruption primitives. Emulate means to imitate: the API lets a test pretend it has already corrupted sandbox memory, so that the code that would follow such a corruption can be tested in isolation. A primitive, in security writing, is a small basic capability that larger attacks are built from.

The Sandbox object used by the PoC is not the vulnerability and is not available in production builds. A PoC, or proof of concept, is a small program written to demonstrate that a bug is real. Production builds are the Chrome versions real users run; the testing API is not included in them, so a real attacker could not simply call it. The report is using it as a stand-in for the precondition, not claiming it is the bug.

Which systems are affected

The capacity violation itself is generic Blink C++ with no operating-system or architecture guard, so it is not Linux-specific. An operating system is the main software of a computer, such as Windows, macOS or Linux; architecture means the design of the processor, such as 32-bit or 64-bit. A guard is a conditional in the code that switches behaviour for a particular platform. There is none here, so the flawed logic exists on every platform Blink runs on.

The PoC was validated on Linux x86-64. x86-64 is the common 64-bit processor design used in most desktop and laptop computers. Validated means the authors ran it and saw the expected result. Its classification as a V8 sandbox bypass applies to supported 64-bit V8-sandbox configurations, since V8's sandbox is available only in 64-bit configurations. In short: the coding mistake is everywhere, but the escalation past the sandbox only makes sense where the sandbox exists, and it exists only on 64-bit setups.

The heap-layout assumptions of the PoC were not tested on other targets. Heap layout is explained below; for now, it means the arrangement of memory blocks, and the PoC was written expecting a particular arrangement.

Versions and identifiers

Software changes constantly, so reports pin down exactly which version they looked at. A revision is a numbered snapshot in the project's source-code history. A build ID is a label attached to one compiled binary.

Item Value
Validated Chrome configuration Stable 150.0.7871.128, Linux x86-64
Code-level scope Generic Blink record conversion on all Blink targets; sandbox-bypass impact on supported 64-bit sandbox configurations
Chromium revision [redacted]
V8 revision [redacted]
Chrome GNU build ID [redacted]
OS used for validation Ubuntu 24.04 x86-64
Instrumented build API-enabled Chromium 151.0.7882.0 at revision [redacted]

Stable means the ordinary release channel that most users have. Ubuntu 24.04 is a particular version of the Linux operating system. Instrumented means the build had extra logging added so the researchers could watch what the code was doing.

Finding it

The vulnerable code

The relevant sequence in NativeValue() is:

C++
v8::Local<v8::Array> keys;
v8_object->GetOwnPropertyNames(...).ToLocal(&keys);

ImplType result;
result.ReserveInitialCapacity(keys->Length());

for (uint32_t i = 0; i < keys->Length(); ++i) {
  // GetOwnPropertyDescriptor(), property reads, and K/V conversions can call JS.
  ...
  result.UncheckedAppend(
      std::make_pair(std::move(typed_key), std::move(typed_value)));
}

Line by line, in plain words:

  1. v8::Local<v8::Array> keys; declares a variable called keys that will hold a V8 array. v8::Local is V8's way of saying "a handle to an object that lives inside the JavaScript engine".
  2. v8_object->GetOwnPropertyNames(...).ToLocal(&keys); asks the input object for the names of its own properties and stores them in keys. The ... stands for arguments the report does not show. This is the list of keys the conversion will walk through.
  3. ImplType result; declares the native list that will hold the converted pairs.
  4. result.ReserveInitialCapacity(keys->Length()); sets aside room for exactly as many pairs as there are keys right now. This is the one and only reservation.
  5. for (uint32_t i = 0; i < keys->Length(); ++i) { starts the loop. uint32_t is an unsigned 32-bit integer, a whole number that cannot be negative. The important part is the condition: i < keys->Length() asks for the length again on every pass, not once.
  6. The comment // GetOwnPropertyDescriptor(), property reads, and K/V conversions can call JS. is the heart of the matter. It warns that several operations inside the loop can run JavaScript. GetOwnPropertyDescriptor() is the operation that fetches the details of one property; property reads fetch the value; K/V conversions turn the key and the value into their C++ forms. Any of these can call back into JavaScript, and JavaScript can do anything a page can do, including changing objects.
  7. result.UncheckedAppend(std::make_pair(std::move(typed_key), std::move(typed_value))); adds the converted pair to the native list. std::make_pair builds a pair from the two values, and std::move hands them over without copying. UncheckedAppend writes at the next position without checking capacity.

The capacity is reserved from keys->Length() once. The loop condition then calls keys->Length() again on every iteration, and each iteration appends with UncheckedAppend(), which does not grow the vector when it is full.

Why the callbacks matter

GetOwnPropertyDescriptor(), reads from the descriptor and the input object, and the key and value conversions are all callback-capable: they can run JavaScript. A callback is simply code that is handed to another piece of code to be run later, and here it means the browser pauses its C++ work and runs some JavaScript supplied by the page.

The copied keys array is not directly exposed to the page, but it lives inside the V8 sandbox. Not exposed means the page has no ordinary way to reach that array; it is an internal copy. But it is still stored in the memory region the sandbox covers. An attacker with arbitrary read and write inside that sandbox can therefore change the array's elements and its length during one of those callbacks. The loop then observes a larger length while the native vector still has the original capacity, and the appends run past the end of the allocation into PartitionAlloc memory.

PartitionAlloc is Chrome's own memory allocator, the component that hands out blocks of memory to the rest of the browser and keeps track of which blocks are in use. An allocation is one such block. Writing past the end of a block means writing into whatever the allocator placed next door, which may be another object the browser relies on.

Exploitation

The five steps

The PoC uses the public URLSearchParams record overload. The steps are:

  1. A Proxy's ownKeys trap returns one key, so Blink reserves one pair<String, String>.
  2. During the first get callback, the PoC uses V8's official sandbox-testing API to locate Blink's copied JSArray and replace its elements and length with a prepared 256-key array.
  3. The native loop observes the new length, while the native Vector still has capacity one.
  4. Up to 96 distinct pairs are written through UncheckedAppend() into and beyond that one-element allocation.
  5. The PoC grooms adjacent one-pair URLSearchParams vectors and checks for changed native entries. If it survives the overwrite, it also performs a JavaScript method call that writes back through a corrupted adjacent native vector.

A Proxy is a JavaScript feature that lets one object stand in for another and intercept operations on it. A trap is the function that handles one such interception. ownKeys is the trap that answers the question "what are your property names?", and get is the trap that answers "what is the value of this property?". So the PoC hands Blink a stand-in object that reports a single key when asked for its names, and then behaves differently when the value is fetched.

Step 1: reserve capacity one

The Proxy's ownKeys trap returns a single key. GetOwnPropertyNames() produces a one-element keys array, and ReserveInitialCapacity(1) allocates room for exactly one pair.

Step 2: rewrite the copied array during the callback

During the first get callback, JavaScript runs while the native loop is mid-iteration. The PoC uses the sandbox-testing API to find Blink's copied JSArray inside the sandbox and replaces its elements and length with a prepared 256-key array. This is the moment the precondition is used: the test API stands in for an attacker who can already reach into sandbox memory.

Step 3: the loop sees the new length

On the next evaluation of the loop condition, keys->Length() returns 256. The native vector still has capacity one. Nothing has told the vector that more room is needed, because the reservation already happened and the append does not check.

Step 4: unchecked appends past the allocation

Each iteration appends with UncheckedAppend(). Up to 96 distinct pairs are written into and beyond the one-element allocation. The report says up to 96 distinct pairs are written into and beyond the one-element allocation.

Step 5: detect and extend the corruption

The PoC grooms adjacent one-pair URLSearchParams vectors and checks whether their native entries changed. Grooming, in exploit writing, means deliberately arranging memory so that a chosen object ends up next to the one being overflowed. Here the PoC creates many small URLSearchParams objects, each with a one-pair vector, hoping some of them land right after the overflowing allocation. If one of their entries changes, the overflow reached it. If it survives the overwrite, it performs a JavaScript method call that writes back through a corrupted adjacent native vector.

Instrumented trace

In the instrumented API-enabled Chromium 151.0.7882.0 build at revision [redacted], where the code remained vulnerable, the defining transition was:

Text
initial_keys=1 capacity=1 size=0
after value callback: dynamic_keys=256
append: pos=0 capacity=1
append: pos=1 capacity=1   # first native OOB pair
append: pos=2 capacity=1

Reading the trace line by line:

  1. initial_keys=1 capacity=1 size=0 records the starting state: one key was seen, room for one pair was reserved, and nothing has been written yet.
  2. after value callback: dynamic_keys=256 shows the effect of the callback: the key array now reports 256 keys.
  3. append: pos=0 capacity=1 is the first write, at position zero, which is inside the reserved slot.
  4. append: pos=1 capacity=1 # first native OOB pair is the first write outside the allocation. OOB stands for out of bounds. The capacity is still one, so position one is already past the end.
  5. append: pos=2 capacity=1 shows the overflow continuing, with the capacity never updated.

Building and running the PoC

The attachment is poc.html. The focused testcase intentionally uses V8's testing API to provide the documented compromised-sandbox precondition while isolating the Blink bug. Isolating means keeping everything else out of the picture so that a failure can only be blamed on the Blink code under test.

Build at the affected revision with the API enabled. This must be a non-ASan build, because Blink changes the behaviour of UncheckedAppend() in its Linux x86-64 ASan configuration (see Root cause). ASan, short for AddressSanitizer, is a tool built into a special version of a program that watches memory accesses and reports mistakes such as out-of-bounds writes. It is used during development, not in the version users run.

Bash
gn gen out/idlrecord-poc --args='is_asan=false is_debug=false dcheck_always_on=false symbol_level=1 blink_symbol_level=1 v8_symbol_level=1 v8_enable_sandbox=true v8_enable_memory_corruption_api=true'
autoninja -C out/idlrecord-poc chrome

Line by line:

  1. gn gen out/idlrecord-poc --args='...' runs GN, Chromium's build configuration tool, to prepare a build directory called out/idlrecord-poc. Everything inside the quotes sets the options for this build.
  2. is_asan=false turns AddressSanitizer off, for the reason just given.
  3. is_debug=false builds an optimised release-style binary rather than a slow debug one.
  4. dcheck_always_on=false turns off debug assertions, internal consistency checks that would otherwise stop the program.
  5. symbol_level=1, blink_symbol_level=1 and v8_symbol_level=1 keep some debugging information in the binary so stack traces are readable, without the bulk of full symbols.
  6. v8_enable_sandbox=true builds V8 with its sandbox enabled, which is the configuration the bug is about.
  7. v8_enable_memory_corruption_api=true includes the testing API that emulates the compromised-sandbox precondition.
  8. autoninja -C out/idlrecord-poc chrome runs Ninja, the program that actually compiles the code, in that directory, with chrome as the target to build.

Then serve the directory and launch the build:

Bash
cd idlrecord
python3 -m http.server 8000

/path/to/chromium/src/out/idlrecord-poc/chrome \
  --user-data-dir=/tmp/chrome-idlrecord-poc \
  --js-flags=--sandbox-testing \
  http://[redacted]:8000/poc.html

Line by line:

  1. cd idlrecord changes into the directory holding the PoC files.
  2. python3 -m http.server 8000 starts a tiny web server using Python, listening on port 8000. A web server is a program that hands files to a browser when asked. Port 8000 is just a numbered door on the computer.
  3. /path/to/chromium/src/out/idlrecord-poc/chrome is the path to the browser binary just built; /path/to/chromium stands for wherever the source tree lives on the tester's machine.
  4. --user-data-dir=/tmp/chrome-idlrecord-poc gives this test browser its own profile directory, so it does not mix with the tester's normal browsing data.
  5. --js-flags=--sandbox-testing passes a flag to V8 that switches on the sandbox-testing API.
  6. http://[redacted]:8000/poc.html is the page to open. [redacted] is the address a computer uses to refer to itself, so this points at the little server started a moment ago.

Expected behaviour is a renderer crash or hang after the first append beyond capacity, or a JSON result with "ok": true, changed adjacent URLSearchParams entries, and a writeBack object showing a JavaScript-driven native slot update. A renderer is the browser process that turns a page into what you see; it is deliberately kept separate from the rest of the browser so that a crash there does not take everything down. A hang is when a program stops responding without exiting. JSON is a plain-text format for structured data, and "ok": true is a field in the PoC's own output saying the test reached its goal. The exact outcome depends on the adjacent PartitionAlloc layout, that is, on what the allocator happened to place next to the overflowing block.

Root cause

The mistake is that Blink trusts a mutable V8 object after reserving native capacity. Mutable means it can change; the object is not frozen. The reservation is derived from the array length at one point in time, but the loop re-reads that length on every iteration and appends without a capacity check. Any callback-capable operation inside the loop, such as GetOwnPropertyDescriptor(), a property read, or a key or value conversion, gives JavaScript a chance to run, and an attacker with sandbox read/write can use that chance to enlarge the copied keys array. The result is an out-of-bounds write in PartitionAlloc memory.

On the validated x86-64 build the pair is 16 bytes, and its size is target-dependent. A byte is the basic unit of computer memory. The first invalid write is deterministic at the source level: after capacity one is reserved, result.UncheckedAppend() at position one writes a second pair<String, String> immediately beyond the allocation. Deterministic at the source level means the code, read on its own, guarantees this write happens; it does not depend on luck. Subsequent positions extend the overwrite. The final fault location is heap-layout-dependent, because the unchecked loop can corrupt several adjacent native objects before one is dereferenced. The heap is the pool of memory the allocator hands out at runtime; dereferenced means the program follows a pointer to read or write the object it points at, which is when a corrupted object finally causes a visible failure.

Why ASan does not catch it

ASan does not catch this in Chrome's standard configuration. container_annotations.h defines ANNOTATE_CONTIGUOUS_CONTAINER for Linux/ChromeOS x86-64 ASan builds. A macro is a named piece of code that the compiler substitutes wherever the name appears, so this macro switches on a special behaviour in those builds. Under that macro, the M150 Vector::UncheckedAppend() implementation calls push_back(), which grows the vector when it is full, instead of performing the unchecked placement used in release builds. push_back() is the checked append: it makes room first. So in an ASan build the very operation that overflows in the shipped browser quietly grows the list instead, and the bug cannot show up. Producing an ASan report would therefore require altering Blink's ASan-specific implementation and would not reproduce the shipped vulnerable operation. No ASan trace is available for the validated Linux x86-64 target for this reason.

For triage, the key diagnostic is the allocation stack for ReserveInitialCapacity(1) paired with the write stack at UncheckedAppend(). Triage is the process of deciding whether a report is real and how serious it is. A stack, or stack trace, is the list of function calls that led to a point in the program. The advice is: when investigating, look for the trace showing the one-slot reservation together with the trace showing the write that went past it. Those two together are the signature of this bug.

Impact

The vulnerability begins when Blink trusts the mutable V8 object after reserving native capacity. Its security impact is a V8 sandbox bypass: controlled writes reach native Blink and PartitionAlloc memory outside the V8 cage. The cage is another word for the sandbox region; escaping it is the whole point of a bypass. The attacker must already have arbitrary read and write inside the V8 sandbox, and the bypass applies to supported 64-bit V8-sandbox configurations. The report does not describe impact on targets outside that precondition.

In everyday terms: the sandbox is meant to keep a JavaScript bug contained, and this bug lets one piece of Blink write outside that boundary.

Fix

These are follow-up experiments the report suggests, each with a clear sign of success.

  • Other IDL entry points that use the generic record<K,V> conversion. A positive result is the same trace shape: a small initial keys length and capacity, a larger dynamic length after a callback, and appends at positions beyond capacity. In plain words: look for other browser features that accept a dictionary from JavaScript, and see whether they show the same one-slot reservation followed by writes past it.
  • Other callback-capable operations inside the loop, such as descriptor reads or key and value conversions, used to enlarge the copied keys array. A positive result is a changed native entry in an adjacent object or a crash after the first out-of-bounds append. In plain words: try triggering the change at a different point in the loop, not only in the get callback.
  • Non-ASan builds on other 64-bit sandbox configurations. A positive result is a renderer crash or hang after the first append beyond capacity, or the JSON result with "ok": true and changed adjacent URLSearchParams entries. In plain words: repeat the test on other 64-bit platforms, using a build without AddressSanitizer.
  • Different heap grooming around one-pair URLSearchParams vectors. A positive result is a writeBack object showing a JavaScript-driven native slot update through a corrupted adjacent vector. In plain words: arrange memory differently and see whether the overflow still lands on something useful.

Glossary

  • API: a set of functions one program offers to another so they can work together.
  • ASan (AddressSanitizer): a development tool that watches memory accesses and reports mistakes such as out-of-bounds writes.
  • Allocation: one block of memory handed out by the allocator.
  • Append: to add an item at the end of a list.
  • Architecture: the design of a computer's processor, such as 32-bit or 64-bit.
  • Arbitrary read and write: the ability to read and change any memory in a given region at will.
  • Binding: generated C++ code that converts between JavaScript values and the browser's internal C++ types.
  • Blink: Chromium's rendering engine, the part that draws pages and runs their scripts.
  • Buffer overflow: writing more data into a memory block than it was sized for, so data spills into neighbouring memory.
  • Build ID: a label attached to one compiled binary.
  • Bypass: getting past a protection that is supposed to stop you.
  • C++: a programming language that gives programs direct control over memory.
  • Callback: code handed to another piece of code to be run later; here, JavaScript that runs while C++ is mid-task.
  • Callback-capable: an operation that can run JavaScript as part of doing its work.
  • Capacity: how many items a reserved block of memory can hold.
  • Chromium: the open-source project that Chrome is built from.
  • Crash: a program stopping unexpectedly because of an error.
  • Debug assertion: an internal consistency check that stops the program when something is wrong, usually only in development builds.
  • Dereference: to follow a pointer and read or write the object it points at.
  • Deterministic: guaranteed to happen the same way every time, not dependent on luck.
  • Dictionary: a collection of keys, each with a value.
  • Emulate: to imitate something, usually so it can be tested.
  • Entry point: a feature that ordinary web pages can call.
  • Grooming: deliberately arranging memory so that chosen objects end up next to each other.
  • Guard: a conditional in code that switches behaviour for a particular platform.
  • Hang: a program that stops responding without exiting.
  • Heap: the pool of memory the allocator hands out while a program runs.
  • Heap layout: the arrangement of allocated blocks in memory at a given moment.
  • Header file: a file of shared C++ code that other files include.
  • IDL (Web IDL): a description language for which JavaScript features a browser exposes and what types they accept.
  • Instrumented build: a build with extra logging added so researchers can watch what the code does.
  • JavaScript: the programming language web pages use, which normally cannot touch memory directly.
  • JSON: a plain-text format for structured data.
  • Key/value pair: one key together with its value, such as a name and a number.
  • Macro: a named piece of code the compiler substitutes wherever the name appears.
  • Mutable: able to change.
  • Native: in C++ memory, as opposed to inside the JavaScript engine.
  • Non-ASan build: a build without AddressSanitizer, closer to what users run.
  • OOB (out of bounds): outside the memory block that was allocated.
  • Operating system: the main software of a computer, such as Windows, macOS or Linux.
  • PartitionAlloc: Chrome's own memory allocator.
  • PoC (proof of concept): a small program written to demonstrate that a bug is real.
  • Port: a numbered door on a computer through which network services listen.
  • Precondition: something that must already be true before an attack can start.
  • Primitive: a small basic capability that larger attacks are built from.
  • Production build: the version of a program that real users run.
  • Proxy: a JavaScript feature that lets one object stand in for another and intercept operations on it.
  • push_back(): the checked append that makes room first when the list is full.
  • Record: in IDL, an object treated as a dictionary of key/value pairs.
  • Renderer: the browser process that turns a page into what you see, kept separate from the rest of the browser.
  • Reserve capacity: to ask the allocator for room for a given number of items in advance.
  • Revision: a numbered snapshot in a project's source-code history.
  • Sandbox: a restricted memory area that keeps one part of a program from reaching the rest.
  • Severity: a rating of how serious a security problem is.
  • Stable: the ordinary release channel most users have.
  • Stack (stack trace): the list of function calls that led to a point in the program.
  • Trap: in a JavaScript Proxy, the function that handles one intercepted operation.
  • Triage: the process of deciding whether a report is real and how serious it is.
  • Unchecked: done without verifying that there is room or that the operation is safe.
  • V8: the JavaScript engine inside Chrome.
  • V8 sandbox: the restricted memory region where V8 keeps JavaScript data.
  • Vector: C++'s name for a growable list.
  • Web server: a program that hands files to a browser when asked.
  • x86-64: the common 64-bit processor design used in most desktop and laptop computers.

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.