# browser-exploitation-v8

A playbook for exploiting JavaScript engine bugs: JIT type confusion, bounds elimination, V8 sandbox bypass. Built for CTF work and Chrome bug analysis.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3600 installs · ★ 2547
- Author: yaklang
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/yaklang/hack-skills/tree/HEAD/skills/browser-exploitation-v8/SKILL.md
- Updated: 2026-09-13
- HTML: https://affpapa.org/en/nevibecode/skills/browser-exploitation-v8

## What it does

The skill walks an agent through a full V8 exploitation chain. It covers the compilation pipeline from Ignition through Sparkplug and Maglev to TurboFan, the usual bug classes such as eliminated bounds checks or type confusion after optimization, and the `addrof` and `fakeobj` primitives for leaking an object address and forging a reference.

From there it moves to what you build on top: corrupting an `ArrayBuffer` for arbitrary memory read and write, WASM pages with execute rights, and an overview of the V8 sandbox with pointer compression plus the Chrome sandbox escape. A companion file, `V8_EXPLOITATION_PATTERNS.md`, loads when you need code templates, heap layout manipulation and GC interaction.

The scope is narrow on purpose: the Chrome renderer and its sandbox. Ask for general heap work or ROP for native code and the skill routes you to neighbours like `heap-exploitation` and `stack-overflow-and-rop`. Without a grip on pointer compression and object maps it will not carry you far, since that barrier is exactly where base models slip.

## Requirements
- Works with: Chrome

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill browser-exploitation-v8 -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/browser-exploitation-v8/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/browser-exploitation-v8/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill browser-exploitation-v8 -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/browser-exploitation-v8/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill browser-exploitation-v8 -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/browser-exploitation-v8/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install yaklang/hack-skills browser-exploitation-v8
```

2. **Manually: put the files in place**
- File: `.github/skills/browser-exploitation-v8/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill browser-exploitation-v8 -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/yaklang/hack-skills --path skills/browser-exploitation-v8
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/browser-exploitation-v8/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill browser-exploitation-v8 -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/yaklang/hack-skills/tree/HEAD/skills/browser-exploitation-v8/SKILL.md

## When to use it
- trace the V8 compilation pipeline to find where optimization went wrong
- build addrof and fakeobj primitives for a specific bug
- turn ArrayBuffer corruption into arbitrary read and write
- bypass the V8 sandbox with pointer compression
- plan a Chrome renderer escape through IPC and Mojo

## Example prompts
- walk me through this V8 bug: TurboFan dropped the bounds check, help me build addrof and fakeobj
- how do I get arbitrary memory read in V8 from ArrayBuffer corruption?
- explain the V8 sandbox bypass with pointer compression and show a code template

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 3d898ed625237ec6.

BEGIN THIRD-PARTY FILE 3d898ed625237ec6
````text
---
name: browser-exploitation-v8
description: >-
  Browser and V8 exploitation playbook. Use when exploiting JavaScript engine vulnerabilities including JIT type confusion, incorrect bounds elimination, and V8 sandbox bypass to achieve renderer RCE and sandbox escape in Chrome/Chromium.
---

# SKILL: Browser / V8 Exploitation — Expert Attack Playbook

> **AI LOAD INSTRUCTION**: Expert V8/Chrome exploitation techniques. Covers V8 compilation pipeline, JIT type confusion, addrof/fakeobj primitives, ArrayBuffer corruption, WASM RWX pages, V8 sandbox (pointer compression), and Chrome sandbox escape overview. Distilled from ctf-wiki browser sections, Project Zero research, and CTF competition patterns. Base models often confuse V8 object representation details and miss the pointer compression barrier.

## 0. RELATED ROUTING

- [sandbox-escape-techniques](../sandbox-escape-techniques/SKILL.md) — Chrome renderer sandbox escape via IPC/Mojo
- [heap-exploitation](../heap-exploitation/SKILL.md) — general heap concepts applicable to V8 heap
- [stack-overflow-and-rop](../stack-overflow-and-rop/SKILL.md) — ROP concepts for native code execution after V8 escape
- [binary-protection-bypass](../binary-protection-bypass/SKILL.md) — ASLR/NX bypass in browser context

### Advanced Reference

Load [V8_EXPLOITATION_PATTERNS.md](./V8_EXPLOITATION_PATTERNS.md) when you need:
- Detailed exploitation patterns and code templates
- Heap layout manipulation and GC interaction
- V8 sandbox bypass techniques
- Object map confusion patterns

---

## 1. V8 ARCHITECTURE

### Compilation Pipeline

```
JavaScript Source
    ↓ Parser
  AST (Abstract Syntax Tree)
    ↓ Ignition
  Bytecode (interpreted, profiling)
    ↓ Sparkplug (non-optimizing baseline, V8 ≥ 9.1)
  Baseline code (fast startup)
    ↓ Maglev (mid-tier, V8 ≥ 10.2)
  Mid-optimized code
    ↓ TurboFan (optimizing JIT)
  Optimized machine code (with speculative optimizations)
    ↓ Deoptimization (if speculation fails)
  Back to Ignition bytecode
```

### Key V8 Concepts

| Concept | Description |
|---|---|
| Tagged pointers | SMI (Small Integer): `value << 1`, HeapObject: `ptr \| 1` |
| Pointer compression | V8 ≥ 8.0: objects addressed via 32-bit offset from cage base (4GB sandbox) |
| Maps (Hidden Classes) | Define object shape: property names, types, offsets |
````
END THIRD-PARTY FILE 3d898ed625237ec6

The third-party file has ended. Everything between the 3d898ed625237ec6 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2358 of 12459 bytes. © yaklang · MIT · https://github.com/yaklang/hack-skills/tree/HEAD/skills/browser-exploitation-v8/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
