Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. smol-toml
  4. ›
  5. GHSA-r4xh-jqrq-34v2

GHSA-r4xh-jqrq-34v2: smol-toml: Quadratic-time parse() from parseKey rescanning to end of document on each key line

October 5, 2026

parse() has a quadratic-time path in parseKey, reachable on default options with ordinary valid input. For every key line and table-header line, parseKey (dist/struct.js, lines 58 and 86) finds the dotted-key separator with ctx.s.indexOf('.', ctx.p), where ctx.s is the whole document. When a key has no . ahead of it, that search runs all the way to the end of the input, and the result is then clamped back to the line terminator endPtr - so everything scanned past the current line is wasted. parseKey runs once per line, so a document of N dot-free keys costs O(n^2).

The most ordinary TOML shape triggers it: a flat list of key = value lines, or a repeated [[a]] table. No dotted keys, no special options, valid input throughout.

References

  • github.com/advisories/GHSA-r4xh-jqrq-34v2
  • github.com/squirrelchat/smol-toml/commit/99102aa57fc932f760ea9c15b4cf1c181f952d24
  • github.com/squirrelchat/smol-toml/releases/tag/v1.9.0
  • github.com/squirrelchat/smol-toml/security/advisories/GHSA-r4xh-jqrq-34v2

Code Behaviors & Features

Detect and mitigate GHSA-r4xh-jqrq-34v2 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.9.0

Fixed versions

  • 1.9.0

Solution

Upgrade to version 1.9.0 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-407: Inefficient Algorithmic Complexity

Source file

npm/smol-toml/GHSA-r4xh-jqrq-34v2.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:05 +0000.