CVE-2026-34211

SandboxJS: Stack overflow DoS via deeply nested expressions in recursive descent parser

Published Apr 6, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, the @nyariv/sandboxjs parser contains unbounded recursion in the restOfExp function and the lispify/lispifyExpr call chain. An attacker can crash any Node.js process that parses untrusted input by supplying deeply nested expressions (e.g., ~2000 nested parentheses), causing a RangeError: Maximum call stack size exceeded that terminates the process. This vulnerability is fixed in 0.8.36.

Analysis

AI-generated

Technical impact

SandboxJS is a JavaScript sandboxing library that, before version 0.8.36, contains unbounded recursion in its parser. An attacker can submit deeply nested expressions (for example, about 2000 levels of parentheses) that cause the restOfExp function to recurse without limit. The stack overflow results in a RangeError: Maximum call stack size exceeded and terminates the Node.js process, interrupting any service that relies on the library. This weakness corresponds to uncontrolled recursion leading to stack overflow (CWE‑674).

Affected Systems

All installations of the @nyariv/sandboxjs package with a version earlier than 0.8.36 that parse untrusted JavaScript expressions are affected. The vulnerability is fixed in version 0.8.36 and later.

Risk and Exploitability

The vulnerability carries a CVSS score of 6.9, indicating moderate severity, and an EPSS score of less than 1%, suggesting a low likelihood of exploitation. It is not listed in the CISA KEV catalog. An attacker only needs to provide malformed input that reaches the parser; no additional privileges or remote code execution are required. If the application uses the vulnerable sanitizer in a publicly reachable context, repeated use can lead to repeated crashes and downtime.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply @nyariv/sandboxjs version 0.8.36 or later to eliminate the unbounded recursion bug
  • Implement input validation or size limits to reject expressions that are excessively nested or large before they are passed to the parser
  • Verify that no older versions remain in the dependency tree and monitor Node.js processes for unexpected crashes

Generated by OpenCVE AI on April 9, 2026 at 19:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-8pfc-jjgw-6g26 SandboxJS: Stack overflow DoS via deeply nested expressions in recursive descent parser
History
Type Values Removed Values Added
CPEs cpe:2.3:a:nyariv:sandboxjs:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Nyariv
Nyariv sandboxjs
Vendors & Products Nyariv
Nyariv sandboxjs
Type Values Removed Values Added
Description SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, the @nyariv/sandboxjs parser contains unbounded recursion in the restOfExp function and the lispify/lispifyExpr call chain. An attacker can crash any Node.js process that parses untrusted input by supplying deeply nested expressions (e.g., ~2000 nested parentheses), causing a RangeError: Maximum call stack size exceeded that terminates the process. This vulnerability is fixed in 0.8.36.
Title SandboxJS: Stack overflow DoS via deeply nested expressions in recursive descent parser
Weaknesses CWE-674
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 7, 2026, 2:09 PM
Reserved
Mar 26, 2026, 3:57 PM
Status
Analyzed
Published
Apr 6, 2026, 4:16 PM
Modified
Oct 26, 2026, 10:10 PM