CVE-2026-25881 is a sandbox escape in SandboxJS before 0.8.31, rated 9.0. Sandboxed code can modify the host's built-in prototypes by passing a protected reference through an array literal. That pollution may lead to code execution. Upgrade to 0.8.31. Restart long running processes after you upgrade.
What's affected
- Package: @nyariv/sandboxjs on npm.
- Affected: versions up to and including 0.8.30.
- Fixed: 0.8.31.
- Exposure: applications that run untrusted code inside the sandbox and have code paths that use polluted properties in a sensitive call.
How to check if you're exposed
List every installed copy of the package in your projects:
npm ls @nyariv/sandboxjs
pnpm why @nyariv/sandboxjs
Then check whether any code you ship hands untrusted scripts to the sandbox. Without that, an attacker has no way in, but the library should still be upgraded.
What to do now
- Upgrade to @nyariv/sandboxjs 0.8.31 or later and regenerate lockfiles.
- Restart long running processes, because prototype changes made by earlier code persist in memory until restart.
- Stop running untrusted code in the sandbox until you are patched.
- Audit the host application for places where object properties feed into process or command execution calls.
- Move untrusted code to a separate process or container with no secrets.
Why it matters
The class is prototype pollution, CWE-1321. The sandbox marks references to global objects with a flag called isGlobal so that they cannot be changed. The advisory explains that the flag is lost when a value goes into an array literal and comes back out, so a protected prototype looks like an ordinary object and can be modified.
The change is persistent on the host, and it becomes dangerous when other code reads a polluted property in a sensitive place. The advisory gives a call to a command runner as an example gadget. This is the second SandboxJS escape in this batch, after CVE-2026-25641, so plan on version 0.8.31 or later. The record does not mark it as exploited in the wild.
How to prioritise the fix
Treat this as a follow up to CVE-2026-25641. Both are SandboxJS escapes, so if you patched the first one in a hurry and stopped at 0.8.29, you are still exposed here. Make 0.8.31 your target and verify it in every lockfile.
Prototype pollution is easy to underrate because it needs a second piece, a place in your own code where a polluted property reaches something dangerous. Search your host application for code that builds command lines or file paths from object properties that were never set explicitly. Those are the gadgets the advisory warns about.
A dependency scan answers the first question, which is whether the package is present at all. Reachability analysis answers the second, which is whether your code calls the vulnerable path. You can start with the free scan at gold.safeguard.sh/scan and then read the Gold entry for this CVE to see affected ranges.
Try it yourself
Click through it at your own pace, or open it full screen.
Quick check
Why restart after upgrading?
Prototype changes live in the running process. A patch stops new pollution but does not undo what an earlier run already changed.
How is this related to CVE-2026-25641?
Both are SandboxJS escapes through different mechanisms. The earlier one is fixed in 0.8.29 and this one in 0.8.31.
Sources
Last reviewed: 19 October 2026.