Ruby2Shell (CVE-2026-132825): affected versions, how to check, and how to fix it

Ruby2Shell logo featuring a faceted red ruby gemstone centered above the text "Ruby2Shell" on a dark grid background.

Oneleet customers: we've checked your connected repositories, cloud services & self-hosted apps, and internet-facing assets & web apps for affected Ruby. If anything turned up, your compliance contact will be in touch with the list.

CVEs and Severity

NOTE: Accurate as of Nov 19th at 1:00PM EST. This is a developing disclosure.

Ruby's November 18 security release fixes seven memory-safety bugs. Only the first has a CVE so far. IDs for the other six have been requested.

ID

What it is

Ruby's rating

Ruby says its private PoCs reach

CVE-2026-132825 / GHSA-34m4-m9fh-gqp5 ("Ruby2Shell")

Heap overflow in String case conversion (ß)

Critical

RCE

GHSA-87fm-7w84-j2px

Integer overflow to heap overflow in case conversion

High

RCE

GHSA-7x2q-68qv-6p8x

Double free when compiling a regexp with &&

Critical

RCE

GHSA-3p8q-wmhx-vm2w

Integer overflow to heap overflow when compiling a regexp

Critical

RCE

GHSA-7whj-cfh7-xgm4

Heap overflow in Regexp#to_s

High

RCE

GHSA-wpqw-5qxg-m68r

Out-of-bounds read in case-insensitive matching

High

Memory corruption

GHSA-pvgc-g7gj-pv6h

Out-of-bounds read in case-insensitive backreferences

Medium

Not stated

The CVE vector says the attack is local, but the known path into Rails and Sinatra is an unauthenticated network request. If your tooling ranks by CVSS, move this up for anything internet-facing.

It isn't on CISA's KEV list, and its EPSS score is 0.00174 (7th percentile). Both are day-one numbers and will move.

Are you affected?

You're affected if anything you run uses one of these Ruby versions:

Branch

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

All versions

No upstream fix. Watch your distro for a backport.

Every Ruby release older than the fixed versions is affected. The bug has been in Ruby since at least 2.4.0, and SUSE lists its Ruby 2.1 package as affected too, so treat any older Ruby as vulnerable.

This covers CRuby (MRI). JRuby and TruffleRuby haven't said either way.

Who should move first

Internet-facing full-stack Rails apps (anything not generated with rails new --api) and classic-style Sinatra apps. Both load Rack::MethodOverride by default, and that's how an unauthenticated request reaches the bug.

Rails API-only apps, modular Sinatra, plain Rack, Hanami and Roda don't expose that path by default. They're still exposed if your own code changes the case of legacy-encoded input or builds regexps from user input. The usual suspects:

  • CSV and Excel imports (Excel often exports Windows-1252)
  • email and MIME parsing
  • legacy integrations and EDI feeds
  • search or filter features that build a Regexp from user input

If you're in the lower-risk group, upgrade anyway. Six other bugs ship in the same fix.

Self-hosted products that bundle Ruby

These ship their own interpreter, so upgrading the host's Ruby doesn't fix them.

Still shipping a vulnerable Ruby as of November 19:

  • GitLab (Omnibus): 19.6.0 bundles Ruby 3.3.13. Merge requests to move to fixed Rubies are open, but there's no patch release yet.
  • GitHub Enterprise Server: 3.22.5 bundles 4.0.9. No fix yet.
  • Chatwoot: 4.20.0 bundles 3.4.4. No fix yet.
  • Metasploit omnibus installers: bundle 3.4.12. No update yet.
  • Fluentd (fluent-package): bundles 3.4.11 or 3.4.12. v6.0.6, which moves to 3.4.13, is in review.
  • Puppet Core, Chef Infra/Cinc, Vagrant: no advisory yet.

Fixed:

  • Mastodon: 4.7.6, 4.6.12 and 4.5.22.
  • Discourse: base image 2.0.20261119-0203 and later. Self-hosters need ./launcher rebuild app.
  • OpenProject: 17.9.8.
  • OpenVox: fixes backported into its bundled Ruby in puppet-runtime 2026.11.19.1. Agent package rebuilds aren't confirmed yet.

"Affected" means the product ships a vulnerable Ruby. Nobody has published an exploit against a specific product. Some earlier writeups list Mastodon 4.7.5, OpenProject 17.9.7 and Discourse 2026.10.1 as affected. Those were the last releases before the fixes shipped.

How to check what you're running

ruby -v on a host can give you the wrong answer. Bundled products ship their own interpreter (GitLab's is at /opt/gitlab/embedded/bin/ruby), and a process started before an upgrade keeps running the old binary. Check what each process is actually running. As root on Linux:

bash
for p in /proc/[0-9]*; do
exe=$(readlink "$p/exe" 2>/dev/null) || continue
case "$exe" in */ruby*) echo "${p#/proc/} $exe" ;; esac
done | sort -k2 | uniq -f1

Run each path it prints with -v. A path ending in (deleted) means the binary was replaced after the process started, so that process needs a restart.

Distro Rubies usually live in a shared library (libruby*.so), and a backported fix keeps the old version number, so -v won't tell you anything. Find processes still mapping a replaced library:

bash
grep -l 'libruby[^ ]*\.so.*(deleted)' /proc/[0-9]*/maps 2>/dev/null

Each line is /proc/<PID>/maps for a process that needs a restart. needrestart on Debian and Ubuntu, or dnf needs-restarting on the RHEL family, reports the same thing.

Containers:

bash
# Running containers
docker ps --format '{{.ID}} {{.Image}}' | while read -r id image; do
printf '%s %s\n' "$image" "$(docker exec "$id" ruby -e 'print RUBY_VERSION' 2>/dev/null || echo 'no ruby on PATH')"
done

# An image you build or deploy
docker run --rm --entrypoint ruby your-image:tag -v

Version pins in your repos:

bash
find . -name .ruby-version -not -path '*/node_modules/*' -exec grep -H . {} +
grep -rn '^ruby' --include=.tool-versions --include=mise.toml .
grep -rn -A1 '^RUBY VERSION' --include=Gemfile.lock .
grep -rnE '^[[:space:]]*ruby[[:space:]]' --include=Gemfile .
grep -rnE 'ruby:[0-9]|ruby-version:' --include='Dockerfile*' --include='*.yml' --include='*.yaml' .

A floating tag like ruby:3.3 picks up the fix on your next pull and rebuild. A pinned tag like ruby:3.3.13, or a pinned digest, won't.

A clean scan doesn't mean you're clear

As of November 19, most scanners miss a Ruby that wasn't installed by a package manager, and the official ruby:* Docker images build Ruby from source.

  • Trivy reads OS packages and gems. It doesn't report a source-built runtime.
  • Snyk Container fingerprints Node.js and OpenJDK binaries outside package managers. Ruby isn't on that list.
  • Grype (through Syft) detects the ruby binary but matches it by CPE, and the NVD record has no CPE yet.
  • Dependabot won't alert. GitHub's global advisory (GHSA-8452-w857-wpmw) is unreviewed and lists no ecosystem.
  • bundler-audit checks gems only. A pending rubysec/ruby-advisory-db PR adds all seven advisories, which ruby_audit will pick up once it merges.
  • Tenable lists the CVE but has no plugin yet.

Distro package scanning follows distro security feeds, and most distros haven't marked a fix yet. Alpine is the odd one out: its fixed package shipped before the CVE existed, so Alpine's feed doesn't link the two yet, and scanners that rely on it can't either.

How to fix it

  1. Upgrade the interpreter to 4.0.10, 3.4.13 or 3.3.14, or install a distro package that carries the backport. bundle update doesn't touch the interpreter.
  2. Rebuild container images. Pinned tags and digests won't pick up the fix.
  3. Update .ruby-version, the ruby line in each Gemfile, Dockerfiles and CI images.
  4. Restart every Ruby process: web workers, Sidekiq and other job runners, cron jobs. Then rerun the process checks above. Nothing should still report an old version or map a deleted libruby.
  5. For bundled products, install the vendor's fixed release as soon as it ships.

Where to get a fixed Ruby

Fixed as of November 19:

  • Docker Hub ruby: latest, 4, 3.4, 3.3, slim and alpine all point at fixed builds.
  • Alpine edge, 3.24, 3.23, 3.22: ruby 3.4.13-r0.
  • Homebrew: run brew update.
  • ruby-build (rbenv): v20261119.
  • asdf-ruby: fixed through ruby-build. Run asdf plugin update ruby.
  • Heroku: all three versions are available. Existing apps need to change their Ruby version and redeploy.

Checking a distro backport

Distros often backport without changing the version number, so a package that reports 3.3.x below 3.3.14 may still be patched. Search the changelog for the CVE and all seven GHSA IDs. A distro advisory that lists only CVE-2026-132825 tells you nothing about the other six.

bash
IDS='CVE-2026-132825|GHSA-(34m4|87fm|7x2q|3p8q|7whj|wpqw|pvgc)'

# Debian and Ubuntu (package names vary: ruby3.3, ruby3.2, ruby3.1, ruby3.0, ruby2.7)
apt changelog ruby3.3 2>/dev/null | grep -nE "$IDS"

# RHEL, Alma, Rocky, Amazon Linux, SUSE (package names vary: ruby-libs, ruby3.4, ruby3.2, ruby2.5)
rpm -q --changelog ruby-libs 2>/dev/null | grep -nE "$IDS"

On Alpine the version number is reliable: apk info -v ruby should show 3.4.13-r0 or later.

Upstream end of life doesn't stop distros from patching. They usually backport into the 2.x through 3.2 packages they still support, and OpenVox has already done it for its bundled 3.2. If you're on an older distro Ruby, watch your distro's tracker rather than waiting for an upstream release that won't come.

If you can't upgrade today

  • Put self-hosted GitLab, GitHub Enterprise Server and Chatwoot behind a VPN or IP allowlist until the vendor ships a fix.
  • Deploy the CrowdSec virtual-patch rules (still under review), or write a WAF rule that blocks long runs of raw 0xDF bytes in a multipart _method field.
  • In your own code, convert untrusted strings with str.encode("UTF-8") before changing case, and stop building regexps from user input.

What is Ruby2Shell?

Ruby2Shell (also written "ruby2ßhell") is the name Veria Labs gave CVE-2026-132825. It's a bug in how Ruby uppercases the German letter ß.

Older encodings like ISO-8859-1 and Windows-1252 have no capital ß, so Ruby turns it into two letters, "SS". The code that does this only made room for one. Get an app to uppercase a string with enough ß in one of those encodings and Ruby writes one byte past the end of its buffer. That reliably crashes the process, and Ruby's maintainers say private exploits turn it into code execution in some setups.

It matters for web apps because Rails and classic Sinatra uppercase one field of incoming form submissions before any of your code runs, and the sender gets to choose that field's encoding. Setting your app to UTF-8 doesn't stop it.

Ruby fixed it on November 18, 2026, in a release that also fixes six related bugs in string handling and the regex engine. Ruby credits the report to Stephan Lipp (Ada Logics) and Anthropic.

Deeper Look: Timeline, IOCs, TTPs, and Detection

The bug

Fourteen legacy single-byte encodings have no capital ß:

  • ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15 and -16
  • Windows-1250, -1252, -1254 and -1257

When Ruby upcases byte 0xDF in one of these, it emits "SS". Case-folding emits "ss". Each encoding's case_map function checked for room for one output byte when it needed two.

Ruby sizes the output buffer at the input length plus 20 spare bytes. A string with 21 or more ß overruns it by one byte, and that byte is always S (0x53) on upcase or s (0x73) on fold. The fix is commit d582f8f (PR #20005).

The methods that reach it are String#upcase, #swapcase, #downcase(:fold) and #casecmp?, plus their bang variants and the matching Symbol methods. A few writeups also list capitalize. Most of the research doesn't, so treat that as unconfirmed.

UTF-8 strings take a different code path and don't hit this bug. They can hit GHSA-87fm, covered below.

How an unauthenticated request gets there

Veria Labs hasn't published its Rails attack path. durendal.sh, a reviewer on CrowdSec's rule PR and commenters on Hacker News have each described the same one:

  1. The attacker sends a multipart/form-data POST.
  2. The _method part declares its own charset, such as ISO-8859-1, and contains 21 or more raw 0xDF bytes.
  3. Rack's multipart parser tags that string with the declared encoding.
  4. Rack::MethodOverride calls .upcase on _method. That middleware runs before routing, authentication and controller code.

The client picks the encoding of each multipart part, which is why your app's default encoding doesn't matter. An approved Rack PR (rack/rack#2555) adds an option to ignore multipart charsets, but it hasn't been merged or released.

The other six bugs

All seven share the same affected and fixed versions, so one upgrade covers them. Two things worth knowing:

  • GHSA-87fm is the one that works on UTF-8. It needs a case-converted result over 4 GiB, which means roughly 1.4 GB of input. durendal.sh reports that the multipart size limits in Rack 3.2.2 and later block it.
  • The regexp-compilation bugs (GHSA-7x2q, -3p8q, -7whj and -wpqw) need an attacker who controls a regexp pattern. If your app builds a Regexp from user input, take these seriously. GHSA-pvgc is the only one that works against a pattern the developer wrote, using a crafted subject string.

Is it really RCE?

Where things stand on November 19:

  • Crashes are reproduced publicly. Miggo reproduced a denial of service against Rails and Sinatra.
  • No RCE exploit is public. Ruby core says its private PoCs reach code execution "in some scenarios". durendal.sh claims pre-auth RCE against a fresh rails new app and has published only a hash of its exploit. Veria Labs plans to publish its PoC around November 26.
  • OX Security argues the RCE risk is overstated: a single overwritten byte with a fixed value needs heap grooming tuned to each target, and a miss crashes the worker. That's reasoning, not a test result, and OX still says to patch internet-facing apps first.
  • No exploitation in the wild has been reported.

A one-byte write with a fixed value is a hard primitive, and a worker stuck in a crash loop is noisy. That's real comfort today. It stops being comfort once a working exploit is public, and that's about a week out. Expect scanning and new detection rules after November 26.

Detection and IOCs (Indicators of Compromise)

No IOCs have been published: no attacker IPs, hashes, user agents or payload samples. Be skeptical of any IOC list for this CVE that shows up before the Veria PoC does.

Failed exploit attempts are likely to crash the Ruby process, so crashes are what to watch. Search application server logs for:

text
[BUG] Segmentation fault
malloc(): corrupted top size
free(): invalid next size

Also look for Puma, Unicorn or Sidekiq workers in a crash-and-restart loop. Repeated crashes that line up with requests from one client address are a much stronger signal than a single crash.

In Kubernetes, list containers whose last exit was SIGABRT (134) or SIGSEGV (139):

bash
kubectl get pods -A -o json | jq -r '
  .items[] | (.metadata.namespace + "/" + .metadata.name) as $pod
  | .status.containerStatuses[]?
  | select(.lastState.terminated.exitCode == 134 or .lastState.terminated.exitCode == 139)
  | "\($pod) \(.name) exit=\(.lastState.terminated.exitCode) restarts=\(.restartCount)"'

In request logs or a WAF, the known path looks like:

  • a multipart/form-data POST with a part named _method
  • that part declaring charset=ISO-8859-1, charset=windows-1252 or another affected charset
  • 21 or more raw 0xDF bytes in that part

The UTF-8 form of ß (C3 9F, or %C3%9F URL-encoded) doesn't trigger the bug.

On rules: CrowdSec has virtual-patch rules under review (crowdsecurity/hub#2018 and #2019) that match more than 20 raw 0xDF bytes in _method. Equixly published an untested regex for URL-encoded parameters, (?i)(?:%df(?:[^%&]|%[^d&]|%d[^f&])*){21}, but it can't see raw bytes in multipart bodies, which is where the known path is. Run any rule in detection mode first, since legitimate Latin-1 text can contain plenty of ß. We haven't found rules from Cloudflare, AWS WAF, Akamai, Fastly, Emerging Threats, Sigma or Nuclei yet.

Timeline (UTC)

  • Nov 18, 22:17: fix PRs #20000 to #20006 merged to Ruby master
  • Nov 18, 23:35: Ruby 4.0.10, 3.4.13 and 3.3.14 tagged
  • Nov 19, 00:00: Ruby advisory published
  • Nov 19, 00:13: seven GHSAs published
  • Nov 19, 06:34: CVE-2026-132825 published
  • Around Nov 26: Veria Labs plans to publish its PoC

Not to be confused with CVE-2026-113840

A few posts call Ruby2Shell CVE-2026-113840 and describe it as a Marshal deserialization bug fixed in "Ruby 3.5.2". Ruby has never had a 3.5 branch, CVE-2026-113840 has no published record, and no primary source connects it to Ruby. Ignore those posts, including their advice to block Marshal header bytes at the WAF.

Sources

Ruby and CVE records

Research

Mitigations and detection

Distributions