ZeroHour

CVE-2026-85730

large

Infinite-loop denial of service in smol-toml TOML parser (npm)

CVSS 4.0
8.2 high
EPSS
<1%p32
Published
()
Modified
AI analysis

smol-toml, a TOML parser and serializer distributed via npm, contained a denial-of-service flaw (fixed in 1.7.1) in which parse() enters an infinite loop when a value inside an array or inline table is followed by a comment that has no trailing newline. In that case skipUntil() calls indexOfNewline(), which returns -1 at the end of input, and the helper resets the scan cursor to the beginning of the string, so the parser hangs indefinitely. An attacker who can supply TOML input to an application running an affected version gains a remote denial of service, hanging the process and consuming the service's processing capacity; the CVSS 4.0 score of 8.2 reflects high availability impact with no confidentiality or integrity impact. Any npm application or service that parses attacker-controlled TOML with smol-toml prior to 1.7.1 is affected. Exploitation has not been observed: there is no known public proof-of-concept, the flaw is not in CISA's KEV, and EPSS estimates a 0.4% probability of exploitation within 30 days.

What to do: Upgrade smol-toml to 1.7.1 or later, including updating lockfiles where it appears as a transitive dependency (search npm/yarn/pnpm lockfiles for smol-toml). Until patched, avoid parsing untrusted TOML with affected versions, or pre-screen/reject input containing comments without a trailing newline inside arrays or inline tables, and consider enforcing a parse timeout. Note the trigger condition when reviewing any service that accepts TOML configuration or user-supplied TOML input.

Affected
smol-toml (npm project) smol-toml<1.7.1 (fixed in 1.7.1)
Estimated exposure
largeon the order of hundreds of thousands of dependent projects and their deployed services (rough npm-adoption estimate; no exact install counts in the source… — smol-toml is a widely downloaded npm parsing library that is commonly pulled in transitively by JavaScript tooling and backend services, making the population of consumers plausibly in the hundreds of thousands, though this is a rough…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

smol-toml is a small, fast, and correct TOML parser and serializer. Prior to 1.7.1, parse() can enter an infinite loop when a value inside an array or inline table is followed by a comment with no trailing newline. In src/util.ts, skipUntil() calls indexOfNewline(), receives -1 at the end of input, and resets the cursor to the beginning of the string instead of leaving the structure scan. The parser then hangs indefinitely and can consume a service's processing capacity when an application parses attacker-controlled TOML. This issue is fixed in version 1.7.1.

Ecosystems
npm
Weakness
CWE-606, CWE-835
Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-7w5x-hrqm-74c2 (high)

In the news

No ingested article mentions this CVE yet.