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

Source: https://junglewise.ai/threats/cve-2026-77465-toml-node-uncontrolled-recursion-in-parser  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/toml). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://api.github.com/users/seok-hee97](https://api.github.com/users/seok-hee97)
- [https://github.com/seok-hee97](https://github.com/seok-hee97)
- [https://api.github.com/users/seok-hee97/gists%7B/gist_id%7D](https://api.github.com/users/seok-hee97/gists%7B/gist_id%7D)
- [https://api.github.com/users/seok-hee97/repos](https://api.github.com/users/seok-hee97/repos)
- [https://avatars.githubusercontent.com/u/98581131?v=4](https://avatars.githubusercontent.com/u/98581131?v=4)
- [https://api.github.com/users/seok-hee97/events%7B/privacy%7D](https://api.github.com/users/seok-hee97/events%7B/privacy%7D)

## Related threats

- [toml-node denial of service in integer parsing](https://junglewise.ai/threats/cve-2026-114144-toml-node-is-a-toml-parser-for-node-js-and-the-browser-prior-to)
- [toml-node TOML parser ReDoS in dotted key processing](https://junglewise.ai/threats/cve-2026-114143-toml-node-is-a-toml-parser-for-node-js-and-the-browser-prior-to)
- [toml-node ReDoS in TOML parser array-of-tables header processing](https://junglewise.ai/threats/cve-2026-114141-toml-node-is-a-toml-parser-for-node-js-and-the-browser-prior-to)
- [npm toml prototype pollution via __proto__ desynchronization](https://junglewise.ai/threats/cve-2026-63376-npm-toml-prototype-pollution-via-proto-desynchronization)
