Intel

AIKIDO-2026-394642

toml-rb is vulnerable to Regular Expression Denial of Service (ReDoS)

GHSA-v667-mm43-5q7rPublished Oct 2, 2026
October 2, 2026

75

CVE Score

High

Regular Expression Denial of Service (ReDoS)

Are you affected? Scan for Free

TL;DR

TomlRB.parse matches basic and literal TOML strings with a regex where an optional backslash lets the engine split one input many ways, and matches comments by testing for a line break at every position. An unterminated basic string with many backslashes, or a comment with many spaces, drives catastrophic or quadratic backtracking during parsing. A small untrusted TOML document can occupy the parser for minutes of CPU time, denying service to the application that calls TomlRB.parse. The patch rewrites the string and comment grammar rules to match in linear time.

How do I fix this?

Upgrade the toml-rb library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you parse TOML documents from an untrusted or externally influenced source.

Package

Versions

0.0.1 - 4.2.1

Fixed in 4.2.2

Background info

toml-rb is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.0.1 - 4.2.1.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea