<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://db.gcve.eu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Tue, 20 Oct 2026 21:46:02 +0000</lastBuildDate>
    <item>
      <title>GHSA-r4xh-jqrq-34v2 — smol-toml: Quadratic-time parse() from parseKey rescanning to end of document on each key line</title>
      <link>https://db.gcve.eu/vuln/ghsa-r4xh-jqrq-34v2</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: smol-toml&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;`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(&amp;#39;.&amp;#39;, 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).&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;### Proof of concept&lt;/p&gt;
&lt;p&gt;```js
import { parse } from &amp;#39;smol-toml&amp;#39;&lt;/p&gt;
&lt;p&gt;let doc = &amp;#39;&amp;#39;
for (let i = 0; i &amp;lt; 256000; i++) doc += &amp;#39;k&amp;#39; + i + &amp;#39; = 1\n&amp;#39;&lt;/p&gt;
&lt;p&gt;console.time(&amp;#39;parse&amp;#39;)
parse(doc) // ~2.8 MB of valid TOML, default options
console.timeEnd(&amp;#39;parse&amp;#39;)
```&lt;/p&gt;
&lt;p&gt;Doubling the line count roughly quadruples the time:&lt;/p&gt;
&lt;p&gt;| lines | size | parse() |
|---|---|---|
| 32k | 0.3 MB | 0.3 s |
| 64k | 0.7 MB | 1.0 s |
| 128k | 1.4 MB | 3.5 s |
| 256k | 2.8 MB | 14 s |&lt;/p&gt;
&lt;p&gt;### 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.&lt;/p&gt;
&lt;p&gt;### Patches
Version 1.9.0 uses a differen…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: smol-toml&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;`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(&amp;#39;.&amp;#39;, 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).&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;### Proof of concept&lt;/p&gt;
&lt;p&gt;```js
import { parse } from &amp;#39;smol-toml&amp;#39;&lt;/p&gt;
&lt;p&gt;let doc = &amp;#39;&amp;#39;
for (let i = 0; i &amp;lt; 256000; i++) doc += &amp;#39;k&amp;#39; + i + &amp;#39; = 1\n&amp;#39;&lt;/p&gt;
&lt;p&gt;console.time(&amp;#39;parse&amp;#39;)
parse(doc) // ~2.8 MB of valid TOML, default options
console.timeEnd(&amp;#39;parse&amp;#39;)
```&lt;/p&gt;
&lt;p&gt;Doubling the line count roughly quadruples the time:&lt;/p&gt;
&lt;p&gt;| lines | size | parse() |
|---|---|---|
| 32k | 0.3 MB | 0.3 s |
| 64k | 0.7 MB | 1.0 s |
| 128k | 1.4 MB | 3.5 s |
| 256k | 2.8 MB | 14 s |&lt;/p&gt;
&lt;p&gt;### 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.&lt;/p&gt;
&lt;p&gt;### Patches
Version 1.9.0 uses a differen…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/ghsa-r4xh-jqrq-34v2</guid>
    </item>
  </channel>
</rss>
