CVE-2026-77465: toml-node uncontrolled recursion in parser

CVE-2026-77465 · Severity: high · CVSS 7.5 · Published 2026-09-03

The toml package, a widely-used Node.js TOML configuration file parser with ~47 million monthly downloads, crashes when parsing deeply nested arrays or inline tables. An attacker can send a small malicious TOML document (~5–6 KB) containing thousands of nested brackets to crash the entire parsing process, causing denial of service to any application that accepts user-supplied TOML input, such as configuration upload endpoints or APIs.

Technologies: toml (npm). Vendors: npm.

Quick answers

Is CVE-2026-77465 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-77465 being exploited in the wild.
How severe is CVE-2026-77465?
High severity, with a CVSS score of 7.5, published 3 September 2026.
Which products and versions are affected?
toml (npm) < 4.2.0, SEMVER:introduced=0,fixed=4.2.0.
Is there a fix for CVE-2026-77465?
Yes. toml (npm): upgrade to 4.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-77465 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-77465?
Check whether you run toml (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • toml (npm): upgrade to 4.2.0 or later
    npm install toml@4.2.0

Technical details

The vulnerability is an uncontrolled recursion (CWE-674) in the Peggy-generated recursive-descent parser (lib/parser.js). The parser's value rule mutually recurses with array and inline_table rules without depth tracking: peg$parsevalue() calls peg$parsearray(), which calls peg$parsevalue() back, and similarly for inline tables via peg$parseinline_table_entry(). A deeply nested TOML input (e.g., a=[[[…]]]) causes call stack exhaustion and throws a RangeError. An attacker sends a ~6 KB TOML payload with 2,500–3,000 levels of nesting via a network request (e.g., HTTP POST to a /config endpoint). The RangeError bypasses typical parse-error handlers (which expect SyntaxError) and propagates as an uncaught exception, crashing the worker process. No authentication or user interaction is required; the fix is available in version 4.2.0 (add input validation or grammar-level depth guards).

Affected products

  • BinaryMuse toml < 4.2.0

Identifiers

  • CVE-2026-77465
  • GHSA-82x6-q7mm-w9cf

Timeline

  • 2026-07-13: disclosed: Published as GitHub Advisory (first published)
  • 2026-09-03: advisory: GitHub Advisory updated
  • 2026-07-13: patched: Fixed in version 4.2.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.