
Ruby Ships Emergency Releases to Fix RCE Flaws in Its Regex Engine
Ruby 4.0.9, 3.4.12 and 3.3.13 landed on October 23, fixing bugs in the Onigmo regex engine that GitLab found could be turned into remote code execution — the second week in a row a major language runtime rushed out critical patches.
It’s the second week in a row that a major programming language has rushed out emergency security patches. On October 23, the Ruby project released Ruby 4.0.9, 3.4.12 and 3.3.13, fixing several bugs in its regular expression engine, Onigmo, that GitLab found could be turned into remote code execution.
Days earlier, the PHP project patched two critical, unauthenticated remote-code-execution vulnerabilities (CVE-2026-109618 and CVE-2026-109619) dubbed PHP2Shell. Now it’s Ruby’s turn.
What was wrong
The root of the problem is mundane and terrifying at the same time: Regexp.new. GitLab compiles regular expressions supplied by its users — patterns in CI configuration, for example — using Ruby’s Regexp.new. GitLab’s security team found that specially crafted patterns could corrupt memory while Ruby compiles them, and that this memory corruption could be turned into remote code execution on GitLab servers.
GitLab patched the Ruby it ships in its own releases and assigned four CVE identifiers to the issues:
- CVE-2026-89078: a double-free bug in the regular expression parser
- CVE-2026-93577: an integer overflow in the regular expression compiler
- CVE-2026-97229: an integer overflow in the CI/CD regular expression compiler
- CVE-2026-110264: additional regex compilation issues
The new Ruby releases contain the fixes for the underlying bugs in Ruby itself, so anyone running affected versions — not just GitLab — should upgrade.
Who should upgrade
Anyone running Ruby 4.0.x, 3.4.x or 3.3.x on the affected patch levels. The 3.3.13 release also bundles a default-gem update: resolv 0.3.2, which fixes two older August vulnerabilities, CVE-2026-80212 and CVE-2026-80213, related to malicious DNS responses.
The urgency is real for anyone who accepts user input and passes it into a regular expression — a pattern that shows up constantly in CI systems, search features, and validation logic. As security researcher nateberkopec put it in a widely shared post: upgrade Ruby immediately, since this is a DoS and RCE vector if you accept user input.
Independent developer Pieter Levels, who spent the PHP2Shell week shutting down his own sites ahead of patching, summed up the mood on Thursday: “Day before yesterday it was PHP / Today it’s Ruby!”
How the fixes came about
The advisory, posted by Ruby committer k0kubun on October 23, is unusually transparent about the chain of events. GitLab found the memory-corruption issues while auditing its own infrastructure, confirmed they could be weaponized, and assigned CVE identifiers before the fixes even reached upstream Ruby. GitLab first addressed the issues in its own releases by patching the Ruby it ships — meaning GitLab’s hosted service and self-managed customers got protection ahead of the general Ruby release.
The Ruby project then shipped the fixes for the underlying bugs across all supported lines: 4.0.9, 3.4.12 and 3.3.13. Notably, Ruby 3.3 is officially in its security-maintenance phase, and this release was made as an exception to carry the regexp compilation fixes — a sign of how seriously the maintainers took the report.
The timing could hardly be more pointed. Independent developer Pieter Levels spent the PHP2Shell week shutting down all of his sites before the PHP patches landed, and has since been urging developers to assume hostile traffic and hide their servers behind Tailscale networks and Cloudflare Tunnels. His Thursday-night post — “Day before yesterday it was PHP / Today it’s Ruby!” — captured a sentiment spreading through the developer community: the gap between a vulnerability’s disclosure and its exploitation is shrinking, and patching on day one is no longer optional.
Why it matters
Two critical runtime patches in one week is unusual, and the timing is raising eyebrows. Both the PHP and Ruby flaws are in foundational, decades-old components — web-facing code that processes untrusted input. The PHP flaws, CVE-2026-109618 and CVE-2026-109619, carried a CVSS score of 9.2, required no authentication, and were scheduled for patching on October 21. Finding memory-corruption bugs in a mature regex engine is the kind of painstaking work that used to take human experts months. Levels himself has been warning that AI tooling is accelerating vulnerability discovery, telling developers to get their servers off the public internet because “this is about exploits and vulnerabilities AI is finding.”
That’s one developer’s read, and it’s anecdotal. But the underlying fact is not: two of the world’s most-deployed web languages patched critical RCE flaws within days of each other. Whether or not AI helped find them, the pace at which they are being found — and the speed with which the patches are landing — is the new normal.
What to do
If you run Ruby anywhere user-supplied patterns reach Regexp.new — CI pipelines, search features, input validators, GitLab instances — upgrade to 4.0.9, 3.4.12 or 3.3.13 now, or take your vendor’s patched build. If you self-host GitLab, make sure you are on one of the patched releases (GitLab shipped its own fixes in the 19.4.1, 19.4.2 and subsequent critical patch releases). If you can’t patch immediately, the safest mitigation is to stop compiling user-supplied patterns with Regexp.new — or at least sandbox the process that does it.
Upgrade now. Regexp.new on user input has never looked more expensive.

