The short version
- The flaws. Seven memory-safety bugs affect Ruby's own code: three rated critical, three high and one moderate. The maintainers say proof-of-concept code shows five of them can achieve remote code execution, meaning crafted input runs attacker code on the host.
- How it is reached. The regular expression flaws need an application that builds a pattern from input an attacker controls and then compiles or runs it. The two case-conversion flaws fire when the application changes the case of a crafted string.
- What to update. The fixes are in Ruby 4.0.10, 3.4.13 and 3.3.14, covering 4.0.0-4.0.9, 3.4.0-3.4.12 and 3.3.13 and earlier. Ruby 3.2 and older are end of life and will not be fixed, so the project advises moving to a supported line.
- Tracking the bugs. None of the seven has a CVE number yet; the project says it has requested them. Until they are assigned, the GitHub advisory identifiers are the only way to match the flaws against scanners and software inventories.
Timeline
| Date | Event |
|---|---|
| 23 October | Ruby 4.0.9, 3.4.12 and 3.3.13 ship to fix regular expression compilation bugs that GitLab found. |
| 18 November | Ruby 4.0.10, 3.4.13 and 3.3.14 are released with fixes for the seven memory-safety flaws. |
| 19 November | The security announcement and the seven per-flaw advisories are reported publicly. |
What the seven bugs are
The maintainers set out the flaws in a security announcement and a separate advisory for each. Three are rated critical, three high and one moderate. For five of them, the project says it is aware of proof-of-concept code that demonstrates code execution; the advisories report no attacks so far.
The critical three are a one-byte heap overflow when Ruby changes the case of a string in certain single-byte encodings such as ISO-8859-1 or Windows-1252; a double free when it compiles a crafted regex using a character-class intersection (&&); and a heap overflow when the size of a compiled regex overflows during compilation.
The weaker two are a case-insensitive matching flaw whose proof of concept corrupts memory without showing code execution, and an out-of-bounds read that the advisory says may disclose memory contents or crash the process. None of the seven has a CVE number yet, so the GitHub advisory identifiers are the only handle for scanners.
Who is exposed and what to do
Because the flaws sit in Ruby itself, every application on an affected version carries them; what differs is whether an attacker can reach the vulnerable path. The regex flaws matter where a pattern is built from untrusted input and then compiled or run. Matching untrusted text against a pattern the developers wrote is lower risk, with one exception: the moderate read flaw triggers when a crafted subject is matched against a fixed pattern using a case-insensitive backreference.
The case-conversion flaws involve no regular expression. They trigger when an application changes the case of a crafted string, so code that runs case conversion over imported or outside text is worth checking. The advisories do not publish the proof-of-concept code.
Updating gems or the framework does not replace a vulnerable interpreter. The version that matters is the Ruby running on application servers, background workers and container images, and each of those has to be updated and then restarted or rebuilt. Ruby 3.3 has moved to what the project calls legacy maintenance, with support ending at the end of March 2027.
The second regex patch in a month
On 23 October the project shipped Ruby 4.0.9, 3.4.12 and 3.3.13 to patch regular expression compilation bugs that GitLab found; those bugs sat behind four critical GitLab flaws. One of the GitLab flaws drew an attempted attack on Alpine Linux's own GitLab server, and CISA later added it to its Known Exploited Vulnerabilities catalogue as actively exploited.
Those are different bugs from this week's seven. The new advisories do not say that GitLab or any other named product can be attacked through them. What the October episode showed, according to the report, is that a regular expression built from user input can be a real route onto a server rather than a theoretical one.
What is not known yet
- Whether anyone was exploited through these seven flaws before the fixed versions shipped; the advisories report no attacks.
- How many production applications actually build regular expressions from attacker-controlled input, and therefore sit on the reachable path.
- When CVE identifiers will be assigned, and whether scanners will map the GitHub advisory IDs to them automatically.
- Whether any named product or library is reachable through these flaws; the advisories do not say so.
What to do
If you run Ruby in production
- Check the interpreter version on application servers, background workers and inside container images, not the gem or framework version.
- Update to the fixed release for your branch and then restart or rebuild every affected process and image.
- Migrate anything still on Ruby 3.2 or earlier to a supported line, since those versions will not be patched.
- Track the seven flaws by their GitHub advisory identifiers until CVE numbers are assigned.
If you write Ruby code
- Stop building regular expressions from input that users or outside systems control.
- Review code that changes the case of imported or untrusted strings, including case-insensitive matches against fixed patterns with backreferences.
For everyone else
- Include language runtimes in patch inventories: a flaw in the interpreter survives every library update and is only fixed by rebuilding the image or host that carries it.
Update log
- First published.
Sources
New incident reports by email
One email a week with the reports published since the last one.
We email you about this topic only; unsubscribe any time. See our Privacy Policy.