JavaScript Sandbox Escaping

This badge covers JavaScript sandbox escape vulnerabilities. From prototype chain navigation and Function constructor abuse to vm module escapes, static-eval bypasses, real-world CVEs, and advanced proxy/interpreter bypass techniques.

22 exercises

Exercises

Easy
ptlab default badge icon
JS Sandbox: From Sandbox Escape to RCE
  • This exercise covers the standard Node.js RCE chain: process -> mainModule -> require('child_process') -> execSync.
  • Takes -- on average
  • Node.js

Easy
ptlab default badge icon
JS Sandbox: The Function Constructor
  • This exercise covers using Function(...)() as an eval alternative to execute arbitrary code in an app that blocks eval.
  • Takes -- on average
  • Node.js

Easy
ptlab default badge icon
JS Sandbox: Prototype Chain Navigation
  • This exercise covers navigating __proto__, .constructor, and .prototype from a string literal to reach the Function constructor.
  • Completed by 1 student
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: AST-Based Filtering
  • This exercise covers bypassing AST-based sandbox filtering using computed property access or Reflect.get().
  • Takes -- on average
  • Node.js

Medium
ptlab default badge icon
JS Sandbox: Keyword Blocklist Bypass
  • This exercise covers bypassing indexOf/includes blocklists with bracket notation and string concatenation.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: static-eval Destructuring Parameter Bypass
  • This exercise covers bypassing static-eval parameter validation using destructured parameters (ObjectPattern).
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: static-eval Function Property Blocked
  • This exercise covers bypassing post-2.0 static-eval that blocks member access on functions, using anonymous function bodies.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: static-eval Direct Constructor Access
  • This exercise covers exploiting the original unpatched static-eval with unrestricted property access on functions.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: vm.runInNewContext Restricted Globals
  • This exercise covers escaping vm.runInNewContext when specific safe objects are provided but frozen, using Error objects or Promise callbacks.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: vm.runInNewContext Null Prototype
  • This exercise covers escaping vm.runInNewContext when the context is created with Object.create(null) so this.constructor is undefined.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: vm.runInNewContext Empty Context
  • This exercise covers escaping Node.js vm.runInNewContext with an empty sandbox object via the constructor chain.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: Type Confusion Bypass
  • This exercise covers bypassing string sanitization by sending an object when the sanitizer expects a string.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: Regex Filter Bypass
  • This exercise covers bypassing regex filters with hex escapes, unicode escapes, or base64 decoding.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: safe-eval Constructor Chain (CVE-2017-16088)
  • This exercise covers exploiting the safe-eval library's accessible constructor chain to achieve RCE.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: vm2 Host Object Leak via Proxy (CVE-2023-32314)
  • This exercise covers exploiting vm2's Proxy wrapping to leak unwrapped host objects for sandbox escape.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: vm2 Error.prepareStackTrace (CVE-2023-37466)
  • This exercise covers exploiting V8's Error.prepareStackTrace which receives unwrapped CallSite objects from the host realm.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: JSONPath Expression Injection (CVE-2026-1615)
  • This exercise covers exploiting the jsonpath npm library which internally uses static-eval, via malicious JSONPath filter expressions.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: Template Engine Sandbox Escape
  • This exercise covers bypassing template engine expression validation via type manipulation using query string arrays.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: Prototype Pollution to Sandbox Escape
  • This exercise covers a two-step chain: exploiting prototype pollution to weaken the sandbox, then escaping it.
  • Takes -- on average
  • Node.js

Coming soon
Medium
ptlab default badge icon
JS Sandbox: n8n Expression Injection (CVE-2026-25049)
  • This exercise covers exploiting n8n's dynamic expression evaluation via type confusion and destructuring bypass.
  • Takes -- on average
  • Node.js

Coming soon
Hard
ptlab default badge icon
JS Sandbox: Proxy-Wrapped Sandbox Symbol Hooks
  • This exercise covers bypassing a Proxy-wrapped sandbox that blocks constructor, __proto__, and prototype, using Symbol.toPrimitive or type coercion.
  • Takes -- on average
  • Node.js

Coming soon
Hard
ptlab default badge icon
JS Sandbox: Custom JS Subset Interpreter
  • This exercise covers finding implementation flaws in a custom JS expression evaluator, including missing __proto__ checks and insufficient scope isolation.
  • Takes -- on average
  • Node.js