Junglewise Threat Intelligence

CVE-2026-25520: nyariv sandboxjs sandbox escape to RCE

CVE-2026-25520 · Severity: low · CVSS 3.1 · Published 2026-02-05

Technologies: Nyariv Sandboxjs, @nyariv/sandboxjs (npm). Vendors: Nyariv, npm.

Executive brief

SandboxJS is a JavaScript library used to safely execute untrusted code in an isolated sandbox environment. A critical flaw allows attackers to escape the sandbox and execute arbitrary system commands with full privileges on the host machine. This breaks the security guarantees of the sandboxing mechanism entirely, allowing anyone running untrusted code through this library to take complete control of the affected system.

Technical details

The vulnerability is a sandbox escape caused by improper wrapping of function return values. When functions return objects, those objects retain references to the host environment's Function constructor. An attacker can chain Object.values() or Object.entries() with Array.prototype.at() to extract the host's Function constructor, then use it to execute arbitrary code via the Function constructor's call signature. No authentication or user interaction is required; the attack is triggered simply by compiling and running malicious code through the sandbox. The root cause is insufficient isolation of return values from internal sandbox functions. A patch is available in version 0.8.29 which hardens return value wrapping to prevent constructor access.

Affected products

  • nyariv sandboxjs <=0.8.28

Timeline

  • 2026-02-05: disclosed
  • 2026-02-05: patched: Fixed in version 0.8.29

References

Related threats