GHSA-v3rj-xjv7-4jmq: smol-toml Denial of Service Vulnerability

MODERATE
CVSS 5.3
CWE-674
Published
Advisory Summary

GHSA-v3rj-xjv7-4jmq is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-674: Uncontrolled Recursion) affecting smol-toml libraries in the npm ecosystem. The issue involves denial of service via toml documents containing thousands of consecutive commented lines. Remediation is available by upgrading affected packages to version 1.6.1.

GHSA-v3rj-xjv7-4jmq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-v3rj-xjv7-4jmq
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-674: Uncontrolled Recursion
Affected Product smol-toml
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix GHSA-v3rj-xjv7-4jmq

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.6.1
npm install smol-toml@1.6.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 GHSA-v3rj-xjv7-4jmq, 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.6.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-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. 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 An attacker can send a maliciously crafted TOML to cause the parser to crash, because of a stack overflow caused by thousands of consecutive commented lines. The library uses recursion internally while parsing to skip over commented lines, which can be exploited to crash an application that is processing arbitrary TOML documents. ### Proof of concept ```js require("smol-toml").parse('# comment\n'.repeat(8000) + 'key = "value"') ``` ### Impact Applications which parse arbitrary TOML documents may suffer availability issues if they receive malicious input. If uncaught, the crash may cause the application itself to crash. The impact is deemed minor, as the function is already likely to throw errors on invalid input. Downstream users are supposed to properly handle errors in such situations. Due to the design of most JavaScript runtimes, the uncontrolled recursion does not lead to excessive memory usage and the execution is quickly aborted. As a reminder, it is **strongly** advised when working with untrusted user input to expect errors to occur and to appropriately catch them. ### Patches Version 1.6.1 uses a different approach for parsing comments, which no longer involves recursion. ### Workarounds Wrap all invocations of `parse` and `stringify` in a try/catch block when dealing with untrusted user input.

GHSA-v3rj-xjv7-4jmq Affected smol-toml Versions

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

References

Frequently Asked Questions

What is GHSA-v3rj-xjv7-4jmq?
GHSA-v3rj-xjv7-4jmq is a security vulnerability in smol-toml involving Denial of Service via TOML documents containing thousands of consecutive commented lines under CWE-674: Uncontrolled Recursion.
Which smol-toml versions are affected?
Affected versions include releases prior to 1.6.1 across affected packages: smol-toml.
What version fixes GHSA-v3rj-xjv7-4jmq?
Upgrading to 1.6.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.6.1. Upgrade your dependency to 1.6.1 or later.
What is the CVSS score of GHSA-v3rj-xjv7-4jmq?
GHSA-v3rj-xjv7-4jmq has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-v3rj-xjv7-4jmq?
GHSA-v3rj-xjv7-4jmq is classified under CWE-674: Uncontrolled Recursion (The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.).
How can I check npm dependencies for GHSA-v3rj-xjv7-4jmq?
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-v3rj-xjv7-4jmq",
  "modified" : "2026-03-25T21:03:56Z",
  "published" : "2026-03-25T21:03:56Z",
  "aliases" : [ ],
  "summary" : "smol-toml: Denial of Service via TOML documents containing thousands of consecutive commented lines",
  "details" : "### Summary\nAn attacker can send a maliciously crafted TOML to cause the parser to crash, because of a stack overflow caused by thousands of consecutive commented lines.\n\nThe library uses recursion internally while parsing to skip over commented lines, which can be exploited to crash an application that is processing arbitrary TOML documents.\n\n### Proof of concept\n```js\nrequire(\"smol-toml\").parse('# comment\\n'.repeat(8000) + 'key = \"value\"')\n```\n\n### Impact\nApplications which parse arbitrary TOML documents may suffer availability issues if they receive malicious input. If uncaught, the crash may cause the application itself to crash. The impact is deemed minor, as the function is already likely to throw errors on invalid input. Downstream users are supposed to properly handle errors in such situations.\n\nDue to the design of most JavaScript runtimes, the uncontrolled recursion does not lead to excessive memory usage and the execution is quickly aborted.\n\nAs a reminder, it is **strongly** advised when working with untrusted user input to expect errors to occur and to appropriately catch them.\n\n### Patches\nVersion 1.6.1 uses a different approach for parsing comments, which no longer involves recursion.\n\n### Workarounds\nWrap all invocations of `parse` and `stringify` in a try/catch block when dealing with untrusted user input.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "smol-toml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/squirrelchat/smol-toml/security/advisories/GHSA-v3rj-xjv7-4jmq"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/squirrelchat/smol-toml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/squirrelchat/smol-toml/releases/tag/v1.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-25T21:03:56Z",
    "nvd_published_at" : null
  }
}