Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven Regexp and String bugs
On 18 November 2026 Ruby released 4.0.10, 3.4.13 and 3.3.14 to fix seven memory-safety bugs in string case conversion and the regular expression engine, several of which may allow remote code execution. One of them, dubbed Ruby2Shell, is reachable from default Rails and classic Sinatra apps. Ruby 3.2 and older get no fix.
Ruby shipped security releases 4.0.10, 3.4.13 and 3.3.14 on 18 November 2026, fixing seven memory-safety bugs in string case conversion and regular expressions. The official advisory says several of them "may allow remote code execution". A separate write-up from Veria Labs, Ruby2ßhell, reports that one of the bugs is reachable from Rails and classic-style Sinatra in their default configuration. If you run Ruby in production, treat this as an upgrade-this-week item, not a next-sprint one.
What is affected
The advisory covers every supported branch:
| Branch | Affected | Fixed in |
|---|---|---|
| Ruby 4.0 | 4.0.0 to 4.0.9 | 4.0.10 |
| Ruby 3.4 | 3.4.0 to 3.4.12 | 3.4.13 |
| Ruby 3.3 | 3.3.13 and earlier | 3.3.14 |
| Ruby 3.2 and older | No fix: end of life | Upgrade to a supported branch |
Ruby 3.3 is in security maintenance, and the advisory states that Ruby 3.2 and earlier no longer receive fixes. Veria Labs says the case-conversion bug it describes goes back to Ruby 2.4.0, so an old, unmaintained Ruby is not a safe place to wait this out.
CVE identifiers had been requested but not yet assigned when the advisory was published, so the issues are tracked by GitHub Security Advisory IDs. If your scanner matches on CVEs only, it may not flag these yet.
The seven bugs
Three groups are worth separating, because they need different inputs to trigger.
String case conversion (two bugs). GHSA-34m4-m9fh-gqp5 is a one-byte heap buffer overflow, and GHSA-87fm-7w84-j2px is an integer overflow that leads to a heap buffer overflow. In both cases, the advisory says, "changing the case of a crafted string may allow remote code execution."
Regular expression compilation (three bugs). A double free (GHSA-7x2q-68qv-6p8x), an integer overflow leading to a heap overflow (GHSA-3p8q-wmhx-vm2w), and a heap overflow in Regexp#to_s (GHSA-7whj-cfh7-xgm4). These matter for applications that compile attacker-controlled patterns.
Regular expression matching (two bugs). Out-of-bounds reads in case-insensitive matching (GHSA-wpqw-5qxg-m68r) and case-insensitive backreference matching (GHSA-pvgc-g7gj-pv6h). The first may allow code execution with attacker-controlled patterns; the second may disclose memory or crash the process when matching a crafted string.
Why Ruby2Shell gets the attention
GHSA-34m4-m9fh-gqp5 is the bug behind the Ruby2ßhell write-up. According to Veria Labs, in most of Ruby's single-byte encodings (several ISO-8859 and Windows-125x encodings), uppercasing the German sharp s (ß) produces two bytes, but the bounds check only accounts for one. The output buffer is the input length plus 20 bytes, so a string with 21 of those characters overflows it by one byte.
The affected methods are upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different code path and are not affected. That sounds narrow, but Veria Labs lists Rails and classic-style Sinatra as affected in their default configuration on a vulnerable Ruby. Plain Rack and other frameworks are not exposed by default, though application code that upcases strings in a legacy encoding may be.
Two caveats from the write-up itself. It describes a one-byte write primitive and does not demonstrate full code execution on the page. And it says a proof of concept will be published "in a week" to give people time to upgrade. Plan on having that week, not more.
What to do
1. Find every Ruby you run
Applications are the easy part. The ones people miss are CI images, background workers, internal tools and vendored apps. Check what is actually running, not what the Gemfile says:
ruby -v
docker run --rm your-image:tag ruby -vThen look at where versions are pinned in your repositories:
grep -rn --include=.ruby-version --include=.tool-versions --include=Gemfile \
--include=Dockerfile -iE 'ruby' .
grep -A1 'RUBY VERSION' Gemfile.lockThe free Ruby security version checker takes the output of these commands, or a Dockerfile or .ruby-version, and tells you which versions are affected.
2. Upgrade and rebuild
Bump to 4.0.10, 3.4.13 or 3.3.14 on your current branch. These are patch releases, so the change should be a version bump plus a rebuild: update .ruby-version, the ruby line in your Gemfile if you have one, Docker base images, and CI matrices. Version managers need their definitions refreshed before the new versions appear, for example updating ruby-build before rbenv install 3.4.13.
Floating container tags such as ruby:3.4 only help if you pull and rebuild. Confirm with ruby -v inside the built image.
If you are on 3.2 or older, there is no patched version to move to on your branch. Moving to 3.3 or later is a bigger change, so start now and consider which services are internet-facing in the meantime.
3. Patch self-hosted software that bundles Ruby
Veria Labs lists the bundled Ruby in several popular self-hosted products. At the time of writing, the latest GitLab (19.6.0, bundling Ruby 3.3.13), GitHub Enterprise Server (3.22.5, bundling 4.0.9) and Chatwoot (4.20.0, bundling 3.4.4) were listed as affected. Mastodon 4.7.6, OpenProject 17.9.8 and the Discourse base image 2.0.20261119-0203 were listed as fixed. Watch your vendors' release notes for the others.
4. Review code that handles patterns and legacy encodings
Upgrading is the fix. While you're in there, look for the patterns these bugs depend on:
Regexp.new(params[...])or any pattern built from user input. If users should only supply literal text, wrap it withRegexp.escape.- Code that calls
force_encodingwith an ISO-8859 or Windows-125x encoding and then changes case. - Case-insensitive matching against untrusted input in hot paths such as search and routing.
None of these is a substitute for the upgrade, but they shrink the attack surface for the next bug in the same area.
Open questions
The write-up does not name the exact Rails code path, so it is hard to judge exposure from application code alone. CVE IDs, severity scores and the public proof of concept are all still to come. Expect scanners and vendor advisories to catch up over the next few days, and don't wait for them before upgrading.
A version bump across many repositories is a well-scoped job for an AI coding agent, provided the change is checked by running the app, not just the diff. CodeBeast's Review and Test agents review the pull request and boot the app in a browser after a change; for a pure dependency bump, your own test suite is still the main signal.
Sources
- Ruby security advisory: multiple vulnerabilities in Regexp and String case conversion
- Ruby 4.0.10 released
- Ruby 3.4.13 released
- Ruby 3.3.14 released
- Veria Labs: Ruby2ßhell
FAQ
Which Ruby versions fix the November 2026 Regexp and String vulnerabilities?
Ruby 4.0.10, 3.4.13 and 3.3.14, all released on 18 November 2026. Anything from 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, or 3.3.13 and earlier is affected. Ruby 3.2 and older are end of life and receive no fix.
Is my Rails app vulnerable to Ruby2Shell?
According to Veria Labs, Rails is affected in its default configuration when it runs on a vulnerable Ruby version. The fix is to upgrade Ruby itself; no Rails update is mentioned. Check with ruby -v on the servers and containers that actually run the app.
Do these vulnerabilities have CVE numbers?
Not yet. The Ruby advisory says CVE identifiers were requested but not assigned at publication, so the bugs are listed by GHSA IDs such as GHSA-34m4-m9fh-gqp5. Scanners that only match CVEs may not report them until the IDs are published.
Are UTF-8 strings affected by the case-conversion bug?
Not by GHSA-34m4-m9fh-gqp5: Veria Labs says UTF-8 strings take a different code path. The bug needs a single-byte encoding such as one of the ISO-8859 or Windows-125x families. The other six bugs have their own conditions, so upgrade regardless of which encodings you use.
Written by the CodeBeast Team with AI assistance. Spotted a mistake? Email support@codebeast.ai.