Ruby Patches Seven Memory Flaws, Five With Proof-of-Concept Code Execution
The Ruby project has patched seven memory-safety flaws in its regular expression engine and its string case-conversion code. The maintainers say that for five of them, proof-of-concept exploits show crafted input can run code on a machine. The advisories report no attacks so far. Fixes arrived in Ruby 4.0.10, 3.4.13 and 3.3.14.
The advisories rate three flaws critical, three high and one moderate. Of the other two flaws, one has proof-of-concept code that corrupts memory but has not been shown to run code, and the other can only read memory it should not or crash the program.
Whether an application is exposed depends on how it handles outside input. The regex flaws need an application that builds a regular expression from attacker-controlled input and then compiles or runs it. The two case-conversion flaws need no regex: they fire when an application changes the case of a crafted string. The moderate read flaw is the exception among the regex bugs, as it can fire when a crafted string is matched against a fixed pattern using a case-insensitive backreference.
Because the fixes ship inside Ruby itself, updating gems or a framework does not remove the risk. The Ruby running on application servers, background workers and container images must be updated, then restarted or rebuilt. Older versions will not receive fixes, so the project recommends moving to a supported line. The seven flaws have no CVE numbers yet, so GitHub advisory IDs are the way to track them in scanners and inventories.
This is the second regex engine patch in a month. October's fixes addressed compilation bugs behind four critical GitLab flaws, one of which was attacked on Alpine Linux's GitLab server and later added to CISA's KEV catalog. The new advisories do not say GitLab or any named product is vulnerable through these seven.
Why it matters
Teams that treat dependency updates as their patching process will miss this, because the flaws sit in the Ruby interpreter and not in a gem. Any app that builds regexes from user input, or changes the case of imported text, now has a plausible path to code execution on the server. With no CVE numbers yet, scanners keyed to CVEs may not flag these flaws, so inventories need to track the GitHub advisory IDs.
What to do
- Upgrade to Ruby 4.0.10, 3.4.13 or 3.3.14, or move off unsupported older versions to a supported line.
- Restart services and rebuild container images so they run the patched interpreter.
- Review code that builds regular expressions from user-controlled input.
- Check code that runs case conversion over imported or outside text, and track the GitHub advisory IDs until CVEs are assigned.