Sandbox Breakout / Arbitrary Code Execution in notevil

notevil Updated 02 Oct 2025

Summary

03/09/2020
HIGH
Yes i
High
Not published

GHSA-7r5f-7qr4-pf6q: Sandbox Breakout / Arbitrary Code Execution in notevil. Affects notevil versions < 1.3.2. Fixed in 1.3.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The notevil package is an npm package used for safe evaluation of JavaScript code. It provides a sandbox environment to execute untrusted code securely. The package is designed to prevent access to sensitive JavaScript features and restrict the execution capabilities of the code being evaluated.

Vulnerability Detail

Versions of notevil prior to 1.3.2 are vulnerable to a Sandbox Escape vulnerability, which can lead to Remote Code Execution. The vulnerability arises from the package's failure to prevent access to the Function constructor. By not properly checking the return values of function calls, attackers can bypass the sandbox and access the Function prototype's constructor. This allows them to execute arbitrary code outside the intended sandbox environment. An example payload demonstrating the vulnerability is as follows:

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);

This vulnerability can have severe consequences as it allows an attacker to execute arbitrary code with the privileges of the application using the notevil package.

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

npm install notevil@1.3.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. Upgrading to the fixed version is the only recommended solution.

Conclusion

The notevil package prior to version 1.3.2 is vulnerable to a Sandbox Escape vulnerability, which can lead to Remote Code Execution. It is crucial to upgrade to the fixed version to ensure the secure execution of untrusted code. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for notevil →

Share this vulnerability

FAQ

This vulnerability allows an attacker to execute arbitrary code with the privileges of the application using the notevil package. This can lead to unauthorized access, data breaches, and potential compromise of the entire system.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground analyzes your package-lock.json file and provides real-time alerts for open-source vulnerabilities, including this one.

Yes, upgrading to version 1.3.2 or later of the notevil package fixes this vulnerability. It is recommended to update your package to the latest version to ensure the security of your application.

No, there are no known workarounds for this vulnerability. Upgrading to the fixed version is the only recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for notevil.

How To Fix

Minimum fixed version

1.3.2

This is the first release that contains the fix.

npm install notevil@1.3.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback