CVE-2026-77465
### Summary `toml.parse()` crashes with an uncaught `RangeError: Maximum call stack size exceeded` when parsing deeply nested arrays or inline tables. The parser is generated by **Peggy 5.1.0** (a PEG parser generator) as a recursive-descent parser; the value rule mutually recurses with the array and inline-table rules with **no depth limit**, so nesting depth equal to the input depth exhausts Node's call stack. A small payload — a bare array nested a few thousand levels deep (**~5–6 KB**) — reliably crashes the process on a default Node.js configuration. `toml` has **~47 million monthly downloads**. --- ## Vulnerable Code The parser is a **generated** recursive-descent parser (`lib/parser.js`, header: `// @generated by Peggy 5.1.0.`). The recursion sink is the mutual recursion between the `value`, `array`, and `inline_table` rule functions — none carry a depth counter: ```javascript // lib/parser.js — peg$parsevalue() @ line 1008 function peg$parsevalue() { ... s0 = peg$parsearray(); // line 1017 ← value → array if (s0 === peg$FAILED) { s0 = peg$parseinline_table(); // line 1019 ← value → inline_table } ... } // peg$parsearray() @ line 2879 function peg$parsearray() { ... s3 = peg$parsevalue(); // line 2931 ← array element → value (back-edge) ... } // peg$parseinline_table() @ line 3066 → peg$parseinline_table_entry() @ line 3239 function peg$parseinline_table_entry() { ... s5 = peg$parsevalue(); // line 3266 ← inline-table value → value (back-edge) ... } ``` **Recursion cycle** for `a=[[[ … ]]]` (bare nested arrays): ``` toml.parse(src) → peg$parsevalue() # parser.js:1008 → peg$parsearray() # parser.js:1017 / 2879 → peg$parsevalue() # parser.js:2931 ← back-edge, per nested element → … # depth == input nesting → RangeError, no guard ``` Inline tables (`{arr=[ … ]}`, `{a={a= … }}`) reach the same cycle via `peg$parseinline_table` / `peg$parsein
Properties
- ghsa_id
- GHSA-82x6-q7mm-w9cf
- summary
- toml-node: Uncontrolled Recursion
- severity
- high
- cvss_score
- 7.5
- cve_id
- CVE-2026-77465
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- is_ghsa_only
- false
- ghsa_published
- 2026-09-03T20:56:13Z
- source_url
- https://github.com/advisories/GHSA-82x6-q7mm-w9cf
- ghsa_updated
- 2026-09-03T20:56:14Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph