Executive brief
smol-toml is a JavaScript library used to parse TOML configuration files, a common data format used in many applications. When given a malformed TOML document (as small as 7 bytes: `a=[1 #`), the parser enters an infinite loop that freezes the application and consumes all available CPU resources. Any service that parses untrusted TOML input is vulnerable to complete denial of service, making the application unresponsive to legitimate users.
Technical details
The vulnerability is an infinite loop (CWE-835) in the TOML parser's internal loop condition handling. When a value inside an array or inline table is followed by a comment that ends the document without a trailing newline, the parser fails to properly detect the end-of-structure condition. Instead of throwing a TomlError, it resets its cursor to the beginning of the input string and re-enters the loop, repeating indefinitely. The attack vector is network/local—any code path that calls parse() with untrusted input is exploitable. No authentication or privileges are required. The fix is provided in version 1.7.1, which properly breaks out of the loop and throws the expected error.
Affected products
- squirrelchat smol-toml <= 1.7.0
Timeline
- 2026-08-09: disclosed
- 2026-08-09: patched: Version 1.7.1 released with fix
- 2026-09-09: advisory: GitHub Security Advisory published