---
title: "The V8 Sandbox"
description: "The V8 Sandbox is a lightweight, in-process software sandbox that isolates the V8 heap so memory corruption from engine bugs cannot spread to the rest of the renderer process."
url: "https://swe.quest/articles/the-v8-sandbox-705346b1934809ad"
canonical: "https://v8.dev/blog/sandbox"
source: "V8"
published: "2024-04-04"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 11
tags: ["sandboxing","runtimes","memory-safety","browsers","vulnerability-research"]
---

# The V8 Sandbox

A post on [V8](https://swe.quest/sources/v8.md), published 2024-04-04, 11 min read, Deep dive. Original: [https://v8.dev/blog/sandbox](https://v8.dev/blog/sandbox)

## Summary

The V8 Sandbox is a lightweight, in-process software sandbox that isolates the V8 heap so memory corruption from engine bugs cannot spread to the rest of the renderer process. It is now included in Chrome's VRP as of Chrome 123. V8 exploits usually stem from 2nd-order logic bugs, often in JIT compilers, which neither Rust nor memory tagging can prevent. The sandbox therefore replaces raw pointers and 64-bit sizes on the heap with 40-bit offsets from a 1TB reserved region, plus a pointer-table indirection for external objects. Overhead is about 1% on Speedometer and JetStream, and the design is testable through a memory-corruption API and a sandbox-violation detection mode used for fuzzing.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Memory safety](https://swe.quest/tags/memory-safety.md) (Security)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Vulnerability research](https://swe.quest/tags/vulnerability-research.md) (Security)

## Prerequisites

- JavaScript engine internals ([easy posts on Runtimes & VMs](https://swe.quest/tags/runtimes.md?difficulty=easy))
- memory corruption exploitation ([easy posts on Vulnerability research](https://swe.quest/tags/vulnerability-research.md?difficulty=easy))
- JIT compilation basics ([easy posts on Compilers](https://swe.quest/tags/compilers.md?difficulty=easy))
- pointer compression

## Keywords

V8, V8 Sandbox, Chrome, Chrome VRP, JIT, pointer compression, memory tagging

## Related posts

- [Celebrating 10 years of V8 · V8](https://swe.quest/articles/celebrating-10-years-of-v8-v8-26690aa14d628d44.md): V8 · 2018-09-11 · Easy · 9 min read · Runtimes & VMs, JavaScript, Compilers, Memory management, Performance engineering
  V8 grew over ten years from a secret project started in 2006 on a Danish farm into a JavaScript and WebAssembly engine supporting eight instruction sets, embedded by both Chrome and Node.js.
- [How Bun supports V8 APIs without using V8 (part 2)](https://swe.quest/articles/how-bun-supports-v8-apis-without-using-v8-part-2-d765ff746fe7a86a.md): Bun · 2024-11-05 · Hard · 18 min read · Runtimes & VMs, JavaScript, C & C++, Memory management
  Bun emulates V8's memory layout on top of JavaScriptCore so that precompiled native addons, which inline V8 functions assuming specific pointer layouts, keep working.
- [Turbocharging V8 with mutable heap numbers](https://swe.quest/articles/turbocharging-v8-with-mutable-heap-numbers-d32025b1d5ea1f1c.md): V8 · 2025-02-25 · Hard · 5 min read · Runtimes & VMs, Compilers, JavaScript, Performance engineering, Memory management
  V8 eliminated a performance cliff in JetStream2's async-fs benchmark caused by a custom Math.random whose \`seed\` lives in a ScriptContext slot.
- [How Bun supports V8 APIs without using V8 (part 1)](https://swe.quest/articles/how-bun-supports-v8-apis-without-using-v8-part-1-ff8148b61cb465d8.md): Bun · 2024-09-30 · Hard · 19 min read · Runtimes & VMs, C & C++, JavaScript, Memory management
  Bun, which runs on JavaScriptCore, implements a growing subset of V8's C++ embedding API so Node.js native modules like cpu-features load without V8.
- [Announcing Stable V8 Bindings for Rust](https://swe.quest/articles/announcing-stable-v8-bindings-for-rust-01bc1bc22c1cbdef.md): Deno · 2024-09-24 · Medium · 4 min read · Rust, Runtimes & VMs, JavaScript, Memory safety
  Rusty V8, Deno's zero-overhead Rust bindings to V8's C++ API, is now stable and skips 1.0 to align with Chrome versioning, starting at 129.0.0.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
