Back to Blog
high SEVERITY4 min read

smol-toml 1.7.0 DoS: Malformed TOML Documents Crash Parser

A denial-of-service vulnerability in smol-toml 1.7.0 allows attackers to crash the parser by supplying malformed TOML documents. The vulnerability affects any application that parses untrusted TOML input. The fix, available in smol-toml 1.7.1, hardens input validation and error recovery.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published September 25, 2026•Reviewed September 25, 2026

Answer Summary

smol-toml versions before 1.7.1 contain a denial-of-service vulnerability triggered by malformed TOML documents. An attacker can supply specially crafted TOML input that causes the parser to crash or hang, disrupting service availability. The vulnerability is fixed in smol-toml 1.7.1 by improving the parser's robustness against malformed input. CWE is unknown.

Vulnerability at a Glance

cweN/A
fixUpgrade smol-toml from 1.7.0 to 1.7.1
riskUntrusted TOML input can crash the parser, causing application downtime
languageJavaScript (TypeScript)
root causeInsufficient validation and error recovery for malformed TOML syntax
vulnerabilityDenial of Service (DoS) via malformed input

smol-toml 1.7.0 DoS: Malformed TOML Documents Crash Parser

Summary

A denial-of-service vulnerability in smol-toml 1.7.0 allows attackers to crash the parser by supplying malformed TOML documents. Applications that parse untrusted TOML input—such as user-provided configuration files or API payloads—are vulnerable to service disruption. The vulnerability is fixed in smol-toml 1.7.1.

Affected Versions

Affected < 1.7.1
Fixed in 1.7.1
Ecosystem npm
CVE / GHSA CVE-2026-85730
CWE unknown

The Vulnerability Explained

The smol-toml parser, commonly used in Node.js applications to parse TOML configuration files and data formats, contains insufficient input validation when processing malformed TOML documents. When the parser encounters certain types of malformed syntax—such as incomplete key-value pairs, unclosed brackets, or invalid escape sequences—it fails to recover gracefully. Instead of returning a parse error, the parser may crash or enter an infinite loop, causing the entire application to hang or terminate.

This vulnerability becomes critical in scenarios where applications accept TOML input from external sources:

  • Configuration management tools that accept config files from users or CI/CD pipelines
  • API servers that parse TOML payloads in request bodies
  • Document converters that process TOML files uploaded by users
  • Package managers or build tools that read dependency manifests in TOML format

An attacker with the ability to supply a malformed TOML document can trigger a denial of service with minimal effort—no special privileges, no code execution, just a crafted text file.

Attack Scenario

Consider a web service that allows users to upload TOML configuration profiles:

const toml = require('smol-toml');

app.post('/upload-config', (req, res) => {
  const configFile = req.body.config; // User-supplied TOML string
  const parsed = toml.parse(configFile); // Vulnerable call
  // Process the configuration...
});

An attacker submits a specially malformed TOML document, such as:

[section
key = "value"
[[array
item = 1

The parser in version 1.7.0 crashes when it encounters the unclosed brackets and invalid syntax, causing the entire service to become unresponsive. No error is caught; the application terminates or hangs indefinitely.

The Fix

The fix in smol-toml 1.7.1 improves the parser's robustness by:

  1. Enhanced input validation: The parser now checks for syntactic completeness before processing tokens.
  2. Better error recovery: Malformed structures are now caught and reported as parse errors rather than causing crashes.
  3. Bounds checking: The parser validates array and table boundaries more strictly.

The upgrade from 1.7.0 to 1.7.1 is reflected in the dependency manifest:

- "smol-toml": "^1.3.1",
+ "smol-toml": "^1.7.1",

This single-line change in package.json pulls in the patched version that handles malformed TOML gracefully. The parser now returns a clear error message for invalid syntax instead of crashing the application.

Real-World Impact

Before the fix: A user uploads a typo-ridden TOML config file. The application crashes immediately, affecting all users until the process restarts. Attackers can weaponize this into a denial-of-service attack by automating malformed uploads.

After the fix: The same malformed file is rejected with a descriptive parse error. The application logs the error, continues running, and can respond with a helpful message to the user.

How Orbis AppSec Detected This

Source: User-supplied TOML input passed to the parse() method via HTTP requests, file uploads, or configuration APIs.

Sink: The smol-toml.parse() function, which processes the TOML string without sufficient pre-validation.

Missing control: The parser lacked comprehensive error handling for incomplete or syntactically invalid TOML structures, allowing malformed input to trigger unhandled exceptions or infinite loops instead of returning a parse error.

CWE: N/A (unknown)

Fix: Upgrade smol-toml from 1.7.0 to 1.7.1, which hardens the parser's input validation and error recovery logic.

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Key Takeaways

  • Always validate TOML input at the application boundary: Even if a parser claims to handle errors, test your code with malformed input to ensure it fails safely.
  • Treat parser crashes as security issues: A parser that crashes on unexpected input is a denial-of-service vulnerability waiting to be exploited.
  • Keep parser dependencies up to date: Parsing libraries are frequently updated to fix robustness issues. smol-toml 1.7.1 specifically hardens against the attack patterns that crashed 1.7.0.
  • Monitor for parse errors in production: Log and alert on parse failures; they may indicate an active denial-of-service attempt.
  • Test with fuzzing tools: Use tools like AFL or libFuzzer on your TOML parser with malformed inputs to find crashes before attackers do.

Conclusion

CVE-2026-85730 demonstrates why robust error handling in parsers is a security concern, not just a quality-of-life feature. Upgrading smol-toml to 1.7.1 eliminates the denial-of-service risk for any application parsing untrusted TOML input. The fix is a simple dependency update with no breaking changes—deploy it immediately if you use smol-toml in production.

Prevention and further reading

Frequently Asked Questions

What versions of smol-toml are vulnerable to CVE-2026-85730?

Version 1.7.0 and earlier are affected. The fix is available in 1.7.1 and later.

Can a production application that parses user-supplied TOML be exploited through a malformed config file?

Yes. Any application using smol-toml to parse untrusted TOML documents (config files, API payloads, user uploads) is at risk of denial of service.

Does upgrading from 1.7.0 to 1.7.1 require code changes in my application?

No. The fix is a drop-in replacement; the public API remains unchanged.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #3

Related Articles

high

picomatch 2.3.1 ReDoS: Extglob Pattern Catastrophic Backtracking

picomatch versions below 2.3.2, 3.0.2, or 4.0.4 contain a Regular Expression Denial of Service vulnerability in extglob pattern parsing. An attacker can cause catastrophic backtracking with patterns containing nested alternations and quantifiers, freezing any Node.js process that evaluates untrusted glob expressions.

critical

pet-window.js Dynamic Code Evaluation: CWE-94 Hardening via Number

The pet-window module constructed dynamic JavaScript by embedding raw configuration values into code strings. An attacker with local access could inject arbitrary JavaScript by modifying stored configuration. The fix replaces string interpolation with explicit Number() coercion and NaN validation for all numeric configuration parameters.

high

sanitizeUnicodeInput(): Fullwidth U+ Bypasses Codepoint Validation

The `sanitizeUnicodeInput()` helper used by the project character-range settings screen rewrote `U+` prefixes to `0x` and called `parseInt()`, but never normalized its argument first. Compatibility-equivalent forms such as fullwidth `U+`, superscript digits, or mathematical alphanumerics never matched the `/U\+/gi` regex, fell through to the `else return inputString` branch, and were handed back to callers verbatim as "sanitized" values. The fix inserts a `String.prototype.normalize('NFKC')` pas

high

brace-expansion Stack Exhaustion: CVE-2026-102276 Patched

A critical stack exhaustion vulnerability in brace-expansion allows attackers to crash Node.js applications by supplying specially crafted brace patterns that trigger unbounded recursion. The fix upgrades the library across all maintained version lines to enforce depth limits on recursive expansion. This vulnerability affects any service that expands user-controlled brace patterns without input validation.

critical

BFF Proxy QR Code Endpoint Prototype Pollution via Unvalidated JSON

A critical prototype pollution vulnerability in a backend-for-frontend (BFF) proxy endpoint allowed attackers to inject malicious properties into the JavaScript Object prototype by crafting JSON requests with forbidden keys. This could compromise application behavior across all objects. The fix adds explicit key validation to reject payloads containing `__proto__`, `constructor`, or `prototype`.

high

ItemPicker `_commitTraitInput` XSS via Unescaped Trait Chip Rendering

The `_commitTraitInput` function in ItemPicker accepted arbitrary user input for trait values without sanitization, then rendered those values directly into HTML chip elements through `_updateList`. An attacker could inject malicious JavaScript payloads that executed when trait chips were displayed. The fix applies a strict whitelist filter removing all non-alphanumeric characters except spaces and hyphens.