Summary
Ruby has an out-of-bounds read in its regular expression engine. Matching against a crafted regular expression pattern may allow remote code execution in applications that use attacker-controlled patterns. We are aware of PoCs that prove this flaw can lead to memory corruption in an attacker-controlled way.
A CVE ID has been requested and is pending.
Details
In case-insensitive matching, Ruby could read out of bounds, which can lead to memory corruption.
Impact
This is an out-of-bounds read that may allow remote code execution in applications that use regular expressions built from attacker-controlled strings. We are aware of PoCs that prove this flaw can lead to memory corruption in an attacker-controlled way. Applications should upgrade.
Patches
Upgrade to Ruby 3.3.14, 3.4.13 or 4.0.10.
Credits
Thanks to Stephan Lipp (Ada Logics) and Anthropic for reporting this issue.