GitHub Advisoryadvisory · npm

GHSA-ww6v-677g-p656 Sandbox Breakout in safe-eval

CRITICAL Published 2018-07-18 Modified 2023-09-11 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