CVE-2026-25587: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-25587 is a critical sandbox escape vulnerability in SandboxJS (@nyariv/sandboxjs), a JavaScript sandboxing library for Node.js. Because Map is included in SAFE_PROTOTYPES, an attacker can access Map.prototype directly and overwrite Map.prototype.has, breaking out of the sandbox and achieving remote code execution. All versions up to and including 0.8.28 are affected; the issue was fixed in version 0.8.29, published on February 5, 2026. It carries a CVSS v3.1 base score of 10.0 (Critical) (GitHub Advisory, Security Advisory).

Technical details

The root cause is improper prototype isolation within the sandbox's allowlist (SAFE_PROTOTYPES). Because Map is whitelisted, sandboxed code can freely access Map.prototype and mutate its methods — specifically Map.prototype.has — replacing it with a trusted function like isFinite. Since isFinite is a native function, its .constructor property is Function, which can be invoked to construct and execute arbitrary code outside the sandbox context (CWE-94, CWE-74). The vulnerability is effectively a variant of CVE-2026-25142, which used __lookupGetter__ for the same effect; this variant exploits a bug in the sandbox's let variable handling that makes const the required declaration to access Map.prototype. No authentication or user interaction is required — any code path that passes untrusted input to sb.compile() is exploitable (GitHub Advisory, Security Advisory).

Impact

Successful exploitation results in complete host compromise: an attacker can execute arbitrary operating system commands in the context of the Node.js process running SandboxJS, with full impact to confidentiality, integrity, and availability. Because the scope is marked as Changed, the vulnerability crosses the security boundary of the sandbox into the host environment, enabling data exfiltration, file system manipulation, spawning reverse shells, and potential lateral movement within the network. Any application that uses SandboxJS to evaluate untrusted JavaScript — such as online code editors, plugin systems, or user-scripting platforms — is at risk (GitHub Advisory, Feedly).

Exploitability

A working proof-of-concept exploit is publicly available in the GitHub Security Advisory and requires no authentication, no privileges, and no user interaction (Security Advisory). As of the time of disclosure, there is no confirmed evidence of in-the-wild exploitation, and no threat actor attribution has been reported. The EPSS score is approximately 0.039% (12th percentile), indicating a currently low but non-negligible probability of exploitation in the near term. CVE-2026-25587 was referenced in a CISA vulnerability bulletin (SB26-040) for the week of February 2, 2026, though it has not been added to the CISA KEV catalog (CISA Bulletin).

Exploitation steps

  1. Identify target: Locate a Node.js application that uses @nyariv/sandboxjs version ≤ 0.8.28 and accepts user-controlled JavaScript input passed to sb.compile() — such as an online code runner, plugin engine, or scripting interface.
  2. Craft the payload: Construct a JavaScript snippet that uses const (not let, due to the sandbox's let implementation bug) to obtain a reference to Map.prototype, then overwrites Map.prototype.has with a trusted native function (isFinite):
const m = Map.prototype;
m.has = isFinite;
console.log(
  isFinite.constructor(
    "return process.getBuiltinModule('child_process').execSync('id').toString()",
  )(),
);
  1. Submit the payload: Pass the crafted code to the vulnerable application's sandboxed execution endpoint (e.g., via HTTP POST to an API that calls sb.compile(payload)().run()).
  2. Achieve RCE: The overwritten Map.prototype.has allows access to Function via isFinite.constructor, which is used to construct and execute arbitrary code outside the sandbox, running OS commands as the Node.js process user.
  3. Post-exploitation: Use the RCE primitive to establish a reverse shell, exfiltrate sensitive data, or pivot to other internal systems (Security Advisory).

Indicators of compromise

  • Logs: Node.js application logs showing execution of sb.compile() with inputs containing Map.prototype, isFinite.constructor, getBuiltinModule, or child_process; unexpected output from execSync calls in application stdout/stderr.
  • Process: Unusual child processes spawned by the Node.js process (e.g., sh, bash, cmd.exe, ls, id, whoami, curl, wget) that are not part of normal application behavior.
  • Network: Unexpected outbound connections from the Node.js server process to external IPs, particularly on non-standard ports, which may indicate reverse shell activity or data exfiltration.
  • File System: New or modified files in the application directory or /tmp created by the Node.js process user; presence of web shells or scripts not part of the original deployment.
  • Application: Inputs to the sandboxed execution endpoint containing the strings Map.prototype, isFinite.constructor, getBuiltinModule, or child_process in request bodies or query parameters (Security Advisory).

Mitigation and workarounds

The primary remediation is to upgrade @nyariv/sandboxjs to version 0.8.29 or later, which hardens the sandbox against prototype-based escape techniques by restricting access to prototype chains of whitelisted objects (Security Advisory, Patch Commit). For systems that cannot patch immediately, restrict network access to any service that exposes SandboxJS-based code execution, and avoid passing untrusted user input to sb.compile(). Audit all dependencies on @nyariv/sandboxjs versions prior to 0.8.29 across your codebase and CI/CD pipelines.

Community reactions

SecurityOnline.info covered this vulnerability as part of a broader report on four critical SandboxJS flaws with CVSS 10.0 scores, highlighting the risk of host takeover (SecurityOnline). The Hacker Wire published a dedicated article on the sandbox escape via Map.prototype overwrite and shared it on Mastodon and Bluesky, generating community discussion (The Hacker Wire). Purple Ops also featured the vulnerability in their "Hottest CVEs" series (Purple Ops). The vulnerability was discovered and reported by researcher c0rydoras (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-gvwc-5hr5-44p8HIGH7.5
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5jh3-w3fj-6758LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-5v8x-rm7w-m4c7LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-7pqp-3q23-mwr8LOW3.7
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026
GHSA-3qg4-7mq2-gm93MEDIUMN/A
  • JavaScript logoJavaScript
  • probe-image-size
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management