Junglewise Threat Intelligence

CVE-2026-25881: nyariv SandboxJS sandbox escape via prototype pollution

CVE-2026-25881 · Severity: low · CVSS 3.1 · Published 2026-02-10

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

Executive brief

@nyariv/sandboxjs is a JavaScript sandbox library used to safely execute untrusted code. A critical vulnerability allows sandboxed code to escape the sandbox and modify core JavaScript built-in objects (like Map and Set prototypes) on the host system. This can lead to remote code execution if the application uses polluted properties in sensitive operations, completely breaking the isolation that the sandbox is designed to provide.

Technical details

The vulnerability is a sandbox escape caused by prototype pollution via array intermediaries (CWE-1321). The sandbox uses an isGlobal taint flag to prevent modification of global objects and prototypes; however, this flag is lost when values are extracted from array literals via the valueOrProp() function in src/executor.ts. An attacker can place a global prototype reference (e.g., Map.prototype) into an array, retrieve it, and modify it directly, bypassing all protection checks in src/utils.ts. The attack vector is network-based (untrusted code execution within the sandbox), with no authentication required. An attacker can persistently pollute host prototypes and achieve RCE if the application uses polluted properties in sensitive sinks like child_process.execSync(). The vulnerability affects all versions up to 0.8.30 and is fixed in 0.8.31.

Affected products

  • nyariv SandboxJS <= 0.8.30

Timeline

  • 2026-02-08: disclosed: Advisory published on GitHub
  • 2026-02-10: patched: Version 0.8.31 released with fix
  • 2026-02-10: advisory: GHSA-ww7g-4gwx-m7wj and CVE-2026-25881 published

References

Related threats