Type Confusion in V8 (CVE-2024-8904)
The deoptimizer in V8 does not account for the separate stacks used by WebAssembly JavaScript Promise Integration (JSPI), so lazy deoptimization can leave code running with invalidated invariants. This leads to type confusion and memory corruption, which an attacker could combine with a sandbox escape to achieve full renderer compromise.
- Fix shipped in 24 days
Wasm JSPI (JavaScript Promise Integration) is an experimental feature allowing Wasm functions to suspend and resume execution, integrating with JavaScript promises. This is implemented by executing asynchronous Wasm functions on a separately allocated stack, and switching to/from this stack when needed. However, the deoptimizer is currently unaware of these stacks when handling lazy deoptimization, which can result in deoptimized code still being executed after its invariants have been invalidated. These broken invariants can lead to memory corruption / type confusion, and together with a sandbox escape (like the one I reported recently, see issue 361862752) to a full renderer compromise.
Note that JSPI, while still in an experimental state right now, is currently undergoing origin trials, effectively already making it part of the attack surface exposed to malicious actors.
As a result, the exploit chain reported here can be used to compromise any Chromium build starting from build 123 to latest, as well as older builds whose #enable-experimental-webassembly-jspi flag has been manually enabled.
JSPI is also close to being standardized (the V8 blog post mentions that "we anticipate full standardization before the end of 2024"), and is likely to ship as a stable feature soon after, so future builds past the end of origin trials would most likely also be affected.
See the following attachments of this issue:
poc.js: a minimal proof-of-concept which triggers this bug. It exploits the reported issue to bypass stable map code dependencies, resulting in type confusion, which is used to leak the address of an heap object.exploit.js: a full exploit chain utilizing this bug + the sandbox escape reported in issue 361862752 to gain full remote code execution capabilities. The executed shellcode is configurable, but defaults to a singleint3, which causes the Chromium tab to crash with error codeSIGTRAP/STATUS_BREAKPOINT.- A version of this exploit which has been instrumented with a WebSocket-based logging harness is also available, hosted at
https://cytc.popax21.dev/87230a91463f61e51f372e2242ca8364a9843cac5de36c6cb4f10953c95a5615(append?tabto run the exploit in a popup window instead of an iframe). This can be used to view the log output as the exploit runs, and has been the main way I have tested this exploit on different devices. Note that if this domain were signed up for the JSPI origin trial, it could be used to compromise recent Chromium builds without the need to enable any feature flags.
- A version of this exploit which has been instrumented with a WebSocket-based logging harness is also available, hosted at
patch.diff: a proposed patch for this issue. It patches the deoptimizer to also traverse all Wasm stacks when deoptimizing a function. Through my own testing, this is confirmed to fix this vulnerability.
There are multiple ways of fixing this issue aside from the one implemented in the submitted patch. For example, it would also be possible to handle stack switches while traversing the current stack; this would fix the attack vector for JavaScript functions, while also combating potential performance degradation as a result of having to traverse all suspended Wasm stacks. However, one would still have to traverse these stacks when a Wasm function gets deoptimized since the function might currently be suspended on such a stack, so a hybrid approach would be required to fully fix the vulnerability in this manner. Because of the complexity of such a hybrid fix, I have opted against implementing it, instead opting to implement the simpler, guaranteed-to-work fix.
This exploit (and its associated patch) has been tested and confirmed to work on the following platforms:
- Chromium 128.0.6613.119, AMD64, Arch Linux 6.9.7-arch1-1, using the
#enable-experimental-webassembly-jspiflag - Chrome Stable 128.0.6613.119, AMD64, Arch Linux 6.9.7-arch1-1, using the
#enable-experimental-webassembly-jspiflag (*) - Chrome Canary 130.0.6705.0 (cohort: clang-64), AMD64, Windows 10, using the
#enable-experimental-webassembly-jspiflag (*) - V8 commit 6f7722597815e33071508c02a0f2add34e83dd1d, release build, AMD64, Arch Linux 6.9.7-arch1-1, using
d8 --wasm-staging - V8 commit 6f7722597815e33071508c02a0f2add34e83dd1d, debug build, AMD64, Arch Linux 6.9.7-arch1-1, using
d8 --wasm-staging
(*):
During testing, the exploit has failed to replicate reliably on Chrome because of randomized field trials (namely V8WasmTurboshaft, which causes the sandbox escape to fail, as well as others).
However, in all cases the exploit failed after having already successfully triggered the initial vulnerability; only later stages were affected by failures.
Setting the #enable-benchmarking flag causes the exploit to work reliably in all cases.
This is not an inherent limitation of the vulnerability; it would be possible to craft a more reliable exploit using, for example, a different, less mitigated sandbox escape.
Reporter Credit: if applicable, please credit my pseudonym Popax21 in regards to this report.
Context
WebAssembly JSPI (JavaScript Promise Integration) is an experimental feature that lets Wasm functions suspend and resume execution, integrating with JavaScript promises. It is implemented by executing asynchronous Wasm functions on a separately allocated stack, and switching to and from this stack when needed.
The target here is V8, the JavaScript and WebAssembly engine used by Chromium and Chrome. The bug is a type confusion in the deoptimizer's handling of those separate stacks, tracked as CVE-2024-8904 and reported through the Chrome VRP by the researcher publishing as Popax21. The platform records it as high severity with a bounty of 55,000 USD, disclosed on 1 October 2024.
JSPI is still experimental, but the report stresses that it is undergoing origin trials, which already makes it part of the attack surface exposed to malicious actors. The exploit chain described can compromise any Chromium build from build 123 to latest, as well as older builds where the #enable-experimental-webassembly-jspi flag has been manually enabled. The V8 blog post on JSPI is quoted as saying "we anticipate full standardization before the end of 2024", so builds past the end of origin trials would most likely also be affected.
Setup
The researcher attached the following files to the issue:
poc.js: a minimal proof of concept that triggers the bug. It exploits the issue to bypass stable map code dependencies, resulting in type confusion, which is used to leak the address of a heap object.exploit.js: a full exploit chain combining this bug with the sandbox escape reported in issue 361862752 to gain full remote code execution. The executed shellcode is configurable, but defaults to a singleint3, which causes the Chromium tab to crash with error codeSIGTRAP/STATUS_BREAKPOINT.patch.diff: a proposed patch, which makes the deoptimizer traverse all Wasm stacks when deoptimizing a function. The researcher confirmed through testing that it fixes the vulnerability.
A version of the exploit instrumented with a WebSocket-based logging harness was hosted at https://cytc.popax21.dev/[redacted]. Appending ?tab runs the exploit in a popup window instead of an iframe. This page was the main way the researcher tested the exploit on different devices, and it allowed the log output to be viewed as the exploit ran. The report notes that if that domain were signed up for the JSPI origin trial, it could be used to compromise recent Chromium builds without enabling any feature flags.
The exploit and its patch were tested and confirmed to work on the following platforms:
| Build | Platform | How JSPI was enabled |
|---|---|---|
| Chromium 128.0.6613.119 | AMD64, Arch Linux 6.9.7-arch1-1 | #enable-experimental-webassembly-jspi flag |
| Chrome Stable 128.0.6613.119 | AMD64, Arch Linux 6.9.7-arch1-1 | #enable-experimental-webassembly-jspi flag (*) |
| Chrome Canary 130.0.6705.0 (cohort: clang-64) | AMD64, Windows 10 | #enable-experimental-webassembly-jspi flag (*) |
| V8 commit [redacted], release build | AMD64, Arch Linux 6.9.7-arch1-1 | d8 --wasm-staging |
| V8 commit [redacted], debug build | AMD64, Arch Linux 6.9.7-arch1-1 | d8 --wasm-staging |
(*): On Chrome, the exploit failed to replicate reliably because of randomized field trials, namely V8WasmTurboshaft, which causes the sandbox escape to fail, as well as others. In all cases the exploit failed after having already successfully triggered the initial vulnerability; only later stages were affected. Setting the #enable-benchmarking flag causes the exploit to work reliably in all cases. The researcher notes this is not an inherent limitation of the vulnerability: a more reliable exploit could be crafted using, for example, a different, less mitigated sandbox escape.
Finding it
The observation behind the bug is that the deoptimizer is unaware of the separately allocated stacks used by JSPI when handling lazy deoptimization. Because of that, deoptimized code can still be executed after its invariants have been invalidated. Those broken invariants can lead to memory corruption or type confusion, and combined with a sandbox escape, to a full renderer compromise.
The proof of concept turns this into something concrete: it bypasses stable map code dependencies, producing type confusion, and uses that to leak the address of a heap object.
Exploitation
Step 1: Trigger the deoptimizer on a suspended Wasm stack
An asynchronous Wasm function runs on its own allocated stack and can be suspended while it waits on a JavaScript promise. When lazy deoptimization is requested for code that is currently suspended on such a stack, the deoptimizer walks the current stack but not the Wasm stacks. The deoptimized code therefore remains reachable and continues to execute after the assumptions it was compiled under have been invalidated.
Step 2: Bypass stable map code dependencies
The proof of concept uses the resulting broken invariants to bypass stable map code dependencies. The result is type confusion in the engine.
Step 3: Leak a heap object address
The type confusion is used to leak the address of a heap object, giving the exploit the address information it needs for the next stage.
Step 4: Combine with the sandbox escape
The full chain in exploit.js pairs this bug with the sandbox escape reported in issue 361862752 to gain full remote code execution capabilities. The shellcode is configurable; the default is a single int3, which crashes the Chromium tab with SIGTRAP / STATUS_BREAKPOINT.
Step 5: Observe the run
The instrumented build hosted at the URL above streams log output over a WebSocket while the exploit runs, and appending ?tab runs it in a popup window rather than an iframe. This harness was the main way the exploit was validated across the devices listed in the setup table.
Root cause
JSPI executes asynchronous Wasm functions on a separately allocated stack and switches to and from it as needed. The deoptimizer handles lazy deoptimization by traversing the current stack, but it does not know about these additional Wasm stacks. A function that is suspended on one of them is therefore missed, and deoptimized code can still be executed after its invariants have been invalidated. The broken invariants lead to memory corruption and type confusion.
Impact
An attacker who can run the exploit against a vulnerable build can chain the type confusion with a sandbox escape to obtain full remote code execution, and with the sandbox escape reported separately, a full renderer compromise. The chain applies to any Chromium build from build 123 to latest, and to older builds where #enable-experimental-webassembly-jspi has been manually enabled. Because JSPI is in origin trials, the attack surface is already exposed to malicious actors, and the researcher expects builds after the end of origin trials to be affected as well.
On Chrome, reliability is reduced by randomized field trials such as V8WasmTurboshaft, which makes the sandbox escape fail; the initial vulnerability is still triggered in those runs, and only later stages fail. Setting #enable-benchmarking makes the exploit work reliably in all cases. The researcher notes that a more reliable exploit could be built with a different, less mitigated sandbox escape.
Fix
The proposed patch, patch.diff, changes the deoptimizer so that it also traverses all Wasm stacks when deoptimizing a function. Testing confirmed that this fixes the vulnerability.
The researcher discusses an alternative: handling stack switches while traversing the current stack. That would fix the attack vector for JavaScript functions and combat potential performance degradation from traversing all suspended Wasm stacks. However, a Wasm function that is deoptimized might currently be suspended on such a stack, so those stacks would still have to be traversed in that case, requiring a hybrid approach to fully fix the vulnerability. Because of the complexity of such a hybrid fix, the researcher opted for the simpler, guaranteed-to-work change instead.
Variants to test
- A positive result is deoptimized or invalidated code continuing to run on a suspended stack after its assumptions have changed.
- A positive result is a stale frame executing after invalidation, visible as a crash or as type confusion in a debug build.
What happened, in plain words
A security researcher found a bug in Chrome's JavaScript engine, the part of the browser that reads and runs the code inside web pages. The bug lives in a feature called WebAssembly JSPI, which lets certain programs pause in the middle of their work and pick up again later. When Chrome decides that some code it had optimised is no longer safe to run in its optimised form, it is supposed to stop using that code. Because of this bug, in one specific situation it did not stop, and code kept running on assumptions that were no longer true. That can corrupt the browser's memory, and the researcher showed how to turn that into a full takeover of the part of Chrome that renders pages. The bug is tracked as CVE-2024-8904, was reported through Google's Chrome Vulnerability Reward Program (Chrome VRP), and the platform records it as high severity with a bounty of 55,000 USD, disclosed on 1 October 2024. The researcher publishes under the pseudonym Popax21.
Background: the words you need first
Before the details make sense, here are the ideas the report leans on.
- Browser engine: the software inside a browser that turns a web page's code into what you see. Chrome uses one called Chromium, and the part that runs JavaScript and WebAssembly is called V8.
- JavaScript: the programming language web pages use to be interactive.
- WebAssembly, or Wasm: a second language that browsers can run. It is designed to be fast, and developers often compile other languages into it. Think of it as a lower-level language that sits next to JavaScript in the same browser.
- Promise: a JavaScript object that represents a result you do not have yet. It is like a restaurant order ticket: you get the ticket now, and the food arrives later. Code can wait on a promise and continue when it is fulfilled.
- JSPI (JavaScript Promise Integration): an experimental feature that lets a Wasm function pause while it waits on a JavaScript promise and then resume. Without it, Wasm functions run start to finish; with it, they can step aside and come back.
- Stack: the region of memory where a running function keeps its temporary working data, including where it is in its execution. Each running function has a frame on a stack. Think of a stack of sticky notes: the top one is the function currently running, and when it finishes you peel it off and the one below continues.
- Deoptimizer: V8 does not run code exactly as written. It first runs a simple version, watches how the code behaves, and then produces a faster, optimised version based on assumptions it observed. If those assumptions later turn out to be wrong, V8 must throw away the optimised version and fall back to the simple one. The component that performs this switch is the deoptimizer. The assumptions are called invariants: facts the optimised code relies on being true.
- Lazy deoptimization: deoptimization that is scheduled rather than done instantly. The engine marks the optimised code as no longer valid and expects it to be abandoned at the next safe point. "Lazy" here means "not right now, but soon".
- Type confusion: a class of vulnerability where the engine treats a piece of memory as one kind of thing when it is actually another. It is like picking up a box labelled "apples" and finding it full of knives: the label promised one behaviour, the contents deliver another. This is the weakness class recorded for this bug.
- Memory corruption: damage to the engine's internal memory caused by writing or reading it in a way the program did not intend. Type confusion is one route to it.
- Heap: the pool of memory the engine uses for objects it creates while running. A heap object is one such object, and its address is its location in that memory.
- Sandbox escape: Chrome runs web content inside a restricted environment, the sandbox, so that a bug in a page cannot directly harm the rest of the machine. A sandbox escape is a second bug that gets code out of that restricted environment. Two bugs chained together can be far more serious than either alone.
- Renderer: the Chrome process that handles a page's content. A renderer compromise means an attacker has control of that process.
- Remote code execution (RCE): the ability to make the target machine run code of the attacker's choosing.
- Shellcode: a small piece of machine code an exploit runs once it has control. It is the payload.
- Origin trial: a way for a browser feature to be switched on for real websites before it becomes standard, so developers can try it. It means the feature is already reachable by ordinary web pages, not only by people who flip a hidden switch.
- Feature flag: a setting, usually hidden, that turns an experimental feature on or off. The flag in this report is
#enable-experimental-webassembly-jspi. - Proof of concept (PoC): a small program that demonstrates a bug exists, without necessarily doing anything harmful.
- Exploit: a program that turns a bug into a concrete effect, such as a crash or code execution.
- Patch: a proposed change to the source code that fixes the bug.
- WebSocket: a connection between a browser and a server that stays open and lets both sides send messages at any time. It is useful for streaming live log output.
- iframe: a frame inside a web page that loads another page. A popup window is a separate browser window opened by a page.
- Crash codes:
SIGTRAPandSTATUS_BREAKPOINTare operating-system signals meaning a program hit a debugging breakpoint instruction. The instructionint3is the machine-code instruction that triggers it.
Context
WebAssembly JSPI lets Wasm functions suspend and resume execution and integrates with JavaScript promises. It is implemented by running asynchronous Wasm functions on a separately allocated stack, and switching to and from that stack when needed. That separate stack is the key detail: the engine now has more than one place where a function can be mid-execution.
The target is V8, the JavaScript and WebAssembly engine used by Chromium and Chrome. The bug is a type confusion in how the deoptimizer handles those separate stacks. It is tracked as CVE-2024-8904, reported through the Chrome VRP by Popax21, recorded as high severity with a bounty of 55,000 USD, and disclosed on 1 October 2024.
JSPI is still experimental, but the report stresses that it is undergoing origin trials, which already makes it part of the attack surface exposed to malicious actors. In plain terms: even though the feature is not finished, real websites can already use it, so an attacker does not need special access to reach the buggy code. The exploit chain described can compromise any Chromium build from build 123 to latest, as well as older builds where the #enable-experimental-webassembly-jspi flag has been manually enabled. The V8 blog post on JSPI is quoted as saying "we anticipate full standardization before the end of 2024", so builds past the end of origin trials would most likely also be affected.
Setup
The researcher attached three files to the issue. Each one has a different job, and understanding why each exists helps you follow the rest.
poc.js: a minimal proof of concept that triggers the bug. It exploits the issue to bypass stable map code dependencies, resulting in type confusion, which is used to leak the address of a heap object. In other words, this is the smallest program that shows the bug is real and produces one useful piece of information: where an object lives in memory.exploit.js: a full exploit chain combining this bug with the sandbox escape reported in issue 361862752 to gain full remote code execution. The executed shellcode is configurable, but defaults to a singleint3, which causes the Chromium tab to crash with error codeSIGTRAP/STATUS_BREAKPOINT. The default payload is a singleint3, which causes the Chromium tab to crash with error codeSIGTRAP/STATUS_BREAKPOINT.patch.diff: a proposed patch, which makes the deoptimizer traverse all Wasm stacks when deoptimizing a function. The researcher confirmed through testing that it fixes the vulnerability.
A version of the exploit instrumented with a WebSocket-based logging harness was hosted at:
https://cytc.popax21.dev/[redacted]
This is a URL to a page that runs the exploit and streams log messages back to a server over a WebSocket, so the researcher could watch what happened at each stage. Appending ?tab runs the exploit in a popup window instead of an iframe:
The ?tab part is a query string: extra information added to the end of a URL. Here it tells the page to open the exploit in its own window rather than embedded in the page. This page was the main way the researcher tested the exploit on different devices, and it allowed the log output to be viewed as the exploit ran. The report notes that if that domain were signed up for the JSPI origin trial, it could be used to compromise recent Chromium builds without enabling any feature flags. That is worth pausing on: a website can join an origin trial, and once it does, the experimental feature is available to its visitors without them changing any settings.
The exploit and its patch were tested and confirmed to work on the following platforms:
| Build | Platform | How JSPI was enabled |
|---|---|---|
| Chromium 128.0.6613.119 | AMD64, Arch Linux 6.9.7-arch1-1 | #enable-experimental-webassembly-jspi flag |
| Chrome Stable 128.0.6613.119 | AMD64, Arch Linux 6.9.7-arch1-1 | #enable-experimental-webassembly-jspi flag (*) |
| Chrome Canary 130.0.6705.0 (cohort: clang-64) | AMD64, Windows 10 | #enable-experimental-webassembly-jspi flag (*) |
| V8 commit [redacted], release build | AMD64, Arch Linux 6.9.7-arch1-1 | d8 --wasm-staging |
| V8 commit [redacted], debug build | AMD64, Arch Linux 6.9.7-arch1-1 | d8 --wasm-staging |
A few notes on the table. "AMD64" is the processor family, and the strings after it identify the operating system and its version. "Chrome Stable" is the normal release channel; "Chrome Canary" is the early, less stable channel. d8 is V8's own command-line program for running JavaScript and Wasm outside a browser, and --wasm-staging is the option that turns on experimental Wasm features in it. Testing in both a release build and a debug build matters because a debug build contains extra internal checks that can catch problems a release build silently tolerates.
(*): On Chrome, the exploit failed to replicate reliably because of randomized field trials, namely V8WasmTurboshaft, which causes the sandbox escape to fail, as well as others. In all cases the exploit failed after having already successfully triggered the initial vulnerability; only later stages were affected. Setting the #enable-benchmarking flag causes the exploit to work reliably in all cases. The researcher notes this is not an inherent limitation of the vulnerability: a more reliable exploit could be crafted using, for example, a different, less mitigated sandbox escape. In plain words: Chrome randomly switches some internal features on and off for different users, and one of those switches interfered with the second half of the chain. The first bug still fired every time; only the follow-up steps were unreliable.
Finding it
The observation behind the bug is that the deoptimizer is unaware of the separately allocated stacks used by JSPI when handling lazy deoptimization. Because of that, deoptimized code can still be executed after its invariants have been invalidated. Those broken invariants can lead to memory corruption or type confusion, and combined with a sandbox escape, to a full renderer compromise.
To picture it: the deoptimizer is like a supervisor who walks the factory floor and tells every worker to stop using an outdated procedure. The supervisor only walks the main floor. A worker who stepped onto a separate side platform to wait for a delivery is never told, so when the delivery arrives, that worker carries on with the old procedure. The proof of concept turns this into something concrete: it bypasses stable map code dependencies, producing type confusion, and uses that to leak the address of a heap object.
Exploitation
Step 1: Trigger the deoptimizer on a suspended Wasm stack
An asynchronous Wasm function runs on its own allocated stack and can be suspended while it waits on a JavaScript promise. When lazy deoptimization is requested for code that is currently suspended on such a stack, the deoptimizer walks the current stack but not the Wasm stacks. The deoptimized code therefore remains reachable and continues to execute after the assumptions it was compiled under have been invalidated.
Why this step matters: everything else depends on getting the engine into the state where invalidated code is still running.
Step 2: Bypass stable map code dependencies
The proof of concept uses the resulting broken invariants to bypass stable map code dependencies. The result is type confusion in the engine.
A map in V8 is the engine's internal description of an object's shape: which properties it has and what types they are. Optimised code can depend on a map staying stable, meaning the object keeps the shape the optimised code expects. If that dependency is bypassed, the optimised code can be handed an object of a different shape than it was written for, and it will treat it as the old shape. That mismatch is the type confusion: the label says one thing, the contents are another.
Step 3: Leak a heap object address
The type confusion is used to leak the address of a heap object, giving the exploit the address information it needs for the next stage.
Why an address is valuable: modern systems deliberately randomise where things sit in memory, so an attacker cannot simply guess locations. Leaking one real address gives the exploit a foothold, a known point from which other locations can be calculated. It is like learning one street address in a city whose layout you were not told.
Step 4: Combine with the sandbox escape
The full chain in exploit.js pairs this bug with the sandbox escape reported in issue 361862752 to gain full remote code execution capabilities. The shellcode is configurable; the default is a single int3, which crashes the Chromium tab with SIGTRAP / STATUS_BREAKPOINT.
Why two bugs: the type confusion gives control inside the renderer, but the renderer is sandboxed. The separate sandbox escape is what carries the attack beyond that boundary. The default int3 payload is a single breakpoint instruction: it deliberately stops the program so the researcher can see that code execution was reached, without running anything harmful.
Step 5: Observe the run
The instrumented build hosted at the URL above streams log output over a WebSocket while the exploit runs, and appending ?tab runs it in a popup window rather than an iframe. This harness was the main way the exploit was validated across the devices listed in the setup table.
Why this step matters: an exploit that works once on one machine is not yet a reliable finding.
Root cause
JSPI executes asynchronous Wasm functions on a separately allocated stack and switches to and from it as needed. The deoptimizer handles lazy deoptimization by traversing the current stack, but it does not know about these additional Wasm stacks. A function that is suspended on one of them is therefore missed, and deoptimized code can still be executed after its invariants have been invalidated. The broken invariants lead to memory corruption and type confusion.
Impact
An attacker who can run the exploit against a vulnerable build can chain the type confusion with a sandbox escape to obtain full remote code execution, and with the sandbox escape reported separately, a full renderer compromise. The chain applies to any Chromium build from build 123 to latest, and to older builds where #enable-experimental-webassembly-jspi has been manually enabled. Because JSPI is in origin trials, the attack surface is already exposed to malicious actors, and the researcher expects builds after the end of origin trials to be affected as well.
On Chrome, reliability is reduced by randomized field trials such as V8WasmTurboshaft, which makes the sandbox escape fail; the initial vulnerability is still triggered in those runs, and only later stages fail. Setting #enable-benchmarking makes the exploit work reliably in all cases. The researcher notes that a more reliable exploit could be built with a different, less mitigated sandbox escape.
Fix
The proposed patch, patch.diff, changes the deoptimizer so that it also traverses all Wasm stacks when deoptimizing a function. Testing confirmed that this fixes the vulnerability. In the factory comparison, the supervisor now also walks the side platforms, so no worker is left running an outdated procedure.
The researcher discusses an alternative: handling stack switches while traversing the current stack. That would fix the attack vector for JavaScript functions and avoid some of the performance cost of traversing all suspended Wasm stacks. However, a Wasm function that is deoptimized might currently be suspended on such a stack, so those stacks would still have to be traversed in that case, requiring a hybrid approach to fully fix the vulnerability. Because of the complexity of such a hybrid fix, the researcher opted for the simpler, guaranteed-to-work change instead.
Variants to test
- A positive result is deoptimized or invalidated code continuing to run on a suspended stack after its assumptions have changed.
- A positive result is a stale frame executing after invalidation, visible as a crash or as type confusion in a debug build.
Glossary
- API: a defined way for one piece of software to ask another to do something, like a menu of allowed requests.
- Address (memory address): the location of a piece of data in memory, comparable to a street address.
- AMD64: a common family of processors used in desktop and laptop computers.
- Asynchronous: describes work that can pause and resume instead of running start to finish in one go.
- Attack surface: all the code and features an attacker can reach from outside.
- Browser engine: the software inside a browser that interprets and runs web page code.
- Bug bounty: a program that pays researchers for reporting security bugs responsibly.
- Chrome Canary: the early, frequently updated Chrome release channel used for testing.
- Chrome Stable: the normal Chrome release channel most people use.
- Chrome VRP (Chrome Vulnerability Reward Program): Google's bounty program for Chrome security bugs.
- Chromium: the open-source browser project that Chrome is built from.
- Coroutine / continuation: programming constructs that let a function pause and later resume where it left off.
- Crash: an unexpected stop of a program.
- CVE-2024-8904: the public identifier assigned to this vulnerability.
- d8: V8's command-line program for running JavaScript and WebAssembly outside a browser.
- Debug build: a version of software compiled with extra internal checks, useful for catching problems.
- Deoptimizer: the part of V8 that discards optimised code and falls back to simpler code when its assumptions no longer hold.
- Feature flag: a setting that turns an experimental feature on or off.
- Heap: the pool of memory where a program stores the objects it creates at runtime.
- Heap object: an object stored in the heap.
- iframe: a frame inside a web page that displays another page.
- int3: a machine-code instruction that triggers a breakpoint, stopping the program.
- Invariant: a fact that code relies on being true; if it becomes false, the code's behaviour is no longer valid.
- JavaScript: the programming language used to make web pages interactive.
- JSPI (JavaScript Promise Integration): an experimental WebAssembly feature that lets Wasm functions pause on and resume from JavaScript promises.
- Lazy deoptimization: deoptimization that is scheduled and carried out at a later safe point rather than immediately.
- Map (in V8): the engine's internal description of an object's shape and property types.
- Memory corruption: unintended damage to a program's memory caused by reading or writing it incorrectly.
- Origin trial: a scheme that lets real websites use an experimental browser feature before it is standard.
- Patch: a proposed source-code change that fixes a bug.
- Payload: the code an exploit runs once it has control.
- Pop-up window: a separate browser window opened by a web page.
- Proof of concept (PoC): a small program demonstrating that a bug exists.
- Promise: a JavaScript object representing a result that will arrive later.
- Query string: the part of a URL after
?, carrying extra parameters. - Release build: a version of software compiled for normal use, without the extra debug checks.
- Remote code execution (RCE): making a target machine run code chosen by the attacker.
- Renderer compromise: an attacker gaining control of the renderer process.
- Sandbox: a restricted environment that limits what web content can do to the rest of the machine.
- Sandbox escape: a bug that lets code break out of the sandbox.
- Shellcode: a small piece of machine code used as an exploit's payload.
- SIGTRAP / STATUS_BREAKPOINT: operating-system signals indicating a program hit a breakpoint instruction.
- Stable map code dependency: an assumption in optimised code that an object's internal shape (its map) will not change.
- Stack: the memory region holding a running function's temporary data and its position in execution.
- Standardization: the process of agreeing a formal specification so all implementations behave the same.
- Type confusion: a vulnerability where memory is treated as one kind of thing when it is actually another.
- V8: the JavaScript and WebAssembly engine used by Chromium and Chrome.
- V8WasmTurboshaft: an internal V8 component named in the report as one of the randomized field trials that made the sandbox escape fail during testing.
- WebAssembly (Wasm): a fast, low-level language that browsers can run alongside JavaScript.
- WebSocket: a persistent two-way connection between a browser and a server, used here to stream live logs.
#enable-benchmarking: a Chrome flag that, when set, made the exploit run reliably in the researcher's tests.#enable-experimental-webassembly-jspi: the Chrome flag that turns on the JSPI feature.