Type Confusion in V8 (CVE-2025-12428)
A type confusion in V8's inline cache occurs when a WebAssembly object with a custom descriptor sits in the prototype chain, causing the prototype validity cell to be skipped. An attacker could exploit this to cause out-of-bounds access and potentially execute arbitrary code.
Originally disclosed on Chrome VRP
- Fix shipped in 33 days
Vulnerability details
When loading properties from prototype, inline cache caches the prototype property holder and accesses its properties via optimize handlers. In order to avoid map changes in the prototype which may invalidate assumptions in the optimized handlers, inline cache also stores the PrototypeChainValidityCell, which gets invalidated when a map change happens in the prototype chain. The GetOrCreatePrototypeChainValidityCell function calls TryGetValidityCellHolderMap, which returns Map::kNoValidityCellSentinel when the prototype is not a JSObject.
bool Map::TryGetValidityCellHolderMap(
Tagged<Map> map, Isolate* isolate,
Tagged<Map>* out_validity_cell_holder_map) {
...
if (!IsJSObjectThatCanBeTrackedAsPrototype(maybe_prototype)) { //<--- returns false if prototype is not a JSObject
return false;
}
*out_validity_cell_holder_map = Cast<JSObject>(maybe_prototype)->map();
return true;
}
...
Handle<UnionOf<Smi, Cell>> Map::GetOrCreatePrototypeChainValidityCell(
DirectHandle<Map> map, Isolate* isolate,
DirectHandle<PrototypeInfo>* out_prototype_info) {
DirectHandle<Map> validity_cell_holder_map;
{
Tagged<Map> holder_map;
if (!TryGetValidityCellHolderMap(*map, isolate, &holder_map)) {
// Prototype value is not a JSObject.
return handle(Map::kNoValidityCellSentinel, isolate); //<------ returns Map::kNoValidityCellSentinel
}
...
This becomes problematic with the custom descriptors proposal in WebAssembly, which allows Wasm objects to have prototypes. Consider an object with the following prototype chain:
obj ({}) -> wasm_obj -> obj_1 ({a : 1})
When accessing the property a, the prototype chain will be followed, which then fetches the property a from obj_1. The prototype obj_1 is then cached in the inline cache handler, but because wasm_obj is not a JSObject, the validity_cell in the handler is going to be Map::kNoValidityCellSentinel, allowing the prototype validity cell check to be bypassed:
TNode<MaybeObject> AccessorAssembler::CheckPrototypeValidityCell(
TNode<Object> maybe_validity_cell, Label* miss) {
TVARIABLE(MaybeObject, var_cell_value,
SmiConstant(Map::kNoValidityCellSentinel));
Label done(this);
GotoIf(TaggedEqual(maybe_validity_cell,
SmiConstant(Map::kNoValidityCellSentinel)),
&done);
...
In particular, any change in the map of obj_1 will not invalidate the inline cache handler, causing type confusion.
As there is currently an origin trial for the Webassembly custom descriptors, anyone can register for the origin trial and host a website that can trigger this bug.
Thank you very much for your help and please let me know if there is anything I can help.
REPRODUCTION CASE
To test locally, run the poc.js with the --experimental-wasm-custom-descriptors flag and the --allow-natives-syntax flag to print out debug message. The flag --experimental-wasm-custom-descriptors is only needed for local testing to emulate the origin trial. It should cause an OOB access which then loads an object from outside of the boundary of proto (A heap number map in my case).
VERSION v8 commit d32e674 OS: Ubuntu 24.04 LTS
CREDIT INFORMATION Externally reported security bugs may appear in Chrome release notes. If this bug is included, how would you like to be credited?
Reporter credit: Man Yue Mo of GitHub Security Lab
Context
This report concerns a type confusion bug in V8, the JavaScript and WebAssembly engine used by Google Chrome. The affected component is V8's inline cache machinery, specifically the code that caches property lookups performed on the prototype chain. The bug was reported through the Chrome VRP by Man Yue Mo of GitHub Security Lab, rated high severity, and disclosed on 2025-10-28. The platform records a bounty of 50,000 USD. The report itself is an advisory-style write-up: it explains the flaw, gives a proof of concept, and states the version tested. It does not include a full exploit chain, and it does not describe a fix.
The feature that makes the bug reachable is the WebAssembly custom descriptors proposal. That proposal allows WebAssembly objects to have prototypes, which means a WebAssembly object can sit inside a JavaScript prototype chain. At the time of the report there was an origin trial for the proposal, so a website could register for the trial and use the feature in Chrome.
Setup
The report gives the following conditions for local testing:
- A V8 build at commit
d32e674. - The operating system used was Ubuntu 24.04 LTS.
- Run
poc.jswith the--experimental-wasm-custom-descriptorsflag. The report says this flag is only needed for local testing, to emulate the origin trial. - Also run with the
--allow-natives-syntaxflag, which the report says is used to print out a debug message.
No accounts, roles or remote services are involved. The precondition for an attacker in the real world is that the WebAssembly custom descriptors origin trial is active, which the report says anyone can arrange by registering for the trial and hosting a website that triggers the bug.
Finding it
The researcher starts from how V8 handles property loads that are served from a prototype. When loading properties from a prototype, the inline cache caches the prototype property holder and accesses its properties through optimised handlers. To avoid map changes in the prototype invalidating assumptions baked into those optimised handlers, the inline cache also stores a PrototypeChainValidityCell. That cell is invalidated when a map change happens in the prototype chain.
The problem is in how the validity cell is created. GetOrCreatePrototypeChainValidityCell calls TryGetValidityCellHolderMap, and that function returns Map::kNoValidityCellSentinel when the prototype is not a JSObject. The report quotes the relevant code:
bool Map::TryGetValidityCellHolderMap(
Tagged<Map> map, Isolate* isolate,
Tagged<Map>* out_validity_cell_holder_map) {
...
if (!IsJSObjectThatCanBeTrackedAsPrototype(maybe_prototype)) { //<--- returns false if prototype is not a JSObject
return false;
}
*out_validity_cell_holder_map = Cast<JSObject>(maybe_prototype)->map();
return true;
}
...
Handle<UnionOf<Smi, Cell>> Map::GetOrCreatePrototypeChainValidityCell(
DirectHandle<Map> map, Isolate* isolate,
DirectHandle<PrototypeInfo>* out_prototype_info) {
DirectHandle<Map> validity_cell_holder_map;
{
Tagged<Map> holder_map;
if (!TryGetValidityCellHolderMap(*map, isolate, &holder_map)) {
// Prototype value is not a JSObject.
return handle(Map::kNoValidityCellSentinel, isolate); //<------ returns Map::kNoValidityCellSentinel
}
...
With the custom descriptors proposal, a WebAssembly object can be a prototype and is not a JSObject. The researcher considers this prototype chain:
obj ({}) -> wasm_obj -> obj_1 ({a : 1})
When the property a is accessed, the prototype chain is followed and the property a is fetched from obj_1. The prototype obj_1 is then cached in the inline cache handler. But because wasm_obj is not a JSObject, the validity_cell in the handler becomes Map::kNoValidityCellSentinel. That sentinel causes the prototype validity cell check to be bypassed, as the quoted check shows:
TNode<MaybeObject> AccessorAssembler::CheckPrototypeValidityCell(
TNode<Object> maybe_validity_cell, Label* miss) {
TVARIABLE(MaybeObject, var_cell_value,
SmiConstant(Map::kNoValidityCellSentinel));
Label done(this);
GotoIf(TaggedEqual(maybe_validity_cell,
SmiConstant(Map::kNoValidityCellSentinel)),
&done);
...
The consequence the researcher draws is that any change in the map of obj_1 will not invalidate the inline cache handler, which causes type confusion. In other words, the optimised handler keeps assuming the shape of obj_1 that it saw when the lookup was cached, even after that shape changes.
Exploitation
The report does not walk through a full exploitation sequence. It gives a reproduction case and describes the expected outcome. The steps it does give are:
Step 1: Build the environment
Use V8 at commit d32e674 on Ubuntu 24.04 LTS. The report does not describe how the build was produced.
Step 2: Run the proof of concept
The report says to run poc.js with the following flags:
--experimental-wasm-custom-descriptors enables the WebAssembly custom descriptors feature locally, emulating the origin trial. --allow-natives-syntax lets the script use V8 native syntax to print a debug message. The report does not include the contents of poc.js, so the exact script cannot be reproduced from this text.
Step 3: Observe the result
The report states the run should cause an out-of-bounds access which then loads an object from outside the boundary of proto. In the researcher's case the object loaded was a heap number map.
Root cause
The root cause is the sentinel handling in the prototype validity cell logic. When a prototype in the chain is not a JSObject, TryGetValidityCellHolderMap fails and GetOrCreatePrototypeChainValidityCell returns Map::kNoValidityCellSentinel. The inline cache stores that sentinel in the handler. Later, CheckPrototypeValidityCell treats the sentinel as a reason to skip the check entirely and jump to done. So the handler is never invalidated when the map of the cached property holder changes.
Normally the validity cell exists precisely to catch map changes in the prototype chain and force the optimised handler to miss. With the sentinel in place, that defence is disabled for chains that pass through a non-JSObject prototype. The WebAssembly custom descriptors proposal makes such chains possible, because a WebAssembly object can be a prototype and is not a JSObject. The report presents this as the mechanism; it does not discuss whether any other check would catch the stale assumption.
Impact
The report describes the immediate effect as type confusion, and the reproduction as an out-of-bounds access that loads an object from outside the boundary of proto, in the researcher's case a heap number map. The report does not demonstrate code execution, sandbox escape or any other outcome beyond that out-of-bounds access.
The condition for an attacker is that the WebAssembly custom descriptors feature is available. The report notes there is an origin trial for the proposal, and that anyone can register for the trial and host a website that triggers the bug.
Fix
It is a vulnerability report with a reproduction case. What should change, based on the reasoning in the report, is the handling of the no-validity-cell sentinel: a chain that passes through a non-JSObject prototype should not end up with a handler whose validity check is skipped, or the sentinel path should not be reachable for chains that can later change.
Variants to test
- Other non-
JSObjectprototypes in a chain. Build a chain where the intermediate prototype is any object type thatIsJSObjectThatCanBeTrackedAsPrototyperejects, then change the map of the final property holder after the lookup is cached. A positive result is that the optimised handler still serves the old property layout, or that a debug build reports a map mismatch. - Different property kinds on the cached holder. Repeat the cached lookup against data properties, accessors and elements on
obj_1, then mutate the holder's map. A positive result is a stale handler that returns a value inconsistent with the current shape. - Longer chains. Insert more than one non-
JSObjectprototype betweenobjand the holder. A positive result is the same bypass of the validity check, showing the sentinel propagates through the chain. - Other engines and other proposals that let non-standard objects act as prototypes. Check whether the same sentinel shortcut exists in the equivalent inline cache code. A positive result is a cached handler that survives a map change on the holder.
- Origin trial reachability. Confirm whether a page can use the feature without the local flag when the trial is enabled. A positive result is the reproduction working in a trial-enabled build with no command line flags.
Each of these should be run only in a controlled environment, and the report gives no evidence that any of them was tested.
What happened, in plain words
A security researcher found a bug in the part of Google Chrome that runs JavaScript and WebAssembly, the two programming languages that web pages use to make things happen in your browser. That part is called V8. The bug is a kind of mistake called a type confusion, which means the program ends up treating one kind of thing as if it were a different kind of thing. When that happens, the program can read or write memory it was never supposed to touch.
The bug lives in a speed trick that V8 uses. When a web page asks for a property of an object, for example person.name, V8 remembers where it found that property so that the next time it can skip the search. This memory is called an inline cache. To stay safe, V8 also keeps a little note, called a validity cell, that says "if the shape of the object changes, throw away what you remembered". The bug is that in one specific situation, V8 writes a special placeholder value into that note instead of a real note, and the placeholder makes V8 skip the safety check entirely. So V8 keeps using its old memory even after the object has changed shape, and that is the type confusion.
The situation that triggers it involves a feature called WebAssembly custom descriptors, which lets WebAssembly objects sit in the chain of objects that JavaScript searches when it looks up a property. At the time of the report this feature was in an origin trial, which is a way for websites to opt in to an unfinished browser feature early. The report says anyone can register for the trial and host a website that triggers the bug.
The report was filed through the Chrome VRP, Google's bug bounty programme for Chrome, by Man Yue Mo of GitHub Security Lab. It was rated high severity and disclosed on 2025-10-28. The platform records a bounty of 50,000 USD. The report explains the flaw, gives a proof of concept, and states the version tested. It does not include a full exploit chain, and it does not describe a fix.
The pieces you need to know
Before walking through the report, here are the ideas it leans on, explained from zero.
- Browser engine: the part of a browser that reads a web page's code and actually runs it. Chrome's engine for JavaScript and WebAssembly is V8.
- JavaScript: the programming language that web pages use for interactivity. When you click a button and something changes on the page, JavaScript is usually doing the work.
- WebAssembly: a second language that browsers can run, designed to be fast. Programmers often compile other languages into WebAssembly so they run in the browser.
- Object: in JavaScript, a bundle of named values.
{a: 1}is an object with one property,a, whose value is1. - Property lookup: when code asks for
obj.a, the engine has to finda. Ifobjdoes not have it, the engine looks atobj's prototype, then that prototype's prototype, and so on. This chain is the prototype chain. - Prototype: a kind of parent object. If a child object does not have a property, the engine asks the parent. This is how JavaScript shares behaviour between objects.
- Map (in V8): a hidden description of an object's shape, meaning which properties it has and where they sit in memory. When you add or remove a property, the object gets a new map. Do not confuse this with the
Mapdata structure you may know from other languages; here it means the shape descriptor. - Inline cache: a speed trick. The first time the engine looks up a property it does the full search, then it writes down the answer so the next lookup is fast. The written-down answer is only valid while the shapes involved stay the same.
- Validity cell: the little note attached to a cached lookup that says "this answer is still good". If the shape of something in the prototype chain changes, the note is invalidated and the cache is thrown away.
- Sentinel: a special marker value that stands for "nothing here" or "not applicable". The one in this report is called
Map::kNoValidityCellSentinel. - Type confusion: a bug where the program believes a value is of one type when it is really another. It can lead to reading memory as if it were a different kind of data, which is how memory corruption starts.
- Out-of-bounds access: reading or writing memory outside the area the program was supposed to use. It is a common stepping stone from a bug to a serious security problem.
- Origin trial: a Chrome mechanism that lets websites opt in to an experimental feature before it ships to everyone. A site registers, and Chrome enables the feature for that site.
- Commit: a specific saved version of a code repository.
d32e674identifies the exact V8 source the researcher tested. - Flag: a command-line switch that changes how a program behaves when you start it. The report uses two flags to turn on experimental behaviour and debugging output.
- Proof of concept (PoC): a small program that demonstrates a bug without necessarily being a full attack.
Context
This report concerns a type confusion bug in V8, the JavaScript and WebAssembly engine used by Google Chrome. The affected component is V8's inline cache machinery, specifically the code that caches property lookups performed on the prototype chain. The bug was reported through the Chrome VRP by Man Yue Mo of GitHub Security Lab, rated high severity, and disclosed on 2025-10-28. The report itself is an advisory-style write-up: it explains the flaw, gives a proof of concept, and states the version tested.
The feature that makes the bug reachable is the WebAssembly custom descriptors proposal. That proposal allows WebAssembly objects to have prototypes, which means a WebAssembly object can sit inside a JavaScript prototype chain. At the time of the report there was an origin trial for the proposal, so a website could register for the trial and use the feature in Chrome.
Why this matters for a beginner: normally a WebAssembly object and a JavaScript object are kept apart. The proposal deliberately lets them mix, because that is useful for programmers. But the mixing exposes an assumption in the caching code that was written when only JavaScript objects could appear in a prototype chain. The report is about what happens when that assumption is wrong.
Setup
The report gives the following conditions for local testing:
- A V8 build at commit
d32e674. - The operating system used was Ubuntu 24.04 LTS.
- Run
poc.jswith the--experimental-wasm-custom-descriptorsflag. The report says this flag is only needed for local testing, to emulate the origin trial. - Also run with the
--allow-natives-syntaxflag, which the report says is used to print out a debug message.
No accounts, roles or remote services are involved. The precondition for an attacker in the real world is that the WebAssembly custom descriptors origin trial is active, which the report says anyone can arrange by registering for the trial and hosting a website that triggers the bug.
A note on each setup item, in plain words:
- Commit
d32e674: source code changes over time. Pinning a commit means everyone testing the bug is looking at exactly the same code, so results can be compared. - Ubuntu 24.04 LTS: a common free operating system. The report names it because the researcher ran the test there; it is not part of the bug itself.
--experimental-wasm-custom-descriptors: turns on the WebAssembly custom descriptors feature in a local build. In the real world the origin trial does this for a website; locally you need the flag because your build is not enrolled in the trial.--allow-natives-syntax: lets a script call V8's internal debugging helpers. The report says it is used to print a debug message, which helps the researcher see what the engine is doing.
Finding it
The researcher starts from how V8 handles property loads that are served from a prototype. When loading properties from a prototype, the inline cache caches the prototype property holder and accesses its properties through optimised handlers. To avoid map changes in the prototype invalidating assumptions baked into those optimised handlers, the inline cache also stores a PrototypeChainValidityCell. That cell is invalidated when a map change happens in the prototype chain.
In everyday terms: imagine a librarian who, the first time you ask for a book, walks to the right shelf and notes the exact spot. The next time you ask, the librarian goes straight to that spot. To stay correct, the librarian also notes "if anyone rearranges this shelf, forget my note". The validity cell is that note. The optimised handler is the librarian going straight to the remembered spot.
The problem is in how the validity cell is created. GetOrCreatePrototypeChainValidityCell calls TryGetValidityCellHolderMap, and that function returns Map::kNoValidityCellSentinel when the prototype is not a JSObject. The report quotes the relevant code:
bool Map::TryGetValidityCellHolderMap(
Tagged<Map> map, Isolate* isolate,
Tagged<Map>* out_validity_cell_holder_map) {
...
if (!IsJSObjectThatCanBeTrackedAsPrototype(maybe_prototype)) { //<--- returns false if prototype is not a JSObject
return false;
}
*out_validity_cell_holder_map = Cast<JSObject>(maybe_prototype)->map();
return true;
}
...
Handle<UnionOf<Smi, Cell>> Map::GetOrCreatePrototypeChainValidityCell(
DirectHandle<Map> map, Isolate* isolate,
DirectHandle<PrototypeInfo>* out_prototype_info) {
DirectHandle<Map> validity_cell_holder_map;
{
Tagged<Map> holder_map;
if (!TryGetValidityCellHolderMap(*map, isolate, &holder_map)) {
// Prototype value is not a JSObject.
return handle(Map::kNoValidityCellSentinel, isolate); //<------ returns Map::kNoValidityCellSentinel
}
...
Line by line, in plain words:
bool Map::TryGetValidityCellHolderMap(...): this function tries to find the object whose shape the validity cell should watch. It returnstrueif it found one andfalseif it did not.Tagged<Map> map, Isolate* isolate, Tagged<Map>* out_validity_cell_holder_map: the inputs.mapis the shape being examined,isolateis V8's per-thread working state, andout_validity_cell_holder_mapis where the answer is written back.if (!IsJSObjectThatCanBeTrackedAsPrototype(maybe_prototype)): the key check. It asks whether the prototype is a JavaScript object that V8 knows how to track. If not, the!flips the answer and the branch is taken.return false;: the function gives up. The comment in the report says this happens when the prototype is not aJSObject.*out_validity_cell_holder_map = Cast<JSObject>(maybe_prototype)->map();: if the check passed, the prototype is cast to a JavaScript object and its shape is written out.return true;: success.Handle<UnionOf<Smi, Cell>> Map::GetOrCreatePrototypeChainValidityCell(...): the caller. It wants a validity cell for the given shape.if (!TryGetValidityCellHolderMap(*map, isolate, &holder_map)): it calls the helper above. If the helper failed, the branch is taken.return handle(Map::kNoValidityCellSentinel, isolate);: instead of a real validity cell, it returns the sentinel. The comment in the report marks this as the source of the problem.
So the sentinel is not an error code that stops everything. It is a value that flows onward into the cache, and later code treats it specially.
With the custom descriptors proposal, a WebAssembly object can be a prototype and is not a JSObject. The researcher considers this prototype chain:
obj ({}) -> wasm_obj -> obj_1 ({a : 1})
What this diagram means: obj is an empty JavaScript object. Its prototype is wasm_obj, a WebAssembly object. The prototype of wasm_obj is obj_1, a JavaScript object with a property a set to 1. When code asks obj.a, the engine checks obj (no a), then wasm_obj (no a), then obj_1 (found it).
When the property a is accessed, the prototype chain is followed and the property a is fetched from obj_1. The prototype obj_1 is then cached in the inline cache handler. But because wasm_obj is not a JSObject, the validity_cell in the handler becomes Map::kNoValidityCellSentinel. That sentinel causes the prototype validity cell check to be bypassed, as the quoted check shows:
TNode<MaybeObject> AccessorAssembler::CheckPrototypeValidityCell(
TNode<Object> maybe_validity_cell, Label* miss) {
TVARIABLE(MaybeObject, var_cell_value,
SmiConstant(Map::kNoValidityCellSentinel));
Label done(this);
GotoIf(TaggedEqual(maybe_validity_cell,
SmiConstant(Map::kNoValidityCellSentinel)),
&done);
...
Line by line:
TNode<MaybeObject> AccessorAssembler::CheckPrototypeValidityCell(...): this is the check that runs before the cached answer is used.TNodeis V8's way of representing a value while it is generating machine code.TNode<Object> maybe_validity_cell, Label* miss: the cell to check, and a label to jump to if the check fails. Jumping tomissmeans "the cache is stale, do the slow full lookup again".TVARIABLE(MaybeObject, var_cell_value, SmiConstant(Map::kNoValidityCellSentinel));: sets up a local variable initialised to the sentinel.Smiis a small integer in V8; the sentinel is represented as one.Label done(this);: creates a label calleddone, meaning "the check passed, carry on".GotoIf(TaggedEqual(maybe_validity_cell, SmiConstant(Map::kNoValidityCellSentinel)), &done);: if the cell is the sentinel, jump straight todone. This is the bypass. The sentinel is treated as "nothing to check", so the stale cache is trusted.
The consequence the researcher draws is that any change in the map of obj_1 will not invalidate the inline cache handler, which causes type confusion. In other words, the optimised handler keeps assuming the shape of obj_1 that it saw when the lookup was cached, even after that shape changes.
Back to the librarian: the note that should say "forget my spot if the shelf is rearranged" has been replaced with a note that says "there is nothing to check". So when the shelf is rearranged, the librarian still walks to the old spot and hands you whatever is there now, which may be a completely different kind of book.
Exploitation
The report does not walk through a full exploitation sequence. It gives a reproduction case and describes the expected outcome. The steps it does give are:
Step 1: Build the environment
Use V8 at commit d32e674 on Ubuntu 24.04 LTS. The report does not describe how the build was produced.
Why this step exists: to reproduce a bug reliably you need the exact code version where it was found. The report leaves out build instructions, so a reader cannot rebuild the environment from this text alone.
Step 2: Run the proof of concept
The report says to run poc.js with the following flags:
What each part does:
--experimental-wasm-custom-descriptors: enables the WebAssembly custom descriptors feature locally, emulating the origin trial. Without it, the prototype chain in the proof of concept could not be built.--allow-natives-syntax: lets the script use V8 native syntax to print a debug message. This is for the researcher's own visibility, not for the bug itself.
The report does not include the contents of poc.js, so the exact script cannot be reproduced from this text. That is an important limitation: the report tells you how to run the proof of concept but not what it contains.
Step 3: Observe the result
The report states the run should cause an out-of-bounds access which then loads an object from outside the boundary of proto. In the researcher's case the object loaded was a heap number map.
In plain words: the stale cache makes V8 read memory past the end of an object called proto. The value it picks up there happens to be a heap number map, which is V8's internal description of a number stored on the heap. Reading the wrong kind of value where a different kind was expected is exactly the type confusion.
Root cause
The root cause is the sentinel handling in the prototype validity cell logic. When a prototype in the chain is not a JSObject, TryGetValidityCellHolderMap fails and GetOrCreatePrototypeChainValidityCell returns Map::kNoValidityCellSentinel. The inline cache stores that sentinel in the handler. Later, CheckPrototypeValidityCell treats the sentinel as a reason to skip the check entirely and jump to done. So the handler is never invalidated when the map of the cached property holder changes.
Normally the validity cell exists precisely to catch map changes in the prototype chain and force the optimised handler to miss. With the sentinel in place, that defence is disabled for chains that pass through a non-JSObject prototype. The WebAssembly custom descriptors proposal makes such chains possible, because a WebAssembly object can be a prototype and is not a JSObject. The report presents this as the mechanism; it does not discuss whether any other check would catch the stale assumption.
To restate the chain of events as a numbered list:
- Code looks up a property that lives on a prototype, and V8 caches the answer.
- The prototype chain contains a WebAssembly object, which is not a
JSObject. - Because of that, V8 cannot create a real validity cell and stores the sentinel instead.
- The check that should invalidate the cache sees the sentinel and skips itself.
- The shape of the object that actually holds the property changes.
- The cache is not invalidated, so the optimised handler keeps using the old shape.
- The mismatch between the old shape and the new reality is the type confusion.
Impact
The report describes the immediate effect as type confusion, and the reproduction as an out-of-bounds access that loads an object from outside the boundary of proto, in the researcher's case a heap number map. The report does not demonstrate code execution, sandbox escape or any other outcome beyond that out-of-bounds access.
The condition for an attacker is that the WebAssembly custom descriptors feature is available. The report notes there is an origin trial for the proposal, and that anyone can register for the trial and host a website that triggers the bug.
What this means for a non-expert: the report shows a way to make the browser read the wrong memory. That is serious because memory errors are often the first step in a larger attack, but the report itself does not take that next step. It also does not claim that every Chrome user was affected; it ties reachability to the origin trial.
Fix
It is a vulnerability report with a reproduction case. What should change, based on the reasoning in the report, is the handling of the no-validity-cell sentinel: a chain that passes through a non-JSObject prototype should not end up with a handler whose validity check is skipped, or the sentinel path should not be reachable for chains that can later change.
In plain words: either the engine should refuse to cache lookups across a non-JSObject prototype, or the check should treat the sentinel as "cache is not trustworthy" rather than "nothing to check". The report raises both possibilities as reasoning, not as a confirmed patch.
Variants to test
- Other non-
JSObjectprototypes in a chain. Build a chain where the intermediate prototype is any object type thatIsJSObjectThatCanBeTrackedAsPrototyperejects, then change the map of the final property holder after the lookup is cached. A positive result is that the optimised handler still serves the old property layout, or that a debug build reports a map mismatch. - Different property kinds on the cached holder. Repeat the cached lookup against data properties, accessors and elements on
obj_1, then mutate the holder's map. A positive result is a stale handler that returns a value inconsistent with the current shape. - Longer chains. Insert more than one non-
JSObjectprototype betweenobjand the holder. A positive result is the same bypass of the validity check, showing the sentinel propagates through the chain. - Other engines and other proposals that let non-standard objects act as prototypes. Check whether the same sentinel shortcut exists in the equivalent inline cache code. A positive result is a cached handler that survives a map change on the holder.
- Origin trial reachability. Confirm whether a page can use the feature without the local flag when the trial is enabled. A positive result is the reproduction working in a trial-enabled build with no command line flags.
Each of these should be run only in a controlled environment, and the report gives no evidence that any of them was tested.
A short note on the terms in this list: a data property is a plain value stored on an object; an accessor is a property whose read or write runs a function; elements are the numbered entries of an array-like object. A debug build is a version of the engine compiled with extra checks that shout when something looks wrong.
Glossary
- Accessor: a property whose value is produced by a function when it is read, rather than stored directly.
- Bounty: a payment made by a company to someone who reports a security bug through its programme.
- Chrome VRP: Google Chrome's Vulnerability Reward Program, the scheme through which this bug was reported.
- Commit: a saved snapshot of a code repository, identified here as
d32e674. - CVSS: a standard scoring system for the severity of a vulnerability. The report gives no score.
- Data property: a property that stores a plain value directly on an object.
- Debug build: a build of the engine with extra internal checks enabled.
- Elements: the numbered entries of an array-like object.
- Flag: a command-line switch that changes a program's behaviour at startup.
- Heap number map: V8's internal shape descriptor for a number stored on the heap.
- Inline cache: a speed trick that remembers the result of a property lookup so the next lookup is faster.
- Isolate: V8's per-thread working state.
- JavaScript: the programming language used for interactivity on web pages.
- JSObject: V8's internal type for a JavaScript object.
- Map (V8): a hidden description of an object's shape, meaning which properties it has and where they sit.
- Proof of concept (PoC): a small program that demonstrates a bug.
- Prototype: a parent object that is consulted when a property is not found on the child.
- Prototype chain: the sequence of prototypes followed when looking up a property.
- PrototypeChainValidityCell: the note attached to a cached lookup that says whether the cached answer is still valid.
- Smi: V8's representation of a small integer.
- Type confusion: a bug where a value of one type is treated as if it were another type.
- Validity cell: see PrototypeChainValidityCell.
- V8: the JavaScript and WebAssembly engine used by Google Chrome.
- WebAssembly: a fast language that browsers can run, often produced by compiling other languages.
- WebAssembly custom descriptors: a proposal that lets WebAssembly objects have prototypes and appear in JavaScript prototype chains.