Junglewise Threat Intelligence

notevil sandbox escape leading to arbitrary code execution

Severity: info · Published 2020-09-03

Technologies: notevil (npm). Vendors: npm.

Executive brief

notevil is a JavaScript library designed to safely execute untrusted code in a sandboxed environment. Versions before 1.3.2 fail to properly restrict access to the Function constructor, allowing attackers to break out of the sandbox and execute arbitrary code on the system running the application.

Technical details

The vulnerability is a sandbox escape caused by inadequate filtering of object prototype chain access. The library fails to validate return values of function calls, allowing attackers to traverse the prototype chain via Object.getOwnPropertyDescriptors() to access the Function constructor. Once obtained, the Function constructor can be invoked to execute arbitrary JavaScript code with full system access. The attack requires no authentication and operates on the input string passed to the safeEval function. The vulnerability was patched in version 1.3.2.

Affected products

  • notevil notevil before 1.3.2

Timeline

  • 2020-09-03: disclosed
  • 2020-09-03: patched: version 1.3.2 released

References

Related threats