Read the docs
TI-2024-39085 Aliases GHSA-pqhp-25j4-6hq9

smol-toml has a Denial of Service via malicious TOML document using deeply nested inline tables

Priority LOW 38CWE-674Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Denial of service
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-674.

Summary

### Summary An attacker can send a maliciously crafted TOML to cause the parser to crash because of a stack overflow caused by a deeply nested inline structure. A similar problem occurs when attempting to stringify deeply nested objects. The library does not limit the maximum exploration depth while parsing or producing TOML documents, nor does it offer a way to do so. ### Proof of concept ```js require("smol-toml").parse("e=" + "{e=".repeat(9999) + "{}" + "}".repeat(9999)) ``` ### 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 and therefore to properly handle errors. 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.3.1 offers a mechanism to limit the exploration depth before halting with a `TomlError` when parsing, with a default cap of 1000. A same mechanism has been implemented for stringifying objects. **Please note that the parser will *still* throw an error upon such cases.** It is, however, a now-controlled and documented behavior of the library. ### Workarounds Wrap all invocations of `parse` and `stringify` in a try/catch block.

Why it matters now

Fix Fixed smol-toml (npm): 1.3.1

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—smol-toml (npm)before 1.3.11.3.1Patch availableGHSA-pqhp-25j4-6hq9
  • smol-toml (npm) Vendor— Affected before 1.3.1 Fixed in 1.3.1 Patch available GHSA-pqhp-25j4-6hq9

Remediation

  • Fix · GHSA-pqhp-25j4-6hq9 smol-toml (npm) Fixed in 1.3.1 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-pqhp-25j4-6hq9

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences