Skip to content
Source
Sign inSign up
TanStack/intent

chore(deps): update dependency smol-toml@<=1.7.0 to v1.9.0 [security] #334

Mergedrenovate[bot](GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/334/headmerged by renovate[bot](GitHub profile, opens in a new tab)

This PR contains the following updates:

PackageChangeAgeConfidence
smol-toml@<=1.7.0[1.7.1 → 1.9.0](https://renovatebot.com/diffs/npm/smol-toml@<=1.7.0/1.7.1/1.9.0)ageconfidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


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

GHSA-r4xh-jqrq-34v2

More information

Details

Summary

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.

Proof of concept
import { parse } from 'smol-toml'

let doc = ''
for (let i = 0; i < 256000; i++) doc += 'k' + i + ' = 1\n'

console.time('parse')
parse(doc) // ~2.8 MB of valid TOML, default options
console.timeEnd('parse')

Doubling the line count roughly quadruples the time:

linessizeparse()
32k0.3 MB0.3 s
64k0.7 MB1.0 s
128k1.4 MB3.5 s
256k2.8 MB14 s
Impact

Any service that runs parse() on attacker-supplied TOML can be stalled. The work is synchronous, so it blocks the whole event loop, and the quadratic is unbounded: a ~7 MB body pins a core for about a minute, larger bodies for several.

Patches

Version 1.9.0 uses a different implementation for parsing keys which is strictly linear.

Workarounds

Limit the maximum document size accepted when parsing arbitrary documents.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

    1. renovate[bot](GitHub profile, opens in a new tab) added labelsdependencies

    2. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      ⚠️ No Changeset found

      Latest commit: 3d1d8512238cede103f34499cffc39375a32c327

      Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      Click here to learn what changesets are, and how to add one.

      Click here if you're a maintainer who wants to add a changeset to this PR

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Bot user detected.

      To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration
      • Configuration used: defaults
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 440ac47a-35d9-44e3-bfb4-a517619dc466

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    4. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 47d32f4fd8481b7f2998da877a23f02e771bf9bd

      CommandStatusDurationResult
      nx run-many --targets=build✅ Succeeded<1sView ↗
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded1m 7sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-10-07 15:53:32 UTC

    5. pkg-pr-new[bot](GitHub profile, opens in a new tab)commented

      Open in StackBlitz

      npm i https://pkg.pr.new/@tanstack/intent@334

      commit: 3d1d851

    6. codspeed[bot](GitHub profile, opens in a new tab)commented

      Merging this PR will not alter performance

      ✅ 12 untouched benchmarks


      Comparing renovate/npm-smol-toml-=1.7.0-vulnerability (3d1d851) with main (c53aa59) Open in CodSpeed

Sign in to join this conversation.