{"id":"CVE-2017-16226","aliases":["CVE-2017-16226","GHSA-5mjw-6jrh-hvfq"],"related":[],"kind":"vulnerability","state":"published","title":"Sandbox Breakout / Arbitrary Code Execution in static-eval","summary":"The static-eval module is intended to evaluate statically-analyzable expressions. In affected versions, untrusted user input is able to access the global function constructor, effectively allowing arbitrary code execution.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The static-eval module is intended to evaluate statically-analyzable expressions. In affected versions, untrusted user input is able to access the global function constructor, effectively allowing arbitrary code execution.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"El módulo static-eval está diseñado para evaluar expresiones analizables de forma estática. En las versiones afectadas, las entradas de usuario no fiables pueden acceder al constructor de función global, lo que permitiría la ejecución de código arbitrario.","source":"nvd"}],"published":"2018-06-07T02:00:00.000Z","modified":"2026-06-17T01:09:00.570Z","severity":{"scorer":"NVD","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"<=1.1.1","status":"affected"}],"vendor":"HackerOne","product":"static-eval node module node module","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.0"}],"ecosystem":"npm","package":"static-eval","purl":"pkg:npm/static-eval","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.0.0"}],"vendor":"static-eval_project","product":"static-eval","cpe":"cpe:2.3:a:static-eval_project:static-eval:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://nodesecurity.io/advisories/548","tags":["exploit","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://maustin.net/articles/2017-10/static_eval","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/substack/static-eval/pull/18","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2017-16226","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-5mjw-6jrh-hvfq","tags":["advisory"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/advisories/548","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"hackerone","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2017-16226","url":"https://www.cve.org/CVERecord?id=CVE-2017-16226","licence":"CVE Terms of Use","modified":"2024-09-16T16:38:08.513Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5mjw-6jrh-hvfq","url":"https://github.com/advisories/GHSA-5mjw-6jrh-hvfq","licence":"CC-BY-4.0","modified":"2023-11-08T03:59:12.567Z"},{"source":"nvd","name":"NVD","id":"CVE-2017-16226","url":"https://nvd.nist.gov/vuln/detail/CVE-2017-16226","licence":"Public domain","modified":"2026-06-17T01:09:00.570Z"}],"updatedAt":"2026-11-25T22:57:35.528Z","epss":{"score":0.03474,"percentile":0.89392,"date":"2026-12-01T12:00:22.000Z"}}