CVE-2026-85730: smol-toml Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-7w5x-hrqm-74c2
CWE-606 CWE-835
Published
Advisory Summary

CVE-2026-85730 is a HIGH denial of service vulnerability (CWE-606: Unchecked Input for Loop Condition) affecting smol-toml libraries in the npm ecosystem. The issue involves denial of service via malformed toml documents. Remediation is available by upgrading affected packages to version 1.7.1.

CVE-2026-85730 at a Glance

CVE Identifier CVE-2026-85730
GHSA Identifier GHSA-7w5x-hrqm-74c2
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-606: Unchecked Input for Loop Condition
Affected Product smol-toml
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-85730

To remediate this vulnerability, upgrade all affected smol-toml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

smol-toml fixed: 1.7.1
npm install smol-toml@1.7.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls smol-toml

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-85730, inspect your project dependencies using npm:

npm ls smol-toml

Analyze the terminal output to locate any version of smol-toml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.1), your application is affected.

Note: The npm ls smol-toml command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-606: Unchecked Input for Loop Condition, where 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. In smol-toml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 ```js 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](https://www.linkedin.com/in/ravindulakmina/)

CVE-2026-85730 Affected smol-toml Versions

1 component(s)
Fixed Versions:
1.7.1
Product / Package Ecosystem Affected Versions Fixed Version
smol-toml
npm
< 1.7.1
1.7.1

References

Frequently Asked Questions

What is CVE-2026-85730?
CVE-2026-85730 is a security vulnerability in smol-toml involving Denial of Service via malformed TOML documents under CWE-606: Unchecked Input for Loop Condition.
Which smol-toml versions are affected?
Affected versions include releases prior to 1.7.1 across affected packages: smol-toml.
What version fixes CVE-2026-85730?
Upgrading to 1.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is smol-toml affected?
Yes, smol-toml is affected in releases prior to 1.7.1. Upgrade your dependency to 1.7.1 or later.
What CWE is associated with CVE-2026-85730?
CVE-2026-85730 is classified under 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 can I check npm dependencies for CVE-2026-85730?
Run the dependency tree command: 'npm ls smol-toml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7w5x-hrqm-74c2",
  "modified" : "2026-09-09T18:07:12Z",
  "published" : "2026-09-09T18:07:11Z",
  "aliases" : [ "CVE-2026-85730" ],
  "summary" : "smol-toml: Denial of Service via malformed TOML documents",
  "details" : "### Summary\n`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).\n\nThe 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.\n\n### Proof of concept\n\n```js\nimport { parse } from 'smol-toml'\nparse('a=[1 #')   // never returns; CPU pinned at 100%\n```\n\n### Impact\n\nApplications 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.\n\nIf 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.\n\n### Patches\n\nVersion 1.7.1 properly breaks out of the loop in these situations and throws the expected `TomlError`.\n\n### Workarounds\n\nNone that don't involve refactors. Update the library **as soon as possible** if your use-case involves parsing arbitrary TOML documents from untrusted sources.\n\n\nReported By : [Ravindu Lakmina Munaweera](https://www.linkedin.com/in/ravindulakmina/)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "smol-toml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.7.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/squirrelchat/smol-toml/security/advisories/GHSA-7w5x-hrqm-74c2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-85730"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/squirrelchat/smol-toml/commit/30f5c367d946b695f379b5d4f0946b2f0a0a8c2f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/squirrelchat/smol-toml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/squirrelchat/smol-toml/releases/tag/v1.7.1"
  }, {
    "type" : "WEB",
    "url" : "https://medium.com/@ravindu.lakmina1/seven-bytes-that-freeze-a-node-js-server-forever-the-story-of-cve-2026-85730-3213328b38f0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-606", "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-09T18:07:11Z",
    "nvd_published_at" : "2026-09-04T16:18:23Z"
  }
}