Description
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.
Severity (CVSS)
| Base score | 7.5 |
|---|---|
| Severity | High |
| Version | CVSS 3.1 |
| Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Provided by | CNA |
Weaknesses
- CWE-674 — CWE-674: Uncontrolled Recursion
Affected products
| Vendor | Product | Versions |
|---|---|---|
| BinaryMuse | toml-node | < 4.2.0 |
References
- https://github.com/BinaryMuse/toml-node/security/advisories/GHSA-82x6-q7mm-w9cf (x_refsource_CONFIRM)
- https://github.com/BinaryMuse/toml-node/pull/72 (x_refsource_MISC)
- https://github.com/BinaryMuse/toml-node/commit/967b8b06754f3ecd9863cea118dc50792a8c353f (x_refsource_MISC)
Generated from the official CVE List on 04 Sep 2026 07:42 UTC.