Skip to content
Memory corruption Advisory Advanced CVE-2024-12381

Type Confusion in V8 (CVE-2024-12381)

Seunghyun Lee Follow

Originally disclosed on Chrome VRP

Bounty$55,000 High View original
  • Fix shipped in 9 days

VULNERABILITY DETAILS

A bit unfortunate that even after a series of patches canonicalization is still broken, we really need a proactive approach rather than reactive bug discovery & patches.

Summary

Arbitrary Wasm type confusion due to improper fix of b/380397544 (which attempts to fix a broken patch for b/379009132, which in turn attempts to fix a broken patch for b/371565065 + b/354408144). HeapType checks are missing for generic Wasm heap types at CanonicalEquality::EqualValueType(), allowing type confusion between arbitrary Wasm types.

Details

I've pointed out in b/380397544 that after https://crrev.com/c/6035175 v8 does not distinguish between (relative) recursion group based index vs. (absolute) canonical index, which leads to different recursion group to be mistakenly canonicalized into the same index and thus lead to arbitrary type confusion between Wasm types. https://crrev.com/c/6048961 attempts to fix this by checking for relative types on type index comparison. Equality checks for CanonicalValueTypes go through the following code at CanonicalEquality::EqualValueType():

C++
    bool EqualValueType(CanonicalValueType type1,
                        CanonicalValueType type2) const {
      if (type1.kind() != type2.kind()) return false;
      if (type1.has_index() &&
          !EqualTypeIndex(type1.ref_index(), type2.ref_index())) {
        return false;
      }
      return true;
    }

We see that if !type1.has_index(), that is, if the left-hand side of the equality comparison has a generic heap type, then the comparison always returns true no matter what the heap type of type2 is. This results in the equality comparator of Canonical(Singleton)Group to consider different reference types to be the same under the aformentioned case and thus may lead to arbitrary Wasm type confusion again.

However, this issue is not immediately evident as we use std::unordered_set<Canonical(Singleton)Group> to find pre-existing canonicalization results. This uses CanonicalHashing as a hashing function for the hashmap. Thus, to trigger this issue we must find two different recursion group that is considered equal by CanonicalEquality, but which at the same time also has a hash collision when hashed via CanonicalHashing.

CanonicalHashing uses base::Hasher which is based on MurmurHash64A and thus returns a 64bit hash value. Birthday attack allows us to find a collision in ~50% chance with 2^32 samples which is very feasible (in minutes, if not seconds). By precomputing offline the hash values for struct types that either has ref null any or ref null none as its fields and iterating this selection for >32 fields we can easily create >2^32 different inputs that are all considerered equal by CanonicalEquality, but which has random-ish hash values in which we are likely to find at least a single duplicate hash value. By using such precomputed colliding struct types we can canonicalize two different struct types into the same canonical index and cause arbitrary Wasm type confusion.

The attached PoC/exploit has a precomputed hash-colliding struct type that uses either ref null any or ref null none for its 40 field types. It tries two colliding pairs, one that works before https://crrev.com/c/6055121 and one that works after that as the patch affects hashing results.

Bisect

Bug introduced by https://crrev.com/c/6048961 in M133 that attempts to fix b/380397544 by accounting for relative type indices. Note that the commit is already backported to M132 and M131.

VERSION

Chrome Version: 133.0.6862.0 ~ latest / M131 head / M132 head
Operating System: All

REPRODUCTION CASE

Attached as poc.js which exploits the hash collision + type confusion to obtain in-sandbox exploit primitives, and then crashes on arbitrary caged write attempt.

Also attached is yet another full exploit exp.html that pops calc on Windows x64 Chrome, tested against Canary 133.0.6871.0.

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION

Type of crash: Renderer
Crash State: Crashes on arbitrary caged write attempt from JIT-compiled Wasm function (on d8, poc.js), arbitrary code execution (on Chrome, exp.html)

CREDIT INFORMATION

Reporter credit: Seunghyun Lee (@0x10n) of CMU CyLab

The original report as published on the Chromium issue tracker, by Seunghyun Lee (@0x10n). 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. 8 min read.

Context

This report concerns V8, the JavaScript and WebAssembly engine used by Google Chrome. The specific feature involved is Wasm type canonicalization: the mechanism by which V8 decides that two structurally identical Wasm types, defined in different modules or different recursion groups, are the same type. Canonicalization is what allows values of a type defined in one module to be passed to code that expects a structurally identical type from another module. It relies on a canonical index being assigned to each distinct type, and on equality and hashing functions that decide whether a newly seen recursion group matches one that has already been canonicalized.

The researcher is Seunghyun Lee (@0x10n) of CMU CyLab. The weakness is a type confusion in V8, rated high severity, with a bounty of 55,000 USD, disclosed on 2024-12-10. The report does not give a CVSS score.

The researcher opens with a blunt assessment: it is unfortunate that even after a series of patches, canonicalization is still broken, and that a proactive approach is needed rather than reactive bug discovery and patching.

Setup

The report does not describe any accounts, roles or special tooling setup. The relevant preconditions are version based. The bug was introduced by https://crrev.com/c/6048961 in M133, and that commit was already backported to M132 (https://crrev.com/c/6054730) and M131 (https://crrev.com/c/6054989). The affected versions listed are:

Chrome Version: 133.0.6862.0 ~ latest / M131 head / M132 head. Operating System: All.

The researcher supplied two artefacts: poc.js, which exploits the hash collision plus type confusion to obtain in-sandbox exploit primitives and then crashes on an arbitrary caged write attempt, and exp.html, a full exploit that pops calc on Windows x64 Chrome, tested against Canary 133.0.6871.0. The report does not include the contents of either file.

Finding it

The summary states the problem plainly: arbitrary Wasm type confusion due to an improper fix of b/380397544, which itself attempts to fix a broken patch for b/379009132, which in turn attempts to fix a broken patch for b/371565065 plus b/354408144. The concrete defect is that HeapType checks are missing for generic Wasm heap types at CanonicalEquality::EqualValueType() in v8/src/wasm/canonical-types.h, allowing type confusion between arbitrary Wasm types.

The researcher had already pointed out in b/380397544 that after https://crrev.com/c/6035175, V8 does not distinguish between a relative recursion group based index and an absolute canonical index. That leads to different recursion groups being mistakenly canonicalized into the same index, and therefore to arbitrary type confusion between Wasm types. https://crrev.com/c/6048961 attempted to fix this by checking for relative types on type index comparison.

Equality checks for CanonicalValueTypes go through the following code at CanonicalEquality::EqualValueType():

C++
    bool EqualValueType(CanonicalValueType type1,
                        CanonicalValueType type2) const {
      if (type1.kind() != type2.kind()) return false;
      if (type1.has_index() &&
          !EqualTypeIndex(type1.ref_index(), type2.ref_index())) {
        return false;
      }
      return true;
    }

The flaw the researcher spotted is in the control flow. If !type1.has_index(), that is, if the left-hand side of the equality comparison has a generic heap type, then the comparison always returns true regardless of what the heap type of type2 is. The equality comparator of Canonical(Singleton)Group therefore considers different reference types to be the same in that case, which may lead to arbitrary Wasm type confusion again.

The researcher notes that this issue is not immediately evident, because V8 uses std::unordered_set<Canonical(Singleton)Group> to find pre-existing canonicalization results, and that set uses CanonicalHashing as its hashing function. To trigger the issue, an attacker must find two different recursion groups that CanonicalEquality considers equal but that at the same time also produce a hash collision under CanonicalHashing.

CanonicalHashing uses base::Hasher, which is based on MurmurHash64A and therefore returns a 64-bit hash value. The researcher reasons that a birthday attack allows finding a collision with roughly 50% probability using 2^32 samples, which is very feasible, in minutes if not seconds. The plan is to precompute offline the hash values for struct types that have either ref null any or ref null none as their fields, and to iterate this selection for more than 32 fields. That easily creates more than 2^32 different inputs that are all considered equal by CanonicalEquality but whose hash values are random-ish, so at least one duplicate hash value is likely to be found. Using such precomputed colliding struct types, two different struct types can be canonicalized into the same canonical index, causing arbitrary Wasm type confusion.

The attached PoC/exploit has a precomputed hash-colliding struct type that uses either ref null any or ref null none for its 40 field types. It tries two colliding pairs: one that works before https://crrev.com/c/6055121 and one that works after that, because the patch affects hashing results.

Exploitation

The report does not present a step-by-step request or command sequence. It describes the exploitation at the level of the two attached artefacts and the primitives they produce.

Step 1: Build the equality bypass

A struct type is defined with 40 fields, each of which is either ref null any or ref null none. Because EqualValueType() returns true whenever the left-hand side has a generic heap type (no index), all of these struct types compare as equal under CanonicalEquality, even though their field heap types differ.

Step 2: Find a hash collision

Because the canonicalization set is an std::unordered_set keyed by CanonicalHashing, equality alone is not enough. The researcher precomputes hash values offline for struct types whose fields are either ref null any or ref null none, iterating over a selection with more than 32 fields. The birthday bound means roughly 2^32 samples give about a 50% chance of a collision, which the researcher describes as feasible in minutes if not seconds.

Step 3: Canonicalize two different types to one index

With a colliding pair in hand, the two different struct types are canonicalized into the same canonical index. From that point, values of one type are treated as values of the other, which is the type confusion.

Step 4: Turn confusion into primitives

The attached poc.js exploits the hash collision plus type confusion to obtain in-sandbox exploit primitives, and then crashes on an arbitrary caged write attempt. The report does not include the script, so the individual primitives are not described further.

Step 5: Full exploit

The attached exp.html is described as a full exploit that pops calc on Windows x64 Chrome, tested against Canary 133.0.6871.0. Again, the file contents are not in the report.

The crash information section states the crash type as Renderer. The crash state is: crashes on arbitrary caged write attempt from a JIT-compiled Wasm function (on d8, poc.js), and arbitrary code execution (on Chrome, exp.html).

Root cause

The root cause is the missing HeapType check for generic heap types in CanonicalEquality::EqualValueType(). The function only compares reference indices when the left-hand operand has an index. When the left-hand operand is a generic heap type such as any or none, the function falls through to return true without examining type2 at all. Two reference types that differ only in their generic heap type are therefore treated as equal.

This is the latest in a chain of fixes: b/371565065 plus b/354408144, then b/379009132, then b/380397544, then https://crrev.com/c/6048961, which introduced this bug while trying to account for relative type indices. The commit was backported to M132 and M131.

Existing defences did not stop it for two reasons. First, the equality bug alone is masked by the use of a hash set: the canonicalization lookup requires a hash match as well as an equality match. Second, the hash is only 64 bits and is derived from MurmurHash64A via base::Hasher, so a birthday attack over a large family of equality-equivalent inputs makes a collision practical. The combination of a permissive equality predicate and a 64-bit hash makes a collision practical, which is what makes the bug reachable.

Impact

An attacker who can supply Wasm modules to V8 can cause arbitrary Wasm type confusion. In the researcher's PoC this yields in-sandbox exploit primitives and an arbitrary caged write attempt from a JIT-compiled Wasm function. In the full exploit it yields arbitrary code execution on Windows x64 Chrome, demonstrated by popping calc against Canary 133.0.6871.0. The affected versions are M131, M132 and M133 heads, on all operating systems.

Fix

It references https://crrev.com/c/6055121 as a patch that affects hashing results, which is why the PoC carries two colliding pairs, one for before and one for after that change. The researcher's stated position is that a proactive approach is needed rather than reactive bug discovery and patching, given the repeated breakage across the chain of canonicalization fixes.

Variants to test

  1. Other equality predicates that short-circuit on a generic or wildcard operand. A positive result is two structurally different types that compare equal in the canonicalization layer.
  2. Other 64-bit non-cryptographic hashes used as set keys over attacker-controlled type descriptions. A positive result is a practical birthday collision over a family of equality-equivalent inputs.
  3. Other Wasm heap type pairs beyond ref null any and ref null none, for example other generic heap types that lack an index. A positive result is the same canonical index assigned to two distinct types.
  4. Other backported branches of the same commit chain (M131, M132, M133). A positive result is the same confusion on each branch, with the colliding pair adjusted for any hashing change such as https://crrev.com/c/6055121.
  5. Struct types with field counts other than 40. A positive result is a collision found within the birthday bound for that field count.

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. 15 min read.

What happened, in plain words

Google Chrome runs JavaScript and WebAssembly code through a component called V8. WebAssembly, usually shortened to Wasm, is a way to run programs in the browser that were originally written in other languages such as C or C++. V8 has to decide when two Wasm types are "the same type", even when they were defined in different places. The mechanism that makes this decision is called canonicalization. In this report, a researcher found that a recent fix to that mechanism was itself broken, and that the break could be turned into a serious security problem: a type confusion. Type confusion means the program treats a value as if it were one kind of thing when it is really another kind, which can let an attacker read or write memory in ways the program never intended.

The researcher, Seunghyun Lee (@0x10n) of CMU CyLab, reported this through the Chrome VRP, Google's bug bounty programme for Chrome. The weakness is rated high severity, the bounty was 55,000 USD, and the report was disclosed on 2024-12-10. The report does not give a CVSS score.

The researcher's opening remark is blunt: it is unfortunate that even after a series of patches, canonicalization is still broken, and a proactive approach is needed rather than reactive bug discovery and patching. In other words, the team keeps fixing one bug and accidentally creating the next one, and the researcher thinks the process itself needs to change.

Context

Before the details, it helps to understand the pieces involved.

  • V8 is the engine inside Chrome that reads and runs JavaScript and WebAssembly. Think of it as the kitchen where the browser actually cooks the web page's code.
  • WebAssembly (Wasm) is a compact, low-level instruction format. People compile other languages into Wasm so that heavy programs, such as games or image editors, can run in the browser at near-native speed.
  • A type in a programming language is a description of what a value is: a number, a piece of text, a list, and so on. Wasm has a rich type system, including reference types that point at other values.
  • Canonicalization is the process of giving each distinct type a single shared identity, a canonical index. If two Wasm modules each define a structurally identical type, canonicalization lets V8 say "these are the same type" and lets values flow between the modules. Without it, every module would be an island.
  • A recursion group is a set of types that refer to each other and are defined together. Canonicalization works on whole recursion groups at a time.
  • Equality and hashing functions are the two tools V8 uses to decide whether a newly seen recursion group matches one it has already canonicalized. Equality asks "are these the same?". Hashing turns a type description into a number, a fingerprint, so the engine can look things up quickly.

The report is an advisory from the Chrome VRP. The researcher is Seunghyun Lee (@0x10n) of CMU CyLab. The weakness is a type confusion in V8, rated high severity, with a bounty of 55,000 USD, disclosed on 2024-12-10. The report does not give a CVSS score.

Setup

There is nothing to log into and no special server to configure. The relevant preconditions are version based: the bug exists in particular builds of Chrome, and the researcher lists which ones.

The bug was introduced by https://crrev.com/c/6048961 in M133, and that commit was already backported to M132 (https://crrev.com/c/6054730) and M131 (https://crrev.com/c/6054989). "Backported" means the same change was copied from the newest development branch back into older release branches, so the bug spread to more users than the newest branch alone. The affected versions listed are:

Chrome Version: 133.0.6862.0 ~ latest / M131 head / M132 head. Operating System: All.

In plain terms, the bug is present in the M131, M132 and M133 lines of Chrome, on every operating system. "Head" means the latest code at the tip of that branch.

The researcher supplied two artefacts. The first is poc.js, a proof of concept: a small script that demonstrates the bug. It exploits the hash collision plus type confusion to obtain in-sandbox exploit primitives and then crashes on an arbitrary caged write attempt. The second is exp.html, a full exploit that pops calc on Windows x64 Chrome, tested against Canary 133.0.6871.0. "Popping calc" means the Windows calculator program appears on screen, which is the classic harmless way to prove that an attacker can run their own code. The report does not include the contents of either file, so we cannot see the exact code inside them.

Finding it

The summary states the problem plainly: arbitrary Wasm type confusion due to an improper fix of b/380397544, which itself attempts to fix a broken patch for b/379009132, which in turn attempts to fix a broken patch for b/371565065 plus b/354408144. The "b/" numbers are internal bug tracker identifiers. The point is a chain: each fix tried to repair the previous fix, and the latest one introduced a new hole.

The concrete defect is that HeapType checks are missing for generic Wasm heap types at CanonicalEquality::EqualValueType() in v8/src/wasm/canonical-types.h, allowing type confusion between arbitrary Wasm types. A "heap type" describes what kind of thing a reference points at, for example any (any value) or none (no value). A "generic" heap type is one that is not tied to a specific numbered type; it is a broad category rather than a precise identity.

The researcher had already pointed out in b/380397544 that after https://crrev.com/c/6035175, V8 does not distinguish between a relative recursion group based index and an absolute canonical index. That leads to different recursion groups being mistakenly canonicalized into the same index, and therefore to arbitrary type confusion between Wasm types. https://crrev.com/c/6048961 attempted to fix this by checking for relative types on type index comparison. In everyday terms: the engine was mixing up a local house number with a national ID number, and the fix tried to tell them apart, but did so incompletely.

Equality checks for CanonicalValueTypes go through the following code at CanonicalEquality::EqualValueType():

C++
    bool EqualValueType(CanonicalValueType type1,
                        CanonicalValueType type2) const {
      if (type1.kind() != type2.kind()) return false;
      if (type1.has_index() &&
          !EqualTypeIndex(type1.ref_index(), type2.ref_index())) {
        return false;
      }
      return true;
    }

Line by line, in plain words:

  1. bool EqualValueType(CanonicalValueType type1, CanonicalValueType type2) const { declares a function that takes two types and answers yes or no: are they equal?
  2. if (type1.kind() != type2.kind()) return false; says: if the two types are of different broad kinds, they are not equal. This is a sensible first check.
  3. if (type1.has_index() && !EqualTypeIndex(type1.ref_index(), type2.ref_index())) { says: if the first type has a specific numbered index, and that index does not match the second type's index, then they are not equal. The && means both conditions must hold for this branch to run.
  4. return false; is the answer when the indices differ.
  5. return true; is the fall-through answer. This is the flaw: if the first type has no index (it is generic), the second check is skipped entirely, and the function says "equal" without ever looking at the second type.

The flaw the researcher spotted is in the control flow. If !type1.has_index(), that is, if the left-hand side of the equality comparison has a generic heap type, then the comparison always returns true regardless of what the heap type of type2 is. The equality comparator of Canonical(Singleton)Group therefore considers different reference types to be the same in that case, which may lead to arbitrary Wasm type confusion again. A comparison: a bouncer who checks your name only if you are on the guest list, and waves everyone else through without looking at their ID.

The researcher notes that this issue is not immediately evident, because V8 uses std::unordered_set<Canonical(Singleton)Group> to find pre-existing canonicalization results, and that set uses CanonicalHashing as its hashing function. An std::unordered_set is a lookup table that stores each item once. To find an item, it first computes the item's hash, a numeric fingerprint, and only then checks equality among items with the same fingerprint. So a broken equality check alone is not enough: the attacker also needs two items whose fingerprints collide.

To trigger the issue, an attacker must find two different recursion groups that CanonicalEquality considers equal but that at the same time also produce a hash collision under CanonicalHashing. A hash collision means two different inputs produce the same fingerprint. Fingerprints are not unique, just like a short nickname can be shared by many people.

CanonicalHashing uses base::Hasher, which is based on MurmurHash64A and therefore returns a 64-bit hash value. 64 bits means the fingerprint is a number with 64 binary digits, so there are 2^64 possible fingerprints. The researcher reasons that a birthday attack allows finding a collision with roughly 50% probability using 2^32 samples, which is very feasible, in minutes if not seconds. The birthday attack is named after a familiar fact: in a room of only 23 people, there is already about a 50% chance that two share a birthday, because the number of pairs grows much faster than the number of people. The same maths applies to fingerprints.

The plan is to precompute offline the hash values for struct types that have either ref null any or ref null none as their fields, and to iterate this selection for more than 32 fields. A struct type is a record with named or numbered fields, like a form with boxes. ref null any means a reference that may be null and may point at any value; ref null none means a reference that may be null and can never point at a real value. Both are generic heap types, so the broken equality check treats them as interchangeable. That easily creates more than 2^32 different inputs that are all considered equal by CanonicalEquality but whose hash values are random-ish, so at least one duplicate hash value is likely to be found. Using such precomputed colliding struct types, two different struct types can be canonicalized into the same canonical index, causing arbitrary Wasm type confusion.

The attached PoC/exploit has a precomputed hash-colliding struct type that uses either ref null any or ref null none for its 40 field types. It tries two colliding pairs: one that works before https://crrev.com/c/6055121 and one that works after that, because the patch affects hashing results. In other words, the researcher prepared two keys because the lock was about to be changed.

Exploitation

The report does not present a step-by-step request or command sequence. It describes the exploitation at the level of the two attached artefacts and the primitives they produce. A "primitive" here means a small, reliable capability, such as reading memory at a chosen address, that an attacker builds bigger attacks from.

Step 1: Build the equality bypass

A struct type is defined with 40 fields, each of which is either ref null any or ref null none. Because EqualValueType() returns true whenever the left-hand side has a generic heap type (no index), all of these struct types compare as equal under CanonicalEquality, even though their field heap types differ. The attached PoC uses 40 fields, each either ref null any or ref null none.

Step 2: Find a hash collision

Because the canonicalization set is an std::unordered_set keyed by CanonicalHashing, equality alone is not enough. The researcher precomputes hash values offline for struct types whose fields are either ref null any or ref null none, iterating over a selection with more than 32 fields. The birthday bound means roughly 2^32 samples give about a 50% chance of a collision, which the researcher describes as feasible in minutes if not seconds. Doing this offline means the slow work happens on the attacker's own machine before any victim is involved.

Step 3: Canonicalize two different types to one index

With a colliding pair in hand, the two different struct types are canonicalized into the same canonical index. From that point, values of one type are treated as values of the other, which is the type confusion. A comparison: two different parcels get the same tracking number, so the delivery system hands one parcel to the person expecting the other.

Step 4: Turn confusion into primitives

The attached poc.js exploits the hash collision plus type confusion to obtain in-sandbox exploit primitives, and then crashes on an arbitrary caged write attempt. "In-sandbox" means the attacker is still contained by Chrome's renderer sandbox, a security boundary that limits what a compromised page can touch. A "caged write" is a write to memory inside a reserved region that the engine manages. The report does not include the script, so the individual primitives are not described further.

Step 5: Full exploit

The attached exp.html is described as a full exploit that pops calc on Windows x64 Chrome, tested against Canary 133.0.6871.0. Again, the file contents are not in the report. Canary is Chrome's experimental early-release channel, where new code appears first.

The crash information section states the crash type as Renderer. The crash state is: crashes on arbitrary caged write attempt from a JIT-compiled Wasm function (on d8, poc.js), and arbitrary code execution (on Chrome, exp.html). A JIT compiler turns Wasm into machine code while the program runs, and d8 is V8's standalone command-line shell used for testing without a full browser.

Root cause

The root cause is the missing HeapType check for generic heap types in CanonicalEquality::EqualValueType(). The function only compares reference indices when the left-hand operand has an index. When the left-hand operand is a generic heap type such as any or none, the function falls through to return true without examining type2 at all. Two reference types that differ only in their generic heap type are therefore treated as equal.

This is the latest in a chain of fixes: b/371565065 plus b/354408144, then b/379009132, then b/380397544, then https://crrev.com/c/6048961, which introduced this bug while trying to account for relative type indices. The commit was backported to M132 and M131.

Existing defences did not stop it for two reasons. First, the equality bug alone is masked by the use of a hash set: the canonicalization lookup requires a hash match as well as an equality match. Second, the hash is only 64 bits and is derived from MurmurHash64A via base::Hasher, so a birthday attack over a large family of equality-equivalent inputs makes a collision practical. The combination of a permissive equality predicate and a 64-bit hash makes a collision practical, which is what makes the bug reachable. A non-cryptographic hash is designed for speed, not for resisting a determined attacker.

Impact

An attacker who can supply Wasm modules to V8 can cause arbitrary Wasm type confusion. In the researcher's PoC this yields in-sandbox exploit primitives and an arbitrary caged write attempt from a JIT-compiled Wasm function. In the full exploit it yields arbitrary code execution on Windows x64 Chrome, demonstrated by popping calc against Canary 133.0.6871.0. The affected versions are M131, M132 and M133 heads, on all operating systems.

Fix

It references https://crrev.com/c/6055121 as a patch that affects hashing results, which is why the PoC carries two colliding pairs, one for before and one for after that change. The researcher's stated position is that a proactive approach is needed rather than reactive bug discovery and patching, given the repeated breakage across the chain of canonicalization fixes.

Variants to test

These are directions for finding similar bugs elsewhere, not suggestions from the report. Each is phrased as a test with a clear sign of success.

  1. Other equality predicates that short-circuit on a generic or wildcard operand. A positive result is two structurally different types that compare equal in the canonicalization layer.
  2. Other 64-bit non-cryptographic hashes used as set keys over attacker-controlled type descriptions. A positive result is a practical birthday collision over a family of equality-equivalent inputs.
  3. Other Wasm heap type pairs beyond ref null any and ref null none, for example other generic heap types that lack an index. A positive result is the same canonical index assigned to two distinct types.
  4. Other backported branches of the same commit chain (M131, M132, M133). A positive result is the same confusion on each branch, with the colliding pair adjusted for any hashing change such as https://crrev.com/c/6055121.
  5. Struct types with field counts other than 40. A positive result is a collision found within the birthday bound for that field count.

Glossary

  • Advisory: a written report describing a vulnerability, usually without a live attack against a specific victim.
  • Backport: copying a change from a newer development branch into an older release branch.
  • Birthday attack: a way to find two inputs with the same fingerprint by generating many candidates, because the chance of a match grows much faster than intuition suggests.
  • Canary: Chrome's experimental early-release channel where new code appears first.
  • Canonical index: the single shared number that V8 assigns to a type so that identical types from different modules are treated as the same.
  • Canonicalization: the process of giving each distinct type one shared identity.
  • Chrome VRP: Google's bug bounty programme for Chrome.
  • Commit: a recorded change to source code, identified by a link such as https://crrev.com/c/6048961.
  • Crash type Renderer: the part of Chrome that crashed, here the renderer process that runs page code.
  • d8: V8's standalone command-line shell used for testing without a full browser.
  • Equality predicate: a function that answers whether two things are the same.
  • Exploit primitive: a small, reliable capability, such as reading memory at a chosen address, used to build a bigger attack.
  • Generic heap type: a broad heap type such as any or none that is not tied to a specific numbered type.
  • Hash: a numeric fingerprint computed from data, used for fast lookup.
  • Hash collision: two different inputs that produce the same fingerprint.
  • Heap type: a description of what kind of thing a reference points at.
  • In-sandbox: still contained by Chrome's renderer sandbox, a boundary that limits what a compromised page can touch.
  • JIT compiler: a compiler that turns code into machine code while the program runs.
  • MurmurHash64A: a fast, non-cryptographic hash function that produces a 64-bit value.
  • PoC (proof of concept): a small script or file that demonstrates a bug.
  • Recursion group: a set of types that refer to each other and are defined together.
  • ref null any: a Wasm reference type that may be null and may point at any value.
  • ref null none: a Wasm reference type that may be null and can never point at a real value.
  • Renderer sandbox: the security boundary around the process that runs page code.
  • Struct type: a record type with fields, like a form with boxes.
  • Type: a description of what a value is, such as a number or a reference.
  • Type confusion: a bug where a value of one kind is treated as a value of another kind.
  • V8: the JavaScript and WebAssembly engine inside Chrome.
  • Wasm (WebAssembly): a compact, low-level instruction format that lets programs written in other languages run in the browser.
  • Wildcard operand: an operand that stands for any value rather than a specific one.

More by Seunghyun Lee

View all

14 more disclosed reports, best first.

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.