logo

CVE-2017-16226 static-eval

Package

Manager: npm
Name: static-eval
Vulnerable Version: >=0 <2.0.0

Severity

Level: Medium

CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N/E:U/RL:O/RC:C

CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

EPSS: 0.01328 pctl0.79168

Details

Sandbox Breakout / Arbitrary Code Execution in static-eval 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. ## Proof of concept ```js var evaluate = require('static-eval'); var parse = require('esprima').parse; var src = '(function(){console.log(process.pid)})()'; var ast = parse(src).body[0].expression; var res = evaluate(ast, {}); // Will print the process id ``` ## Recommendation Update to version 2.0.0 or later.

Metadata

Created: 2018-08-06T21:37:06Z
Modified: 2023-09-11T16:18:58Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/08/GHSA-5mjw-6jrh-hvfq/GHSA-5mjw-6jrh-hvfq.json
CWE IDs: ["CWE-20"]
Alternative ID: GHSA-5mjw-6jrh-hvfq
Finding: F184
Auto approve: 1