# notevil sandbox breakout and prototype pollution

Source: https://junglewise.ai/threats/notevil-sandbox-breakout-and-prototype-pollution-774266f0  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-04. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2020-09-04

notevil is a JavaScript library designed to safely evaluate untrusted code in a sandboxed environment. Versions prior to 1.3.3 contain a vulnerability that allows attackers to escape the sandbox and pollute the Function prototype, potentially enabling arbitrary code execution or manipulation of global objects across an application.

Technologies: [notevil (npm)](https://junglewise.ai/threats/technologies/notevil). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 4 September 2020.

**Which products and versions are affected?** notevil (npm) SEMVER:introduced=0,fixed=1.3.3.

**Is there a fix for This vulnerability?** Yes. notevil (npm): upgrade to 1.3.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run notevil (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- notevil (npm): upgrade to 1.3.3 or later

  ```sh
  npm install notevil@1.3.3
  ```


## Technical details

The vulnerability is a sandbox escape leading to prototype pollution (CWE-1321) in notevil versions before 1.3.3. The package fails to properly restrict access to the main JavaScript context. An attacker can craft a malicious payload—such as try{a[b];}catch(e){e.constructor.constructor('return __proto__.arguments.callee.__proto__.polluted=true')()}—that leverages error handling and constructor chains to add or modify the Function prototype. This allows pollution of global object properties, affecting all code running in the same context. The attack requires the ability to pass untrusted code to notevil's evaluation function; no authentication is needed. The fix is available in version 1.3.3 and later.

## Affected products

- notevil notevil <1.3.3

## Timeline

- 2020-09-04: disclosed
- 2020-09-04: patched: Fix available in version 1.3.3 and later

## References

- [https://www.npmjs.com/advisories/1338](https://www.npmjs.com/advisories/1338)

## Related threats

- [notevil sandbox escape via prototype pollution](https://junglewise.ai/threats/cve-2021-23771-notevil-sandbox-escape-via-prototype-pollution)
- [notevil sandbox escape leading to arbitrary code execution](https://junglewise.ai/threats/notevil-sandbox-escape-leading-to-arbitrary-code-execution-478eee1f)
