js-toml is vulnerable to Regular Expression Denial of Service (ReDoS)
75
CVE Score
High
Regular Expression Denial of Service (ReDoS)
The multi-line basic string grammar in js-toml contains an ambiguous trailing repetition in the escaped-newline rule that overlaps with the enclosing content loop over the same whitespace and newline characters. When the lexer receives an unterminated multi-line basic string, it enumerates every composition of the trailing whitespace run, producing exponential regex backtracking. A short crafted document blocks the Node.js event loop for many seconds, and request-size limits give no protection because the cost roughly doubles every few input bytes. The fix removes the redundant trailing group so the accepted language is unchanged while the exponential blowup is eliminated.
Upgrade the js-toml library to the patch version.
You are affected if your application calls js-toml's load() on TOML that is externally influenced or otherwise not authored by you - for example services that accept TOML uploads, or build/CI systems that parse TOML from untrusted repositories. A crafted document under ~100 bytes (an unterminated multi-line basic string with a run of line-ending backslashes) can block the Node.js event loop for many seconds, and request-size limits give no protection. Applications that only parse their own trusted configuration files from disk are not exposed.
0.0.1 - 1.2.1
Fixed in 1.2.2js-toml is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.0.1 - 1.2.1.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.