CVE-2025-61921: Ruby Redos Split Comma Whitespace

Splitting an untrusted string with the regular expression `/\s*,\s*/` can lead to Regular Expression Denial of Service (ReDoS) or excessive CPU consumption. An attacker providing a maliciously crafted string (e.g., many consecutive spaces without commas) can trigger worst-case execution time in the regex engine. Instead, split by the comma character literall

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Ruby
greprules fetch cve-2025-61921-ruby-redos-split-comma-whitespace --engine opengrep

Description

Splitting an untrusted string with the regular expression `/\s*,\s*/` can lead to Regular Expression Denial of Service (ReDoS) or excessive CPU consumption. An attacker providing a maliciously crafted string (e.g., many consecutive spaces without commas) can trigger worst-case execution time in the regex engine. Instead, split by the comma character literall