JavaScript Engine Security in 2025: New Bugs, New Defenses
Samuel Groß (Security Researcher · Google Project Zero)
POC2025 (Power of Community) · Main Stage
Overview
In "JavaScript Engine Security in 2025: New Bugs, New Defenses," Samuel Groß, a seasoned Security Researcher at Google Project Zero, provides a comprehensive look at the evolving landscape of JavaScript (JS) engine security. With over a decade of experience in the field, Groß takes the audience on a journey through the history of JS engine exploitation, illuminates why these critical components remain a persistent target, and details the cutting-edge defenses being developed to counter new threats. The talk aims to answer fundamental questions: Why are JS engines still so insecure after years of effort? How have bug types and exploitation techniques changed?

Key moments
- 0:00 Introduction to JS Engine Security Challenges
- 4:00 Compiler Optimization Challenges in JavaScript Engines
- 9:00 V8 JavaScript Engine Architecture Overview
- 12:00 Evolution of JavaScript Engine Vulnerability Types
- 32:00 Deep Dive: V8 In-Process Sandboxing Defense
- 46:00 Emergence of AI in Vulnerability Research
- 50:00 Web Audio Denormal Float CPU Bug Exploit
JavaScript Engine Security in 2025: New Bugs, New Defenses
Speakers: Samuel Groß, Security Researcher, Google Project Zero
Conference: POC
YouTube: https://www.youtube.com/watch?v=VgXlxAUR17Y
Overview
In "JavaScript Engine Security in 2025: New Bugs, New Defenses," Samuel Groß, a seasoned Security Researcher at Google Project Zero, provides a comprehensive look at the evolving landscape of JavaScript (JS) engine security. With over a decade of experience in the field, Groß takes the audience on a journey through the history of JS engine exploitation, illuminates why these critical components remain a persistent target, and details the cutting-edge defenses being developed to counter new threats. The talk aims to answer fundamental questions: Why are JS engines still so insecure after years of effort? How have bug types and exploitation techniques changed?
This presentation is highly relevant to anyone involved in browser security, web development, or vulnerability research. JavaScript engines, such as V8 (Chrome), SpiderMonkey (Firefox), and JavaScriptCore (Safari), are at the heart of modern web browsers and frequently represent the initial point of compromise in sophisticated browser exploits. Groß highlights a decade-long history of public browser exploits stemming from JS engine vulnerabilities, emphasizing their continued prevalence even in 2025. The insights shared are crucial for understanding the current state of the art in both offensive and defensive security within this high-stakes domain.
Background
▶ Watch: Introduction to JS Engine Security Challenges (0:00)
The persistent challenge of securing JavaScript engines stems from their unique operational model, which fundamentally differs from traditional C/C++ applications. Groß illustrates this distinction with a compelling analogy. In a typical C/C++ application, like an image parser, the attacker controls the data (e.g., a malicious image file), but the code (the image parser itself) is considered trusted and not attacker-controlled. Memory safety tools or languages like Rust can guarantee the safety of this trusted code, and compiler bugs that might lead to unsafe code are rarely exploitable because the input code is not malicious.
However, in a JavaScript engine, the attacker controls both the code (the JavaScript supplied by a malicious webpage) and the data (the objects and values that JavaScript code operates on). This means the compiler and runtime environment themselves become the direct attack surface. Groß demonstrates this with a classic C/C++ bounds check example, where a compiler correctly inserts and then safely eliminates a redundant bounds check for an unsigned int. He contrasts this with a hypothetical JavaScript engine bug where a compiler incorrectly eliminates a bounds check because it fails to account for side effects from an intermediate operation (e.g., a to_number conversion) that could trigger arbitrary JavaScript code, leading to an array resize and subsequent out-of-bounds access. This scenario highlights the core difficulty: the highly optimized, complex nature of JIT compilers, combined with JavaScript's dynamic and effectful operations, creates a fertile ground for subtle logic bugs that lead to memory unsafety.
To understand the context of these bugs, an overview of a modern JS engine's architecture is essential. Groß uses the V8 engine (used in Chrome) as an example, but notes its similarity to other engines like WebKit's JavaScriptCore or Firefox's SpiderMonkey. The JavaScript pipeline begins with JavaScript source code, which is processed by the parser into a custom bytecode. This bytecode is then executed by an interpreter (Ignition in V8). For frequently executed code, the engine engages multiple optimizing JIT (Just-In-Time) compilers. These include a baseline JIT that compiles quickly for moderate performance, followed by more aggressive optimizing JITs like Maglev and Turbofan/Turboshaft that produce highly optimized machine code for hot code paths. Separately, the WebAssembly pipeline handles WebAssembly bytecode, which is validated and then compiled. The engine also features a garbage collector for automatic memory management and a broad runtime environment encompassing built-in functions, helper methods, and the glue code that binds everything together. This intricate, multi-stage architecture, with its numerous components and complex interactions, significantly contributes to the challenge of maintaining security.
Key Findings
▶ Watch: V8 JavaScript Engine Architecture Overview (9:00)
Samuel Groß presents a chronological evolution of JavaScript engine vulnerabilities, categorizing them into three distinct phases:
- Phase 1 (Pre-2017): Classic JS Engine Runtime Bugs. These were typically found in the runtime environment or interpreter, often involving unexpected callbacks or integer overflows in built-in functions like
Array.pushorArray.slice. These bugs were often localized to a single function and relatively straightforward to identify through manual auditing. Groß notes that these types of bugs have largely disappeared from major engines due to effective fuzzing techniques.
- Phase 2 (Around 2017 onwards): Optimization Bugs. This phase saw a shift towards more complex vulnerabilities residing deep within the optimizing JIT compilers (Maglev, Turbofan/Turboshaft) and, more recently, the parser. These bugs often involve incorrect compiler assumptions, such as faulty bounds check elimination or issues with loop invariant code motion, leading to type confusion or spatial memory safety violations. Groß emphasizes that these are among the most complex bugs in software security, with a wide variety of patterns rather than a single recurring theme.
- Phase 3 (Two years ago onwards): WebAssembly GC Bugs. The introduction of WebAssembly GC (Garbage Collection) dramatically increased the complexity of the WebAssembly runtime, adding a new type system, object system, and garbage collection support. This "massive upgrade in complexity" opened up a new attack surface, leading to unique bugs. A common pattern involves existing JavaScript engine code making incorrect assumptions about object types after the introduction of new WebAssembly-specific object types (e.g.,
WasmObject), resulting in type confusion vulnerabilities. Today, the vulnerability landscape is primarily a mix of Phase 2 and Phase 3 bugs.
Groß then delves into the state of modern defenses:
- Jitless Mode: An attack surface reduction technique that disables optimizing JITs, forcing execution through the interpreter or baseline JIT. While it reduces potential bugs (V8 exploit tracker data suggests ~50% of known exploitable bugs would be mitigated by disabling optimizing JITs, with baseline JITs rarely being the issue), it incurs significant performance penalties (5-90%) and isn't a complete solution.
- Memory Tagging Extensions (MTE): A hardware-assisted memory safety feature (e.g., on Apple's MTE-enabled phones) that tags pointers and memory regions, catching out-of-bounds accesses. However, Groß expresses skepticism about its effectiveness against core JS engine bugs, arguing that the powerful primitives these bugs provide (arbitrary type confusions, arbitrary out-of-bounds reads) could likely bypass MTE. Furthermore, existing JS engine architectures like V8's pointer compression or SpiderMonkey/JSC's nanboxing leave no available bits for tags, requiring significant refactoring.
- Sandboxing (V8 Sandbox): A different architectural approach that aims to limit the scope of memory corruption. By confining all V8 objects to a dedicated 1TB virtual address space and replacing raw pointers with 32-bit offsets or pointer table indirections for external objects, the sandbox creates a new security boundary. This software-only sandbox is currently in an advanced state (~0.95 complete) and offers a plausible path towards a more secure and high-performance JS engine, especially with future hardware support.
- WebKit's JIT Cage: A mitigation on Apple chips that focuses on Control Flow Integrity (CFI) for JIT-generated code, ensuring it cannot perform arbitrary syscalls or jumps. While similar in spirit to sandboxing, its primary goal is not to restrict memory access, but rather to control execution flow after an attacker might have gained some level of arbitrary read/write. It leverages custom CPU features, with upcoming ARM POE2 expected to offer similar capabilities.
Finally, Groß discusses the state of vulnerability research:
- Manual Code Auditing: Still highly effective for finding complex, high-quality bugs, exemplified by the work of Seyong.
- Fuzzing: Continues to be a strong method, especially targeted fuzzing for specific components or variants of known bugs, capable of uncovering unique issues.
- AI-powered Approaches: An emerging and promising area, with Big Sleep (a reasoning model with code browsing and execution tools) already reporting 10-11 high-impact vulnerabilities in V8, demonstrating its ability to understand code and generate complex test cases.
Technical Deep Dive
▶ Watch: Evolution of JavaScript Engine Vulnerability Types (12:00)
The technical complexity of JavaScript engines is a recurring theme. Groß elaborates on the V8 engine architecture, starting from JavaScript source code which is initially processed by the parser into bytecode. The interpreter (Ignition) then executes this bytecode. For frequently executed functions, the engine employs a tiered compilation strategy. A baseline JIT quickly compiles bytecode into machine code. For "hot" code, more advanced optimizing JITs like Maglev and Turbofan/Turboshaft perform extensive optimizations, transforming the code into a highly efficient, specialized version. The WebAssembly pipeline runs in parallel, validating WASM bytecode and compiling it directly to machine code. The garbage collector manages memory, and the runtime environment provides core functionalities. Each of these components, especially the optimizing JITs, introduces intricate logic and assumptions, making them prime targets for sophisticated bugs.
Optimization Bugs are a cornerstone of modern JS engine exploitation. Groß highlights how compiler passes, such as bounds check elimination or loop invariant code motion, make assumptions about code behavior for performance. If these assumptions are violated—for example, if a seemingly pure operation has side effects that alter program state (like array length) between a check and its use—memory safety can be compromised. The talk references a slide from a previous presentation with Amy, illustrating how various optimizations, each with its unique bug patterns, can lead to memory unsafety. This underscores that there isn't a single "bug pattern" but a diverse mix of issues tied to specific optimization techniques.
The advent of WebAssembly GC introduced a new class of type confusion bugs. Previously, the V8 object hierarchy was relatively simple: HeapObject -> JSReceiver (anything with properties) -> JSObject (normal objects, arrays) or JSProxy (configurable behavior). Many parts of the engine would check if an object was a JSReceiver and not a JSProxy, then confidently cast it to a JSObject. Wasm GC, however, added WasmObject as a new JSReceiver subtype. These objects, while exposed to JS, are "kind of weird." This change broke existing invariants: code that assumed JSReceiver and not JSProxy implied JSObject now performed an invalid type cast when given a WasmObject, leading to type confusion and arbitrary memory corruption. This illustrates a common vulnerability pattern where new features inadvertently break implicit assumptions in older, seemingly robust code.
Groß then details Jitless Mode as a defense. The core idea is simple: if the optimizing JITs are the source of complex bugs, disable them. This forces JavaScript execution through the simpler interpreter (Ignition) or baseline JIT. While this reduces attack surface, the performance cost is substantial (5-90% slowdown). Chrome's approach is to disable only the optimizing JITs (Maglev, Turbofan/Turboshaft) while keeping the baseline JIT. This is based on the hypothesis that most bugs reside in the more complex optimizing compilers. Data from the V8 exploit tracker (a public dataset of known exploitable V8 bugs) supports this: in 2024, approximately 50% of the tracked bugs would have been mitigated by disabling optimizing compilers, and critically, no bugs were found in the baseline JITs. While helpful, Groß cautions that 50% fewer bugs doesn't equate to 50% fewer exploits, as attackers often have multiple vulnerabilities.
Memory Tagging Extensions (MTE), an ARM hardware feature, represents a promising direction for memory safety. MTE assigns a small tag (e.g., 1 of 16 keys) to both memory regions and pointers. The CPU then enforces that a pointer's tag matches the memory region's tag during access, catching linear buffer overflows. However, Groß expresses strong reservations about MTE's immediate impact on JS engine security. He argues that JS engine bugs often provide arbitrary type confusion or arbitrary out-of-bounds read/write primitives, which are "too powerful" for MTE. An attacker could confuse objects, read pointers to infer tag values, and then craft exploits to bypass MTE. Moreover, existing JS engine architectures are not MTE-friendly. V8 uses pointer compression (32-bit pointers) and SpiderMonkey/JSC use nanboxing (encoding pointers as floating-point numbers), both of which utilize the bits that MTE would need for tags, requiring "major refactorings" to integrate.
The V8 Sandbox is a major architectural undertaking aimed at fundamentally changing the security model. Its goal is to limit the scope of memory corruption, creating a new security boundary. This is achieved by:
- Allocating a 1 terabyte virtual address space (the sandbox region) within the browser process. All V8 objects reside exclusively within this region.
- Replacing raw pointers within V8 with 32-bit offsets relative to the sandbox base. If an attacker corrupts an offset, they can only access memory within the 1TB sandbox, preventing escape.
- For references to external objects (e.g., DOM objects in Blink), a pointer table indirection is used. The sandbox stores an index into a table that holds type and pointer information, ensuring controlled and validated access to objects outside the sandbox.
Groß envisions a future hardware-backed sandbox (version 2.0) where the CPU itself would enforce a low-privileged mode for JS/WASM code, physically preventing access to non-sandbox memory. This would create a strict separation between privileged code (e.g., garbage collector, compiler, binding code to Blink) and sandboxed code (JIT-generated code, interpreter), offering strong security guarantees. The V8 sandbox is currently at "version 0.95," with the design largely finalized but extensive code adjustments needed for existing V8 code not written with this security model in mind.
Finally, WebKit's JIT Cage is presented as another hardware-assisted mitigation, specifically for Apple chips, with similar features expected in future ARM POE2 hardware. The JIT Cage's primary goal is Control Flow Integrity (CFI) for JIT-generated code. It ensures that JIT code cannot make arbitrary syscalls or jump to arbitrary memory locations, instead requiring all calls to go through validated trampolines. Crucially, unlike the V8 Sandbox, the JIT Cage does not restrict memory access. It mitigates control flow hijacking after memory corruption might have occurred, rather than preventing the initial memory corruption itself.
Demo / Proof of Concept
▶ Watch: Emergence of AI in Vulnerability Research (46:00)
While the talk doesn't feature a live demo, Samuel Groß illustrates several fascinating vulnerabilities that serve as powerful proof-of-concept explanations, highlighting different facets of JS engine security.
- Bytecode Compiler Bug (Await Using): This bug, discovered by the AI system Big Sleep, exploited a subtle interaction with a new JavaScript feature:
await usingsyntax within a loop. In asynchronous or generator functions, the engine needs to manage "resume points" to allow yielding and later resuming execution. The implementation involves the parser calculating the number of these points and the compiler building a switch table based on that count. The bug occurred because of a mismatch: the parser might count five resume points, but the compiler incorrectly wrote six cases into the switch block. This corrupted the bytecode, leading to an "arbitrary bytecode execution" primitive, which is highly exploitable. Groß notes that traditional fuzzers struggled to find this because they didn't fully understand the newawait usingsyntax within a loop context.
- Bytecode Corruption (Large Try-Catch): Another Big Sleep discovery, this bug involved a try-catch statement in extremely large bytecode. The bytecode for a try-catch block includes a table that specifies exception handlers, with offsets indicating where to jump upon an exception. While V8's maximum bytecode size is 512 megabytes, the offset for the exception handler was stored as a 28-bit integer, which can only represent values up to 256 megabytes. If the bytecode exceeded this limit, the offset would be truncated, causing the engine to jump to an incorrect, potentially arbitrary, location within the bytecode, leading to a similar "arbitrary bytecode execution" primitive. This was hard for fuzzers to find because generating such large bytecode typically causes timeouts.
- Web Audio Denormal Bug (CPU Mode Confusion): Groß describes this as his "favorite bug of the last few years," found by the V8 team and also affecting other browsers like Safari (CVE assigned). This bug demonstrates a complex interaction between the browser's Web Audio component and the JavaScript engine. Web Audio allows developers to use custom JavaScript processing nodes to manipulate raw audio. For performance reasons, Web Audio modules sometimes configure the CPU to disable handling of denormal (or subnormal) floating-point numbers. Denormal numbers are extremely small floating-point values near zero that have leading zeros in their mantissa. When denormal handling is disabled, these numbers are flushed to zero by the CPU, offering significant performance improvements for floating-point operations.
However, the JavaScript specification dictates that denormal numbers must be supported and are not zero. The proof of concept clearly shows this discrepancy: a denormal number printed outside a Web Audio module is a small, non-zero value, but when observed inside an audio processing node, it becomes 0. The exploit leverages this CPU mode confusion. The optimizing JIT compiler, adhering to the JS spec, makes an assumption that a denormal number is non-zero. When this assumption is violated at runtime (because the CPU flushes it to zero), a boolean confusion (e.g., isDenormalZero is false according to compiler, but true at runtime) occurs. This boolean confusion can then be expanded into an integer confusion, allowing the attacker to trick the compiler into believing an integer has one value while it actually has another. This ultimately leads to memory corruption, such as an out-of-bounds array access. Groß points to a fully commented proof-of-concept exploit online for those interested in the intricate details.
Defensive Implications
▶ Watch: Web Audio Denormal Float CPU Bug Exploit (50:00)
The talk offers several crucial defensive implications for various stakeholders:
For Browser/Engine Developers:
- Embrace Architectural Shifts: The V8 Sandbox represents a paradigm shift from fixing individual bugs to limiting the impact of bugs. For any new engine development, starting with such an in-process sandboxing architecture from scratch is highly recommended, as retrofitting it onto existing complex engines is immensely challenging. This architecture enables future benefits like using memory-safe languages (Rust) for privileged code and leveraging hardware sandboxing for untrusted code.
- Targeted Jitless Modes: While a full Jitless mode is impractical due to performance, selectively disabling optimizing JITs (while retaining baseline JITs) can significantly reduce attack surface without completely crippling performance. This is a valuable tool for security-sensitive contexts, though not a complete solution.
- Hardware-Assisted Security: While current MTE may not be a silver bullet for powerful JS engine bugs, the trend towards hardware-backed in-process sandboxing (like ARM POE2) is a promising future direction. Engine developers should actively engage with hardware vendors to shape these features.
- Scrutinize New Language Features and Inter-Component Interactions: Bugs related to
await usingand Web Audio highlight that new language features or complex interactions between browser components and the JS engine are fertile ground for subtle, powerful vulnerabilities. Rigorous security reviews, extensive fuzzing, and AI-powered analysis are critical during the implementation of new features. - Invest in Advanced Vulnerability Research: The success of AI-powered tools like Big Sleep indicates that integrating such systems into internal security workflows can augment human auditors and fuzzers, finding bugs that might otherwise be missed.
For Users and Enterprises:
- Prioritize Timely Updates: The constant evolution of bug types and sophisticated exploits underscores the critical importance of keeping browsers and operating systems updated to patch newly discovered vulnerabilities.
- Understand Browser Security Layers: While not directly actionable for end-users, understanding the complexity and the multi-layered defensive strategies (sandboxing, JIT hardening) employed by browser vendors provides confidence in the ongoing effort to secure the web. The move towards architectural mitigations aims to make browser exploitation significantly harder and more expensive for attackers.
- Security is a Continuous Battle: The "2025" in the title is not just a date; it signifies that JS engine security is an ongoing, dynamic challenge. No single defense will solve the problem, but a combination of architectural changes, rigorous testing, and advanced research is necessary to stay ahead of attackers.
Key Takeaways
- JavaScript engine security remains a critical, decade-long challenge due to their unique architecture where attackers control both code and data, making the compiler and runtime direct attack surfaces.
- The nature of JS engine bugs has evolved significantly, shifting from classic runtime issues to highly complex optimization bugs in JIT compilers and, more recently, type confusion vulnerabilities introduced by WebAssembly GC.
- Defensive strategies like Jitless mode offer partial mitigation by reducing attack surface, while hardware-assisted Memory Tagging Extensions (MTE) face architectural hurdles and are unlikely to fully counter the powerful primitives of JS engine exploits.
- The V8 Sandbox represents a significant architectural shift, aiming to limit the scope of memory corruption by confining engine objects to a dedicated address space, with future hardware integration promising robust in-process sandboxing.
- Modern vulnerability research now combines traditional manual auditing and targeted fuzzing with emerging AI-powered bug discovery systems like Big Sleep, which have already proven effective in finding complex, high-impact vulnerabilities.
- New language features (e.g.,
await using) and intricate interactions between browser components (e.g., Web Audio) and the JS engine continue to be sources of subtle yet powerful exploits, demanding constant vigilance and advanced testing methodologies.
About the Speaker(s)
Samuel Groß is a distinguished Security Researcher at Google Project Zero. He has been a prominent figure in the JavaScript engine security space for approximately 10 years, actively contributing to the understanding and mitigation of vulnerabilities in these critical browser components. His work includes significant contributions to advanced defensive measures, such as the V8 sandbox, demonstrating his expertise in both offensive and defensive security research.
Reviews
Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT
Groß delivers exactly what a top-tier conference talk should be: a decade of institutional knowledge compressed into a clear evolutionary model of JS engine bugs, honest assessment of which defenses actually work, and concrete architectural direction for the future. This is the talk you point junior researchers to when they ask where the field is headed.
Heather Calloway (CISO) — STRONG ACCEPT
This is required reading for anyone responsible for browser-based attack surface. Groß delivers a clear-eyed assessment of why JS engine bugs persist, what defenses actually work, and where the industry is heading. The V8 sandbox work represents a meaningful architectural shift that changes the cost calculus for browser exploitation.