Sandbox Escaping

Affecting safe-eval package, versions <0.4.0

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

[safe-eval] is a version of eval, claiming to be safer.

Affected versions of this package are vulnerable to Sandbox Escaping. User input is not sanitized before being passed on to the safeEval function. A malicious user could access the object constructors, allowing access to the standard library, then escaping the sandbox.

Proof of Concept:

var safeEval = require('safe-eval');
safeEval("this.constructor.constructor('return process')().exit()");

Remediation

Upgrade safe-eval to version 0.4.0 or higher.

References

CVSS Score

9.8
critical severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Credit
Alessandro Nadalin
CVE
CVE-2017-16088
CWE
CWE-265
Snyk ID
npm:safe-eval:20170830
Disclosed
30 Aug, 2017
Published
06 Sep, 2017