GHSA-V3RJ-XJV7-4JMQ

GHSA-V3RJ-XJV7-4JMQ is a medium-severity security vulnerability in smol-toml (npm), affecting versions < 1.6.1. It is fixed in 1.6.1.

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

require("smol-toml").parse('# comment\n'.repeat(8000) + 'key = "value"')

Workarounds

Wrap all invocations of parse and stringify in a try/catch block when dealing with untrusted user input.

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.

GHSA-V3RJ-XJV7-4JMQ has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.6.1); upgrading removes the vulnerable code path.

Affected versions

smol-toml (< 1.6.1)

Security releases

smol-toml → 1.6.1 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Version 1.6.1 uses a different approach for parsing comments, which no longer involves recursion.

Frequently Asked Questions

  1. What is GHSA-V3RJ-XJV7-4JMQ? GHSA-V3RJ-XJV7-4JMQ is a medium-severity security vulnerability in smol-toml (npm), affecting versions < 1.6.1. It is fixed in 1.6.1.
  2. How severe is GHSA-V3RJ-XJV7-4JMQ? GHSA-V3RJ-XJV7-4JMQ has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of smol-toml are affected by GHSA-V3RJ-XJV7-4JMQ? smol-toml (npm) versions < 1.6.1 is affected.
  4. Is there a fix for GHSA-V3RJ-XJV7-4JMQ? Yes. GHSA-V3RJ-XJV7-4JMQ is fixed in 1.6.1. Upgrade to this version or later.
  5. Is GHSA-V3RJ-XJV7-4JMQ exploitable, and should I be worried? Whether GHSA-V3RJ-XJV7-4JMQ is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-V3RJ-XJV7-4JMQ is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-V3RJ-XJV7-4JMQ? Upgrade smol-toml to 1.6.1 or later.

Other vulnerabilities in smol-toml

Stop the waste.
Protect your environment with Kodem.