Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Expression-Sandbox-Escape-Simulation-Lab — Educational lab demonstrating JavaScript expression sandbox escape techniques and patch evolution through multiple vulnerable sandbox versions, with payloads and AST analysis. | Kitploit
Tools/GitHubGitHub/otakuliu/expression-sandbox-escape-simulation-lab
Static AnalysisVulnerability AnalysisExploitationWeb SecurityLearning & Education
GitHubotakuliu/expression-sandbox-escape-simulation-lab

Expression-Sandbox-Escape-Simulation-Lab

Educational lab demonstrating JavaScript expression sandbox escape techniques and patch evolution through multiple vulnerable sandbox versions, with payloads and AST analysis.

View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
16 months agoNot yet reviewed
Share

🧪 Expression Sandbox Escape – Simulation Lab

A minimal experimental environment for demonstrating JavaScript expression sandbox escape and patch evolution.

Through multiple versions of the sandbox, it implements the progression from:

Fully escapable → patching this → then patching destructuring

While preserving new bypass methods, helping to understand the real-world cat-and-mouse game between vulnerabilities and patches.


📦 Project Structure

root@kitploit:~
.
├── payload.js        # Various attack payloads
├── sandbox_v0.js     # Original vulnerable version
├── sandbox_v1.js     # Fixes the this chain
├── sandbox_v2.js     # Also fixes destructuring

🎯 Design Goals

We want to simulate this reality:

  1. The security team patches one hole
  2. The attacker finds another path
  3. Patch again
  4. Bypassed again

An endless loop.

This project is not meant to be a truly secure VM. Instead, it is meant to observe:

How each "seemingly reasonable" patch is broken by the next technique.


🚀 How to Run

root@kitploit:~
npm install vm2 acorn acorn-walk
node sandbox_vX.js

Replace X with 0 / 1 / 2.


🧨 Payload Description

payload.js includes four access methods:

NameTechnique
CVE-2025-68613 / thisObtains process via this
CVE-2026-25049 / destructuringGets constructor via object destructuring
Reflect.getUses the Reflect API
Dynamic ReflectDynamic property access

🏚 sandbox_v0 – The Bare Era

Features:

  • No restriction on this
  • No destructuring checks
  • No AST analysis

Result: All payloads pass.

Attackers are as happy as can be.


🔧 sandbox_v1 – Patching this

Changes:

  • Enforces "use strict"
  • .call(undefined)

Therefore:

root@kitploit:~
this === undefined

Blocked

  • CVE-2025-68613

Still Possible

  • destructuring
  • Reflect

The attacker nods and keeps going down another path.


🔒 sandbox_v2 – Patching destructuring

New additions:

  • AST analysis
  • Specifically checks for ObjectPattern
  • If it contains:
    • constructor
    • or a computed key → blocks execution

Blocked

  • this
  • destructuring

Still Possible

  • Reflect.get
  • Dynamic Reflect

🧠 What Is This Experiment Really Trying to Say?

Blacklist-style patching typically has:

✔ Fixes a clear path ✔ Low cost ✔ Easy to deploy

But at the same time:

❌ Limited defense surface ❌ Easily bypassed by other semantically equivalent access methods

This is exactly why sandboxes like vm2 have historically suffered repeated escapes.

Download Tool