CVE-2026-77465
nicheUncontrolled Recursion Stack Exhaustion DoS in toml-node TOML Parser
CVE-2026-77465 is an uncontrolled recursion flaw (CWE-674) in toml-node, a TOML parser for Node.js and the browser: the Peggy 5.1.0-generated recursive-descent parser in lib/parser.js recurses through nested arrays and inline tables (peg$parsevalue, peg$parsearray, peg$parseinline_table_entry) with no depth limit. A remote, unauthenticated attacker who can make an application parse an attacker-controlled TOML document — for example via an API endpoint, uploaded config, or message body — can include a few thousand nested arrays or inline tables to exhaust the Node.js call stack. The failure surfaces as an unexpected RangeError instead of the parser's normal SyntaxError, which can terminate an unprotected request worker or the entire process, resulting in denial of service (no confidentiality or integrity impact). Any application or service running toml-node prior to version 4.2.0 to parse untrusted TOML is affected; the fix is in version 4.2.0. There is currently no known exploitation, no public proof-of-concept, and no CISA KEV listing, with EPSS estimating roughly a 0.4% chance of exploitation within 30 days.
What to do: Upgrade to toml-node 4.2.0 or later (update the "toml" npm dependency, including transitive usage — check with npm ls toml). As interim mitigation, pre-validate or cap the nesting depth of untrusted TOML input before calling toml.parse(), and run parsing in an isolated worker so a RangeError-driven crash cannot take down the main process or request worker.
| toml-node project (npm package "toml") toml-node TOML parser for Node.js and the browser | all versions prior to 4.2.0 (fixed in 4.2.0) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
toml-node is a TOML parser for Node.js and the browser. Prior to 4.2.0, toml.parse() uses a Peggy 5.1.0 generated recursive-descent parser in lib/parser.js whose peg$parsevalue, peg$parsearray, and peg$parseinline_table_entry functions recurse through nested arrays and inline tables without a depth limit. A remote unauthenticated application parsing an attacker-controlled TOML document containing a few thousand nested arrays or inline tables can exhaust the Node.js call stack, raise an unexpected RangeError rather than the parser's SyntaxError, and terminate an unprotected request worker or process. The corresponding grammar source is src/toml.pegjs, where the generated parser must be bounded. This issue is fixed in version 4.2.0.
- Ecosystems
- npm
- Weakness
- CWE-674
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- GHSA
- GHSA-82x6-q7mm-w9cf (high)
In the news0 stories
No ingested article mentions this CVE yet.