Intel

AIKIDO-2026-394642

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

Regular Expression Denial of Service (ReDoS)GHSA-v667-mm43-5q7r Published 5 days ago

75

High Risk

This Affects:

RUBYtoml-rb
0.0.1 - 4.2.1
Fixed in 4.2.2
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.

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.

Background info

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

How to fix this

Upgrade the toml-rb library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform