Vulnerabilities in pkg:npm/sandbox

PACKAGE
Advisory Summary

GHSA-fm4j-4xhm-xpwx is a MODERATE sandbox breakout / arbitrary code vulnerability (General Security Weakness) affecting Sandbox libraries in the npm ecosystem. The issue involves sandbox breakout / arbitrary code execution in sandbox. Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/sandbox

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/sandbox. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-fm4j-4xhm-xpwx - MODERATE Sandbox Breakout / Arbitrary Code Execution in sandbox
GHSA-gc25-3vc5-2jf9 - CRITICAL Sandbox Breakout / Arbitrary Code Execution in sandbox

GHSA-fm4j-4xhm-xpwx at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fm4j-4xhm-xpwx
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Sandbox
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-fm4j-4xhm-xpwx

To remediate this vulnerability, upgrade all affected Sandbox dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sandbox fixed: Latest secure release
npm install sandbox@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls sandbox

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-fm4j-4xhm-xpwx, inspect your project dependencies using npm:

npm ls sandbox

Analyze the terminal output to locate any version of Sandbox in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls sandbox command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Sandbox, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-fm4j-4xhm-xpwx Affected Sandbox Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
sandbox
npm
≥ 0.0.0

References

Frequently Asked Questions

What is GHSA-fm4j-4xhm-xpwx?
GHSA-fm4j-4xhm-xpwx is a security vulnerability in Sandbox involving Sandbox Breakout / Arbitrary Code Execution in sandbox under General Security Weakness.
Which Sandbox versions are affected?
Affected versions include releases prior to current release patches across affected packages: sandbox.
What version fixes GHSA-fm4j-4xhm-xpwx?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is sandbox affected?
Yes, sandbox is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-fm4j-4xhm-xpwx?
GHSA-fm4j-4xhm-xpwx is classified under General Security Weakness.
How can I check npm dependencies for GHSA-fm4j-4xhm-xpwx?
Run the dependency tree command: 'npm ls sandbox'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fm4j-4xhm-xpwx",
  "modified" : "2026-02-02T23:13:21Z",
  "published" : "2020-09-02T15:51:34Z",
  "aliases" : [ ],
  "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.\n\n## Proof of concept\n```\nvar Sandbox = require(\"sandbox\")\ns = new Sandbox()\ncode = `new Function(\"return (this.constructor.constructor('return (this.process.mainModule.constructor._load)')())\")()(\"util\").inspect(\"hi\")`\ns.run(code)\n```\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative module until a fix is made available.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sandbox"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 1.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gf3/sandbox/issues/50"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/766"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:34:58Z",
    "nvd_published_at" : null
  }
}