{"id":"CVE-2026-85730","aliases":["CVE-2026-85730","GHSA-7w5x-hrqm-74c2"],"related":[],"kind":"vulnerability","state":"published","title":"smol-toml: Denial of Service via malformed TOML documents","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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/)","format":"markdown","source":"ghsa"}],"published":"2026-09-04T15:21:14.948Z","modified":"2026-09-09T21:09:13.080Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"HIGH"}],"cwes":["CWE-606","CWE-835"],"affected":[{"ranges":[{"version":"< 1.7.1","status":"affected"}],"vendor":"squirrelchat","product":"smol-toml","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.7.1"}],"ecosystem":"npm","package":"smol-toml","purl":"pkg:npm/smol-toml","source":"ghsa"}],"references":[{"url":"https://github.com/squirrelchat/smol-toml/security/advisories/GHSA-7w5x-hrqm-74c2","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/squirrelchat/smol-toml/commit/30f5c367d946b695f379b5d4f0946b2f0a0a8c2f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/squirrelchat/smol-toml/releases/tag/v1.7.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://medium.com/@ravindu.lakmina1/seven-bytes-that-freeze-a-node-js-server-forever-the-story-of-cve-2026-85730-3213328b38f0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85730","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/squirrelchat/smol-toml","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-04T17:40:28.815Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-85730","url":"https://www.cve.org/CVERecord?id=CVE-2026-85730","licence":"CVE Terms of Use","modified":"2026-09-09T16:34:08.718Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7w5x-hrqm-74c2","url":"https://github.com/advisories/GHSA-7w5x-hrqm-74c2","licence":"CC-BY-4.0","modified":"2026-09-09T18:15:04.495Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-85730","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85730","licence":"Public domain","modified":"2026-09-09T21:09:13.080Z"}],"updatedAt":"2026-11-25T22:59:36.356Z","epss":{"score":0.00451,"percentile":0.40942,"date":"2026-12-01T12:00:22.000Z"}}