← Blog
Ruby2ShellCVE-2026-132825Ruby on RailsGitLab

Ruby2Shell CVE-2026-132825: patch Ruby, Rails and GitLab now

Ruby2Shell (CVE-2026-132825): one-byte heap overflow in Ruby, reachable pre-auth in default Rails. Fixed in 3.3.14, 3.4.13, 4.0.10; PoC due Nov 25.

Zero Hunt Research··9 min read

Published by Zero Hunt, an autonomous AI red team on an on-premise appliance running private AI: automated penetration testing for networks and infrastructure, black-box or gray-box, with a human approving every step that matters.

Changing the case of a string is about the most boring thing a program does, and for almost a decade it has been able to corrupt memory in Ruby. CVE-2026-132825, now called Ruby2Shell, is a one-byte heap overflow in Ruby's case conversion for legacy single-byte encodings. On its own that sounds academic. What makes it a patch-this-week bug is the path in: researchers report that a default Rails or classic Sinatra app case-converts attacker-chosen input in a legacy encoding before any of your code runs and before anyone logs in. GitLab shipped a critical patch release today, Mastodon shipped three yesterday, and the researchers who first demonstrated code execution say their exploit goes public on November 25. That date is the deadline that matters.

As of 12:59 CET, 20 November 2026. This post is updated as vendors ship fixes and the PoC lands.

At a glance

CVE CVE-2026-132825 · Ruby advisory GHSA-34m4-m9fh-gqp5
Product / affected versions Ruby 3.3.13 and earlier · 3.4.0 through 3.4.12 · 4.0.0 through 4.0.9 (the vulnerable loop dates to Ruby 2.4.0)
Fixed in Ruby 3.3.14 · 3.4.13 · 4.0.10 (released with the advisory, 2026-11-18). Ruby 3.2 and older are end of life and get no fix
CVSS 7.4 high · CVSS 3.1 · AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H · scored by MITRE; the Ruby security team rates it Critical; NVD has not added its own score
Exploited in the wild No reports as of 2026-11-20; CISA's SSVC triage on NVD says exploitation: none (2026-11-19)
CISA KEV Not listed (catalog version 2026.11.18)
Public PoC None public as of 2026-11-20; Veria Labs plans to publish one on 2026-11-25
Official advisory Ruby security advisory, 18 November 2026 · GitLab 19.6.1 critical patch release

What Ruby2Shell is: the letter ß and a one-byte miscount

The Ruby advisory bundles seven memory-safety bugs in string case conversion and the regular-expression engine, all fixed in Ruby 4.0.10, 3.4.13 and 3.3.14. The one that got a name is GHSA-34m4-m9fh-gqp5: when changing case in single-byte encodings "such as ISO-8859-1 and Windows-1252", Ruby could write one byte past the end of the output buffer.

Veria Labs' write-up explains why. Most of Ruby's single-byte encodings have a lowercase ß but no capital form, so upcasing it produces two bytes, "SS". The conversion loop checked for room for one byte at a time. The output buffer is sized at the input length plus 20 bytes, so a string of 21 ß characters writes exactly one byte, an S (0x53), past the end. Case folding writes an s instead. The same loop sits in several ISO-8859 and Windows-125x encodings, and the code goes back to Ruby 2.4.0, released in 2016. UTF-8 strings are not affected.

A one-byte heap overflow with a fixed value is not an obvious shell. The Ruby team still rates it Critical, and its advisory says proofs of concept exist that reach code execution "in some scenarios". Veria says it "was the first to demonstrate remote code execution" on stock Rails and has held the exploit back. An independent reproduction repository on GitHub covers only local crashes and heap corruption so far, and its author says plainly that no remote delivery path was built. Unvetted "PoC" repositories for a famous bug regularly carry malware, so do not run one on a machine you care about. Treat November 25 as the day that changes.

A sibling bug in the same release matters too. GHSA-87fm-7w84-j2px, rated High, is an integer overflow in the same case-conversion code that also leads to a heap overflow. It needs multi-gigabyte input, which is why most Rails deployments will never see it, but it is fixed by the same upgrade.

Why default Rails apps are exposed to Ruby2Shell before login

The reason this is more than a library bug is the input path, which Moritz Sanft's analysis spells out. Rails includes the Rack::MethodOverride middleware, which reads a _method form field and upcases it so that an HTML form can send a PUT or DELETE. In a multipart POST, each part can declare its own charset. Declare a legacy charset and the value reaches String#upcase in a vulnerable encoding, before routing, before authentication, before your controllers run.

CrowdSec's analysis describes the same shape from the defender's side: one POST, one multipart part declared as ISO-8859-1, and the crafted value hits the vulnerable code "before app code runs". Veria lists Rails and classic-style Sinatra as affected in their default configuration. Plain Rack and other frameworks are not exposed by default, but any application code that upcases strings received in a legacy encoding may be.

"We don't use Windows-1252 anywhere." Your app doesn't have to. The client chooses the charset of each multipart part, and the middleware does the case conversion for you.

Who is affected: your Ruby, and the Ruby inside other products

The hard part of this fix is not the patch. It is finding every Ruby runtime in the estate, because a lot of them are not "your" Ruby: they ship inside other products, and those vendors must rebuild.

Product Status as of 2026-11-20 Source
Ruby itself Fixed in 3.3.14, 3.4.13, 4.0.10; 3.2 and older end of life Ruby advisory
GitLab CE/EE self-managed Fixed in 19.6.1, 19.5.8, 19.4.10 (released 2026-11-20); GitLab.com and Dedicated already patched GitLab patch release
Mastodon Fixed in 4.7.6, 4.6.12, 4.5.22 (2026-11-19), Docker images rebuilt on patched Ruby Mastodon releases
GitHub Enterprise Server 3.22.5 and earlier vulnerable; no fixed release published yet GHES release notes
Discourse, OpenProject, Chatwoot Fixed releases listed by Veria (Discourse base image 2.0.20261119-0203, OpenProject 17.9.8 and 17.8.3, Chatwoot 4.20.1) Veria Labs
Linux distribution packages Ubuntu marks every Ruby package "needs evaluation"; nothing fixed yet Ubuntu CVE tracker

Two consequences follow. First, a gem update does nothing: the bug is in the interpreter, so bundle update leaves you exposed. Second, the distribution packages are behind. On a server that runs Rails on the Ubuntu ruby3.3 package, you cannot install a fix today and have to rely on the compensating control below or move to an upstream Ruby build.

Remediation

Am I affected?

Inventory every Ruby, not just the one on your PATH:

# The interpreter your shell and apps see
ruby -e 'puts RUBY_VERSION'
# Version managers
ls ~/.rbenv/versions ~/.rvm/rubies ~/.asdf/installs/ruby 2>/dev/null
# GitLab Omnibus ships its own Ruby
/opt/gitlab/embedded/bin/ruby -e 'puts RUBY_VERSION'
# Container images: any image built FROM ruby:<version>
docker images --format '{{.Repository}}:{{.Tag}}' | grep -i ruby
grep -RniE '^FROM .*ruby:' --include=Dockerfile* .
# Pinned versions in repositories
find . -name .ruby-version -o -name .tool-versions | xargs grep -H ruby

Anything at 3.3.13 or below, 3.4.0–3.4.12 or 4.0.0–4.0.9 is vulnerable. Then check exposure: is it a Rails or classic Sinatra app reachable from untrusted networks? Internet-facing first.

Patch: exact fixed versions

  • Ruby: 3.3.14, 3.4.13 or 4.0.10. Rebuild and redeploy; restart every worker (Puma, Unicorn, Sidekiq), because a running process keeps the old interpreter.
  • Containers: the official ruby images on Docker Hub already carry 3.3.14, 3.4.13 and 4.0.10 tags. Rebuild from them and update every Dockerfile and .ruby-version that pins an older patch release.
  • GitLab self-managed: 19.6.1, 19.5.8 or 19.4.10. Self-compiled installs must rebuild their Ruby on 3.3.14 or 3.4.13 or later.
  • Ruby 3.2 or older: there is no fix. Upgrade the major line, or isolate the app behind the control below until you can.

Can't patch now? Compensating controls

  • Reject legacy charsets in multipart parts at the edge. No modern browser needs to send charset=iso-8859-* or charset=windows-125* inside a multipart body to a Rails app. A WAF or reverse-proxy rule that blocks those parts closes the default pre-auth path. CrowdSec publishes a free virtual patch, crowdsecurity/vpatch-CVE-2026-132825, for exactly this pattern. It covers the default Rails pre-login path only, not your own upcase calls and not GHSA-87fm.
  • Drop the method-override middleware where you don't need it. config.middleware.delete Rack::MethodOverride removes the _method path in Rails. It also breaks forms and links that rely on _method for PUT or DELETE, so test first.
  • Self-hosted products with no fix yet (GitHub Enterprise Server today): keep them off the public internet until the vendor ships a fixed release.

Hunt for compromise

No exploitation has been reported and no vendor has published indicators yet, so hunt for attempts rather than for a known implant (MITRE ATT&CK T1190, Exploit Public-Facing Application):

  • Multipart requests whose parts declare ISO-8859 or Windows-125x charsets, in WAF or full-body logs.
  • Ruby worker crashes: Puma, Unicorn or Sidekiq processes dying with a segmentation fault, especially in case-conversion frames, close in time to a POST. An unexplained cluster of worker restarts on an internet-facing Rails app this week deserves a look.

Eradicate and verify

  • Confirm every inventoried runtime reports a fixed version, and remove old images from nodes and registries so a rollback cannot reintroduce them.
  • Confirm the edge rule rejects a multipart part declaring charset=iso-8859-1, while normal UTF-8 form posts still pass.
  • If a worker crash correlates with a legacy-charset request before you patched, treat the host as compromised: rebuild it, and rotate the secrets it held (secret_key_base, database credentials, API keys, cloud tokens).

What is not known yet

  • The exploit. Veria's PoC is scheduled for November 25. Until then, nobody outside the researchers has shown remote code execution. Expect scanning to start within days of release.
  • The score. MITRE scores 7.4 with a local attack vector. The Ruby team calls it Critical, and the researchers describe an unauthenticated remote path. NVD has not added its own score. Use the input path, not the number, to prioritize.
  • GitHub Enterprise Server and the distributions. No fixed GHES release yet, and Ubuntu has not shipped packages.

Credited to Ada Logics and Anthropic: AI-assisted discovery keeps finding old bugs

The Ruby advisory credits Ruby2Shell and three of its sibling bugs to Stephan Lipp of Ada Logics and Anthropic. Veria's page separately credits Moritz Sanft working with OpenAI on the same class of case-mapping bugs. In one week, two AI labs appear in the credits for memory-corruption bugs in decade-old code that had passed through countless human reviews. It is the same pattern we described when AI agents started building exploits from patches: the time between "a bug exists" and "someone can use it" is shrinking on both sides, and November 25 is a public reminder of it.

Where Zero Hunt fits

A version string answers half of the Ruby2Shell question. The other half is whether a crafted multipart part can reach a vulnerable upcase in your stack, through your proxy, your middleware order and your WAF. Zero Hunt is an autonomous AI red team that runs on an on-premise appliance with its own private models. In a gray-box campaign it fingerprints the exact Ruby and framework build, then tries the input path against your app in an ephemeral, hardened container, with a human approving every intrusive step. You get evidence that the path is reachable or blocked, which is what exploit validation means, rather than a CVSS number that MITRE, Ruby and the researchers disagree about.

When the patch is not possible today, as with Ubuntu packages and GitHub Enterprise Server right now, the AI Remediation Advisor ranks the work by real exploitability (KEV first, then what the campaign proved, then CVSS and EPSS). It also proposes the edge rule as a compensating control and re-runs the same proof after the fix, so the finding closes on evidence, not on a version bump. Your traffic, configurations and source never leave the appliance.

Every vulnerability CISA lists as exploited, with federal due dates: CISA KEV tracker →

Patching one CVE at a time? A CTEM program validates which exposures are actually exploitable before the next advisory: what CTEM is →

Is this exploitable in your environment?

Zero Hunt answers that on your own network: an autonomous AI red team on an on-premise appliance, running on private AI, black-box or gray-box, with a human approving every step that matters. Proof of what is exploitable, the fix, and signed evidence — your data stays on your network.