Inter-office memo
- To
- Everyone running Ruby
- From
- Mo, Chief Executive
- Date
- November 19, 2026, 9:17 PM CST
- Re
- Ruby2Shell
Ruby2Shell: AI helped find a critical Ruby flaw. Who’s at risk, and which versions fix it
On November 18, 2026, Ruby 4.0.10, 3.4.13 and 3.3.14 fixed Ruby2Shell (CVE-2026-132825), a one-byte overflow that researchers showed can let attackers run code on a default Rails app without logging in. Updating gems doesn’t fix it: Ruby needs updating, then a restart. GitLab and GitHub Enterprise Server had no fix on November 19, and an exploit is due November 25.
What Ruby fixed on November 18
On November 18, 2026, Ruby released versions 4.0.10, 3.4.13 and 3.3.14 with fixes for seven memory-safety bugs in its regular expression engine and in the way it changes the case of strings. “We are aware of PoCs that prove some of them can be used to trigger remote code execution,” the maintainers wrote, and “We strongly recommend upgrading.”
The one with a name is GHSA-34m4-m9fh-gqp5, now CVE-2026-132825. Veria Labs, one of the teams that found it, calls it Ruby2Shell, or ruby2ßhell, because the German letter ß sets it off. Most of Ruby’s older single-byte encodings, such as ISO-8859-1 and Windows-1252, have no capital ß, so upcasing ß writes two letters, SS. The loop that does it checks for room for only one, so a string with 21 of them writes one byte past the end of its buffer. Methods that reach it are upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different path and aren’t affected. The bug has been in Ruby since 2.4.0, released in 2016.
| Ruby series | Affected | Fixed in |
|---|---|---|
| 4.0 | 4.0.0 to 4.0.9 | 4.0.10 |
| 3.4 | 3.4.0 to 3.4.12 | 3.4.13 |
| 3.3 | 3.3.13 and earlier | 3.3.14 |
| 3.2 and older | Back to 2.4.0 | No fix: end of life |
If you updated for Ruby’s last security release, on October 23, you’re on 4.0.9, 3.4.12 or 3.3.13, the newest affected versions, as Semgrep points out. Ruby 3.3 is still supported, but only until “the end of March 2027.”
The ratings don’t agree. Ruby’s GitHub advisory rates it Critical, and so does SUSE. The CVE record, which MITRE issued, scores it 7.4, High, as an attack that needs local access, and Ubuntu gives it Medium priority. The researchers’ own accounts, below, describe an attack over the network without logging in.
Who’s at risk
Full-stack Rails apps and classic Sinatra apps, by default. HTML forms can only send GET and POST, so Rails forms that update or delete carry a hidden _method field, and a piece of middleware, Rack::MethodOverride, reads it and upcases it. In a multipart form, each field may declare its own character set, and Rack honors it. So an attacker can send a _method of 21 ß in ISO-8859-1. “A plain rails new app is enough to be exploitable,” writes Moritz Sanft, one of the finders. Semgrep adds that the middleware “runs before routing, before CSRF protection, before authentication.”
Semgrep checked which setups expose it:
| Setup | Exposed by default? |
|---|---|
| Rails, full stack | Yes |
Rails with config.api_only = true |
Not through the middleware; your own code still can be |
Sinatra, classic style (require 'sinatra') |
Yes |
Sinatra, modular (Sinatra::Base) |
Only if it enables method_override |
| Plain Rack | Only if the app mounts Rack::MethodOverride |
Rodauth with create_account |
Yes, through its sign-up form |
Your own code, in any framework. In Rails, “every multipart text parameter keeps the charset the client declared, API mode included,” Semgrep found, so params[:name].upcase is “the same bug with a different front door.” The same goes for strings tagged with an encoding someone else picked: HTTP client responses, email parts, files read as ISO-8859-1, or database rows over a latin1 connection.
Self-hosted Ruby products. GitLab, GitHub Enterprise Server, Mastodon, Discourse, OpenProject and Chatwoot ship their own Ruby in their packages or images, so their fix has to come from the vendor (see below).
What doesn’t carry it. Headers, JSON bodies, query strings and ordinary URL-encoded forms arrive as UTF-8 or binary, Semgrep says, and JRuby and TruffleRuby don’t share the bug. One related warning: a Rails server in development mode compiles request text into regular expressions at /rails/info/routes, which reaches two of the other six bugs, so don’t leave one open to other machines.
A second case-conversion bug, GHSA-87fm-7w84-j2px, rated High, can be reached the same way, but Sanft says only on Rack 3.2.1 and older, because later versions limit the size of form fields.
How AI found it
At least three teams found Ruby2Shell independently, and AI was involved in at least one find.
Moritz Sanft started on October 23, after PHP2Shell. “I asked Codex to map CRuby’s pre-authentication attack surface reachable from Rails, triaged its findings, and steered it toward the interesting ones. Less than 24 hours later, Codex came back with a handful of vulnerabilities, two of which should turn out to yield to pre-auth RCE in many Ruby on Rails apps including GitHub and GitLab.” He had an exploit for a toy app on October 26, then asked a friend at OpenAI for help. By November 5 she had run code on a plain rails new app, and OpenAI’s security team reported both bugs to Ruby. Around the release, Sanft says, OpenAI “invited WAF providers and other defenders to collaborate on defense work.”
Ada Logics and Anthropic. Ruby’s advisory thanks “Stephan Lipp (Ada Logics) and Anthropic” for reporting Ruby2Shell, and credits them with three of the other six bugs as well. We found no account from either of how they found them.
Veria Labs, which sells an “autonomous pentester,” says it “found this vulnerability independently and was the first to demonstrate remote code execution.” Its page doesn’t say how.
It’s the fourth such disclosure in a month, after PHP2Shell, Java4Shell and nginx2root.
Is it being exploited?
Not that anyone has reported. CISA’s assessment in the CVE record, made on November 19, reads exploitation “none,” automatable “no,” technical impact “total,” and watchTowr notes it isn’t in CISA’s Known Exploited Vulnerabilities catalog.
The exploits are private for now. Sanft posted only a hash of his. Veria says it will publish “a proof of concept demonstrating remote code execution on stock Rails on 25 November 2026, or later if major vendors have not shipped a fix by then.”
You can’t test a server from outside. Semgrep found that a fixed and an unfixed Ruby give “byte-for-byte identical results,” so “there is no safe request that tells a vulnerable server from a fixed one.” Knowing which Ruby each process runs is the only check.
Which versions fix it
It depends on where your Ruby comes from. Here’s where each source stood on November 19:
| Where your Ruby comes from | Fixed in | Status on November 19 |
|---|---|---|
| ruby-lang.org | 4.0.10, 3.4.13, 3.3.14 | Released November 18 |
| rbenv’s ruby-build | v20261119 | Adds all three |
| Docker’s official image | ruby:4.0.10, ruby:3.4.13, ruby:3.3.14 |
Published by November 19 |
| Heroku | All three | Available November 18 |
| Homebrew | 4.0.10 | Current formula |
| Ubuntu | Not yet | Listed “Needs evaluation” |
| Debian | Not yet | No packages listed yet |
| SUSE | Not yet | Open, rated Critical |
Distribution packages may keep their version numbers. Debian, Ubuntu, Red Hat and SUSE backport fixes into the version they ship, so check their advisories rather than ruby -v. Ubuntu 24.04’s Ruby is 3.2, which Ruby itself won’t fix, but Ubuntu’s page lists it “Needs evaluation” like the rest.
Self-hosted products need their vendor’s release. This is Veria’s list, updated at 02:59 UTC on November 20:
| Product | Affected | Fixed in |
|---|---|---|
| GitLab | 19.6.0 and earlier | No release yet |
| GitHub Enterprise Server | 3.22.5 and earlier | No release yet |
| Chatwoot | 4.20.0 and earlier | No release yet |
| Mastodon | 4.7.5 and earlier | 4.7.6, 4.6.12, 4.5.22, 4.4.29 |
| OpenProject | 17.9.7 and earlier | 17.9.8, 17.8.3 |
| Discourse base image | Before 2.0.20261119-0203 | 2.0.20261119-0203 |
GitLab committed a change titled “Bump Ruby to 3.3.14 and 3.4.13” on November 18, but its newest patch release was still 19.5.6, from November 16, and GitHub Enterprise Server’s release notes stop at 3.22.5. Mastodon says its release is “critical to update if you use our docker container images,” and installs without them need Ruby “4.0.10, 3.4.13, 3.3.14 or newer.” A Discourse forum is fixed only once it’s rebuilt, Semgrep notes.
What to do
- Find every Ruby that runs. That means app servers, background workers, containers, and products that bundle their own, such as GitLab’s under
/opt/gitlab/embedded. Theruby -vin your shell may not be the one your app runs. - Install a fixed Ruby. With rbenv, update ruby-build and run
rbenv install 3.4.13. In Docker, rebuild onruby:3.4.13or another fixed tag. On Heroku, putruby "3.4.13"in your Gemfile and deploy. Then update the pins:.ruby-version, the Gemfile’srubyline, Dockerfiles and CI images. Runningbundle updatedoes nothing for this. - Restart everything. A Puma worker started before the update keeps running the old Ruby until it’s restarted.
- Move off Ruby 3.2 and older, which get no fix, unless your distribution ships a patched package.
- If you can’t update today, Semgrep’s stopgaps close the framework path:
config.middleware.delete Rack::MethodOverridein Rails, ordisable :method_overridein Sinatra. Forms that send PUT, PATCH or DELETE through_methodstop working, and neither stopgap covers your own code or the other six bugs. For a product with no fix yet, Semgrep suggests a VPN or an allowlist in front of it until there is one. - Read your own code for
upcase,swapcase,downcase(:fold)andcasecmp?on text a client can influence, and forRegexp.newon user input withoutRegexp.escape, which three of the other bugs need. - Check what’s running. Semgrep’s detection scripts, for Linux, macOS, Windows and Kubernetes, read the version each running process has loaded and say whether it’s
impacted.
Checking your apps with an agent
Steps 1, 6 and 7 are tedious across many apps and servers, and a coding agent such as Claude Code or Codex can do them where it can reach your code and hosts. Semgrep published a long prompt for coding agents that covers all seven bugs. A shorter one along these lines works for Ruby2Shell:
Check whether the Ruby apps you can reach are affected by Ruby2Shell (CVE-2026-132825), fixed in Ruby 4.0.10, 3.4.13 and 3.3.14. Read only: don't install, upgrade, restart or send any test request. For each running Ruby process, container image and bundled Ruby, record the version the process actually runs, and for distribution packages the full package version to compare with the vendor's advisory. For each app, note whether it is full-stack Rails (no config.api_only), classic Sinatra, or mounts Rack::MethodOverride, and list every call to upcase, swapcase, downcase(:fold) or casecmp? on text a client can influence. Return a table, and list what you couldn't check.
Check what it reports against the tables above before acting on it, and make the upgrades and restarts yourself.
What hasn’t been said
- Whether anyone is exploiting it. No one had reported attacks by November 19, and Veria’s exploit is due on November 25.
- When GitLab, GitHub Enterprise Server and Chatwoot ship fixes, or the distributions. None had announced a date.
- Whether GitLab.com and GitHub.com were exposed. Neither company had said.
- How Ada Logics and Anthropic found it, and whether Veria used its own AI.
- CVE numbers for the other six bugs. Ruby says it has requested them; until then, only the GitHub advisory IDs track them.
We’ll update this memo when GitLab and GitHub Enterprise Server ship fixes, when Veria publishes its exploit, or if attacks are reported.
9.Questions.
Am I affected by Ruby2Shell?
- Most likely, if a full-stack Rails app or a classic-style Sinatra app runs on Ruby older than 4.0.10, 3.4.13 or 3.3.14. Their default middleware changes the case of a form field an attacker controls, before any login. Rails in API-only mode isn’t exposed that way, though your own code can still be, and Ruby 3.2 and older get no fix at all.
Which Ruby version fixes Ruby2Shell?
- Ruby 4.0.10, 3.4.13 or 3.3.14, released November 18, 2026. Restart your app servers and workers afterward, because a running process keeps the old Ruby. Distribution packages may get the fix without a new version number; on November 19, Ubuntu, Debian and SUSE hadn’t shipped one.
Does updating Rails or running bundle update fix it?
- No. The bug is in Ruby itself, not in a gem, so nothing in your Gemfile.lock changes and dependency scanners stay quiet. You need a fixed Ruby, from ruby-lang.org, your version manager, a rebuilt Docker image, your host or your distribution.
Is GitLab or GitHub Enterprise Server vulnerable to Ruby2Shell?
- Yes, by Veria Labs’ latest list. GitLab 19.6.0 and earlier, GitHub Enterprise Server 3.22.5 and earlier and Chatwoot 4.20.0 and earlier bundle an affected Ruby and had no fixed release. Mastodon, OpenProject and Discourse have shipped fixes. Until one comes, Semgrep suggests keeping such servers behind a VPN or an allowlist.
Is Ruby2Shell being exploited?
- No attacks had been reported by November 19, 2026, and CISA’s list of exploited vulnerabilities doesn’t include it. But Veria Labs plans to publish an exploit against stock Rails on November 25, so there’s about a week to update.
Was Ruby2Shell found by AI?
- Partly. The researcher Moritz Sanft says he found it by asking OpenAI’s Codex to map Ruby’s attack surface before login, and Ruby credits Stephan Lipp of Ada Logics and Anthropic with reporting it. Veria Labs, which sells an AI pentester, found it independently and doesn’t say how.