CVE-2026-132825 (GHSA-34m4-m9fh-gqp5), nicknamed Ruby2Shell by Veria Labs, is a one-byte heap buffer overflow in Ruby’s upcase, swapcase, downcase(:fold), and casecmp? for 14 legacy single-byte encodings, including ISO-8859-1 and Windows-1252. The bug has been in Ruby since 2.4.0. It carries a CVSS 3.1 score of 7.4 (High), but the reason it is getting attention is reach: Veria Labs reports that an unauthenticated attacker can hit it over the network in Rails and classic-style Sinatra apps running their default configuration, and the Ruby team says proofs of concept show remote code execution.
This article was created with AI assistance. Facts were checked against the official ruby-lang.org advisory and the Veria Labs, Equixly, Miggo, and OX Security write-ups on November 19, 2026. The exact Rails attack path has not been published yet; confirm details in Ruby’s advisory and your vendors’ notices before acting.
TL;DR: what to install
| Branch | Affected | Fixed |
|---|---|---|
| Ruby 4.0 | 4.0.0 – 4.0.9 | 4.0.10 |
| Ruby 3.4 | 3.4.0 – 3.4.12 | 3.4.13 |
| Ruby 3.3 (security maintenance) | 3.3.13 and earlier | 3.3.14 |
| Ruby 3.2 and older | All, back to 2.4.0 | No fix (end of life) |
- This is an interpreter bug.
bundle updatedoes nothing. Upgrade Ruby itself, rebuild container images, and redeploy. - Do a full restart. A Puma phased restart or Unicorn
USR2re-exec can keep running the old binary. Stop and start every web, Sidekiq, and job worker, then confirm the version the running process uses (see checks). - Self-hosted products bundle their own Ruby. GitLab, GitHub Enterprise Server, Mastodon, Discourse, OpenProject, and Chatwoot need vendor releases, not a system Ruby upgrade.
- Distribution packages may backport the fix under an older-looking version number. Check package changelogs for the GHSA or CVE ID.
These releases come less than a month after Ruby 4.0.9, 3.4.12, and 3.3.13 fixed the Onigmo bugs behind GitLab’s CVSS 10 RCEs (see our October Ruby regexp guide). If you skipped that round, this upgrade covers both.
Timeline
| Date | Event |
|---|---|
| December 2016 | Ruby 2.4.0 introduces full Unicode case mapping for non-ASCII characters, along with the code that contains the bug |
| October 23, 2026 | Ruby 4.0.9, 3.4.12, and 3.3.13 fix earlier Onigmo regexp bugs (unrelated to Ruby2Shell) |
| November 18, 2026 | Ruby 4.0.10, 3.4.13, and 3.3.14 released, fixing seven regexp and string case conversion flaws |
| November 19, 2026 | Ruby’s advisory and Veria Labs’ Ruby2Shell write-up are published, followed by a list of affected self-hosted products. CVE-2026-132825 is assigned to Ruby2Shell; the other six are still pending CVE IDs |
| About a week after disclosure | Veria Labs plans to publish its proof of concept |
Ruby credits Stephan Lipp (Ada Logics) and Anthropic for Ruby2Shell and three of the regexp bugs, with the remaining reports credited to HackerOne researchers and Ruby core developers.
What went wrong: ß becomes “SS”
In most single-byte encodings, changing case is one byte in, one byte out. The exception is the German sharp s, ß (byte 0xDF in ISO-8859-1 and Windows-1252), which has no single-byte capital form and upcases to two letters, SS.
According to Equixly’s analysis of the fix, Ruby sizes the output buffer at the input length plus 20 bytes of slack. The conversion loop checks that there is room for one more byte, then writes two when it meets a ß, and the second write is not bounds-checked. Once a string contains 21 or more sharp s characters, the slack is used up and the next one writes a single byte, an S (0x53), or s when case-folding, past the end of the heap allocation.
One fixed byte sounds harmless, but one-byte heap overflows are a well-known path to code execution: overwrite the low byte of a neighbouring allocation’s metadata or a length field, and the allocator or interpreter does the rest. It does require heap grooming and tailoring to each target, and failed attempts tend to crash the worker.
Not affected: UTF-8 strings, which use a separate case-mapping routine, and encodings without a ß such as ISO-8859-5. The 14 affected encodings are ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15, -16, and Windows-1250, -1252, -1254, and -1257.
How attackers reach it, and the debate about risk
Rails is UTF-8 by default, so how is a Latin-1 code path reachable? Veria Labs says default Rails and classic-style Sinatra apps can be reached with attacker-supplied text in an affected legacy encoding, without authentication, but has deliberately not published the request path yet. Until it does, assume every internet-facing Rails or Sinatra app on an affected Ruby is reachable.
Outside those frameworks, the bug needs application code that changes the case of legacy-encoded text. The usual places:
- Email processing: inbound mail handlers and Action Mailbox, where messages routinely declare
charset=iso-8859-1orwindows-1252. - File imports: CSV, EDI, and fixed-width importers that read files with
encoding: "ISO-8859-1"or"Windows-1252", then normalize headers or values withupcase. - Legacy integrations: SOAP and XML partners, mainframe feeds, and old databases whose columns are Latin-1.
- Case-insensitive comparisons:
casecmp?on usernames, headers, or codes from any of the above.
Not everyone agrees on the urgency. OX Security calls unauthenticated RCE “a high bar” given the heap grooming required and the lack of a weaponized exploit, and recommends patching at a reasonable pace. We would lean the other way for internet-facing apps: the Ruby team has seen RCE proofs of concept, a public PoC is scheduled, and even without code execution a single request can crash a worker, which makes cheap denial of service a near-certainty.
The other six flaws in the same release
| Advisory | Flaw | Attacker needs to control | Impact per Ruby |
|---|---|---|---|
| GHSA-87fm-7w84-j2px | Integer overflow leading to heap overflow in string case conversion | Text whose case is changed | Possible RCE; PoCs show RCE in some scenarios |
| GHSA-7x2q-68qv-6p8x | Double free in regexp compilation | A regexp pattern | Possible RCE; PoCs show RCE in some scenarios |
| GHSA-3p8q-wmhx-vm2w | Integer overflow leading to heap overflow in regexp compilation | A regexp pattern | Possible RCE; PoCs show RCE in some scenarios |
| GHSA-7whj-cfh7-xgm4 | Heap overflow in Regexp#to_s | A regexp pattern | Information disclosure or possible RCE |
| GHSA-wpqw-5qxg-m68r | Out-of-bounds read in case-insensitive matching | A regexp pattern | Attacker-controlled memory corruption |
| GHSA-pvgc-g7gj-pv6h | Out-of-bounds read in case-insensitive backreference matching | Text being matched | Memory disclosure or crash |
GHSA-87fm-7w84-j2px is the one to watch alongside Ruby2Shell, because like it, it only needs crafted text. The four pattern bugs matter if your app builds regular expressions from user input, for example search filters, “match rules” in admin settings, or Regexp.new(params[:q]). Find those with:
grep -rnE 'Regexp\.(new|compile|union)\(' app/ lib/ | grep -v 'Regexp.escape'
Self-hosted products that bundle Ruby
Veria Labs lists these releases as shipping an affected Ruby. Each needs a vendor update; do not try to swap the embedded interpreter yourself.
| Product (version checked) | Bundled Ruby | What is at stake |
|---|---|---|
| GitLab 19.6.0 | 3.3.13 | Source code, CI/CD variables, deploy keys, runner tokens |
| GitHub Enterprise Server 3.22.5 | 4.0.9 | Source code, Actions secrets, deploy keys |
| Mastodon 4.7.5 | 4.0.9 | User accounts, direct messages, federation keys |
| OpenProject 17.9.7 | 4.0.9 | Project data, attachments, integration tokens |
| Discourse 2026.10.1 | 3.4.7 | User data, private messages, SSO secrets |
| Chatwoot 4.20.0 | 3.4.4 | Customer conversations, channel API keys |
Until vendor fixes ship, put these behind a VPN, SSO-aware proxy, or IP allowlist if they do not need to be public.
Find every Ruby you run
# 1. The Ruby each running process actually uses
for pid in $(pgrep -f 'puma|unicorn|sidekiq|ruby'); do
exe=$(readlink -f /proc/$pid/exe); echo "$pid $exe $($exe -v)"
done
# 2. Bundled runtimes in self-hosted products
/opt/gitlab/embedded/bin/ruby -v 2>/dev/null
# 3. Container images
docker run --rm --entrypoint ruby your-image:tag -v
# 4. What your repos pin
cat .ruby-version .tool-versions 2>/dev/null; grep -n '^ruby ' Gemfile
# 5. Code that changes case on legacy-encoded text
grep -rnE 'ISO-8859|Windows-125|force_encoding|encoding:' app/ lib/
grep -rnE '\.(upcase|swapcase|casecmp\?)|downcase\(:fold\)' app/ lib/
Step 1 is the one that matters. Version managers, multi-stage Docker builds, and long-lived workers make it common for the installed Ruby and the running Ruby to differ.
Mitigations if you cannot patch right now
Ruby has published no official workaround. These reduce exposure while you upgrade:
- Restrict access to self-hosted Ruby apps and internal tools that do not need to be public.
- Normalize to UTF-8 first in your own code:
str.encode("UTF-8", invalid: :replace, undef: :replace).upcase. This protects code you control, but not the undisclosed framework path. - Add a detection-mode WAF rule. Equixly suggests flagging 21 or more URL-encoded
%DFbytes in a single parameter:
It is untested against the Rails path, will not see raw(?i)(?:%df(?:[^%&]|%[^d&]|%d[^f&])*){21}0xDFbytes in multipart bodies unless your WAF inspects them, and can match legitimate German text. Start in log-only mode. - Plan the exit from Ruby 3.2 and older. There will be no fix. Isolate those apps and move them to 3.3 or newer.
Look for signs of exploitation
No indicators of compromise have been published, and no exploitation had been reported as of November 19. Heap corruption is noisy, though, so watch for:
[BUG] Segmentation faultin Ruby logs, or glibc aborts such asmalloc(): corrupted top sizeandfree(): invalid next size.- Unexplained Puma, Unicorn, or Sidekiq worker restarts, especially several tied to requests from the same source.
- Requests declaring
charset=iso-8859-1orwindows-1252, or carrying long runs of%DF.
If you find a pattern of crashes on an internet-facing app, treat it as a possible compromise. A Rails worker can read secret_key_base, decrypted credentials, the database password, and downstream API tokens, so rotate those after you patch.
The lesson for API teams: encoding is input too
Ruby2Shell is an interpreter bug, and you cannot fix it in application code. It still carries a lesson every API team can act on: the character encoding a client declares is attacker-controlled input, and the code that handles unusual encodings is the least tested code in most stacks.
- Pick one encoding and enforce it. Accept UTF-8, reject or transcode everything else at the edge, and say so in your OpenAPI spec.
- Bound string lengths. Ruby2Shell needs 21+ special characters in one value. Sensible
maxLengthlimits on names, codes, and identifiers make whole classes of bugs harder to reach. - Never compile user input as a regexp. Use
Regexp.escape, or a purpose-built search syntax. - Treat 5xx responses to odd input as security signals. A crash on a weird charset or long string is a parser telling you something.
How DastPilot helps around a bug like Ruby2Shell
To be upfront: DastPilot will not tell you which Ruby a server runs, and it does not fire Ruby2Shell payloads, because exploitability depends on heap layout and a crash-inducing probe against production is a denial of service you caused yourself. Use the checks above and your image scanner to find affected interpreters, and patch.
Where dynamic application security testing earns its place is around the patch. DastPilot scans your Rails and Sinatra APIs from an OpenAPI spec or Postman collection, as every role you configure. The checks most relevant this week:
- Missing authentication: calls every documented endpoint with no credentials, giving you a concrete list of what anonymous callers can reach on each Ruby service, so you patch the most exposed ones first.
- Improper input handling: fuzzes parameters and bodies with oversized, malformed, and out-of-spec values and flags 5xx responses and unexpected successes, the kind of fragile parsing that pre-auth bugs live in.
- Broken token handling: sends tampered, expired, and malformed tokens and session cookies, and flags endpoints that accept them, which matters if
secret_key_baseneeds rotating after an incident. - Privilege escalation (BFLA) and object access (BOLA): replays admin operations as lower roles and swaps object IDs between users, so a foothold on one account does not become access to all of them.
- Regression tracking: each scan is compared with the last, so if the Ruby upgrade, a new base image, or rotated secrets change how your auth layer behaves, it shows up as a new or reopened finding.
Patch Ruby to close Ruby2Shell. Then run DastPilot in your CI/CD pipeline against the rebuilt service, so the upgrade ships with proof that authentication and authorization still hold.
Frequently asked questions
What is Ruby2Shell (CVE-2026-132825)?
Ruby2Shell, CVE-2026-132825 (GHSA-34m4-m9fh-gqp5), is a one-byte heap buffer overflow in Ruby’s string case conversion for legacy single-byte encodings such as ISO-8859-1 and Windows-1252. Upcasing a string with 21 or more German sharp s (ß) characters writes one byte past the end of a heap buffer. Veria Labs reports it is reachable without authentication in default Rails and classic Sinatra apps. It has been present since Ruby 2.4.0 and was fixed on November 18, 2026.
Which Ruby versions fix Ruby2Shell?
Ruby 4.0.10, 3.4.13, and 3.3.14, released on November 18, 2026. Affected versions are 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, and 3.3.13 and earlier. Ruby 3.2 and older are end of life and will not be patched. Upgrading gems such as Rails does not fix it; the Ruby interpreter must be upgraded and every process restarted.
Are UTF-8 Rails apps affected by Ruby2Shell?
UTF-8 strings use a different code path and are not affected by CVE-2026-132825, and Rails uses UTF-8 by default. However, Veria Labs reports that default Rails apps can still be reached with attacker-supplied text in a legacy encoding, and has not yet published the exact path. Treat all Rails apps on affected Ruby versions as exposed until patched.
Is there a workaround for Ruby2Shell?
Ruby has published no official workaround. Interim measures include restricting self-hosted Ruby apps such as GitLab or Mastodon to a VPN, converting input to UTF-8 before changing case in your own code, and a WAF rule in detection mode that flags 21 or more %DF sequences in one parameter. None of these replace upgrading Ruby.
Is Ruby2Shell being exploited?
As of November 19, 2026 there were no reports of exploitation in the wild. The Ruby team says proofs of concept demonstrate remote code execution for several of the seven flaws, and Veria Labs plans to publish its proof of concept about a week after disclosure. Crafted requests can crash Ruby workers even when code execution fails.
Can a DAST scanner detect Ruby2Shell?
Not reliably, and firing exploit payloads at production can crash workers. Check the Ruby version each running process uses instead. API DAST tools such as DastPilot help around the patch by mapping which endpoints accept input without authentication, fuzzing parameters with out-of-spec values to surface 5xx errors, and catching authorization regressions after the Ruby upgrade.
Know what anonymous callers can reach on your Ruby APIs
DastPilot maps your unauthenticated surface, fuzzes every documented endpoint with out-of-spec input, tests BOLA and BFLA as each role, and flags regressions after every upgrade. 30-day free trial, no credit card required.