Skip to content

GHSA-7w5x-hrqm-74c2 CVE-2026-85730

smol-toml: Denial of Service via malformed TOML documents

High npm
Severity
8.2 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.52%
Chance of exploitation in the next 30 days. Higher than 44.42% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-606 Unchecked Input for Loop Condition
CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop')
Fix
1.7.1
Upgrade smol-toml to this version or later

Description

Summary

parse() can be forced into an infinite loop when a value inside an array or inline table is followed by a comment that has no trailing newline (i.e. the comment "ends" the document).

The library fails to exit an internal loop when attempting to find the end of the structure, resetting its cursor to the beginning of the string instead. This causes the parser to indefinitely hang, compromising the availability of the service.

Proof of concept

import { parse } from 'smol-toml'
parse('a=[1 #')   // never returns; CPU pinned at 100%

Impact

Applications which parse arbitrary TOML documents can suffer major availability issues if they receive malicious input. This issue is particularly severe for these use-cases, and it is strongly advised to upgrade to an up-to-date version of the library as soon as possible.

If your use-case does not involve parsing arbitrary TOML documents from untrusted sources, the impact is much lower in practice, although it's still advisable to update to version 1.7.1.

Patches

Version 1.7.1 properly breaks out of the loop in these situations and throws the expected TomlError.

Workarounds

None that don't involve refactors. Update the library as soon as possible if your use-case involves parsing arbitrary TOML documents from untrusted sources.

Reported By : Ravindu Lakmina Munaweera

Affected versions

npm

PackageVulnerableFixed in
smol-toml
<= 1.7.0
No fix yet
smol-toml
< 1.7.1
1.7.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

smol-toml npm → 1.7.1

npm
npm install smol-toml@1.7.1
yarn
yarn add smol-toml@1.7.1
pnpm
pnpm add smol-toml@1.7.1

Severity breakdown

CVSS 4.0 8.2

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

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

Weakness

CWE-606: Unchecked Input for Loop Condition

The product does not properly check inputs that are used for loop conditions, potentially leading to a denial of service or other consequences because of excessive looping.

How to prevent it
  • Implementation: Do not use user-controlled data for loop conditions.
  • Implementation: Perform input validation.

CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')

The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-r4xh-jqrq-34v2
smol-toml: Quadratic-time parse() from parseKey rescanning to end of document on each key line
Medium Also affects smol-toml
GHSA-v3rj-xjv7-4jmq
smol-toml: Denial of Service via TOML documents containing thousands of consecutive commented lines
Medium Also affects smol-toml
GHSA-pqhp-25j4-6hq9
smol-toml has a Denial of Service via malicious TOML document using deeply nested inline tables
Medium Also affects smol-toml
GHSA-m93f-wj8c-rp8p
Microsoft Security Advisory CVE-2026-62901 – .NET Denial of Service Vulnerability
High Same weakness, CWE-606
GHSA-rhh3-jpg6-66xh
Mermaid radar diagrams are vulnerable to DoS
Medium Same weakness, CWE-606
GO-2026-5037
Inefficient candidate hostname parsing in crypto/x509
Medium Same weakness, CWE-606
GHSA-685m-2w69-288q
protobuf.js: Denial of service through unbounded protobuf recursion
High Same weakness, CWE-606
GO-2026-4986
Quadratic string concatentation in consumeComment in net/mail
High Same weakness, CWE-606

Credits: Ravi-lk

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor