Ruby2Shell is what happens when the German letter ß meets a buffer that was one byte too short. Uppercase it in an old Latin-1 string and Ruby turns one character into two (“SS”), but before the fix it only checked that there was room for one.
In short: Ruby2Shell (CVE-2026-132825) is a one-byte heap overflow in the Ruby interpreter’s case conversion that researchers say an unauthenticated request can reach in default Rails and Sinatra apps. Ruby fixed it on 18 November 2026 in 4.0.10, 3.4.13 and 3.3.14, and only upgrading Ruby itself, then restarting, removes it.
- What is Ruby2Shell?
- Why does Ruby2Shell matter now?
- How does Ruby2Shell work?
- How severe is Ruby2Shell really?
- Who is affected by Ruby2Shell?
- How do you detect Ruby2Shell attempts?
- How do you fix Ruby2Shell?
- Ruby2Shell vs other “2Shell” bugs
- What is still unknown?
- The bottom line
- Sources
What is Ruby2Shell?
Ruby2Shell is a heap buffer overflow in the Ruby interpreter’s string case conversion, tracked as CVE-2026-132825 and GitHub advisory GHSA-34m4-m9fh-gqp5. Some write-ups spell it “ruby2ßhell”. A heap buffer overflow means the program writes past the end of a block of memory it allocated, corrupting whatever sits next to it.
Ruby’s own advisory describes it plainly: when changing the case of a string in some single-byte encodings, Ruby “could write one byte past the end of the output buffer.” Veria Labs, the firm that named the bug and says it was first to demonstrate code execution with it, adds that the output buffer is sized at the input length plus 20 bytes, and the conversion loop checked for one free byte but wrote two.
Who found it?
Credit is shared and slightly contested. Ruby’s advisory credits Stephan Lipp of Ada Logics and Anthropic for this flaw and three of the other six. Veria Labs says it found the bug independently, and its page also credits researcher Moritz Sanft, working with OpenAI. None of the sources settles who was first, and it does not change what defenders need to do.
Why does Ruby2Shell matter now?
It is the latest in a run of named “2Shell” interpreter and server bugs this autumn. CrowdSec framed it as Ruby’s turn after PHP2Shell and Java4Shell, and Sonatype titled its write-up “November2Shell”. We covered the neighbours in phpAfterShell, the PHP session flaw PHP2Shell’s fix missed and Java4Shell’s 65 characters that corrupt the Java heap.
What makes Ruby2Shell different is where it lives. Because the flaw is in the interpreter, Rails version, Gemfile.lock and bundle update are irrelevant. Sonatype, CrowdSec and Netics all make the same point: this is an inventory problem first. You need to know every Ruby binary running in production, including the ones hidden in containers and vendor appliances.
The 18 November release fixed seven bugs
Ruby2Shell was one of seven memory-safety issues in a single advisory. Only Ruby2Shell had a CVE at publication; Ruby said identifiers for the rest had been requested.
| Advisory | Component | Bug class | Ruby’s PoC statement |
|---|---|---|---|
| GHSA-34m4-m9fh-gqp5 (CVE-2026-132825) | String case conversion | One-byte heap overflow | RCE PoC exists |
| GHSA-7x2q-68qv-6p8x | Regexp compilation | Double free | RCE PoC exists |
| GHSA-87fm-7w84-j2px | String case conversion | Integer overflow to heap overflow | RCE PoC exists |
| GHSA-3p8q-wmhx-vm2w | Regexp compilation | Integer overflow to heap overflow | RCE PoC exists |
| GHSA-7whj-cfh7-xgm4 | Regexp#to_s | Heap buffer overflow | RCE PoC exists |
| GHSA-wpqw-5qxg-m68r | Case-insensitive Regexp matching | Out-of-bounds read | Memory corruption |
| GHSA-pvgc-g7gj-pv6h | Case-insensitive backreferences | Out-of-bounds read | None stated |
Ruby says it is aware of proofs of concept that reach code execution “in some scenarios” for five of the seven. Those PoCs were not public when Ruby published.
How does Ruby2Shell work?
The sources describe the mechanism clearly enough to understand it without exploit code. This is the conceptual version.
Why does ß break the buffer?
Most letters keep their length when you change case. The German sharp s (byte 0xDF in Latin-1) does not: its uppercase form is the two letters “SS”. In roughly 14 ISO-8859 and Windows-125x encodings, Ruby’s conversion loop wrote both bytes after checking room for only one. With enough ß characters, the output runs one byte past its heap allocation.
According to Veria Labs and OX Security, the affected methods are upcase, swapcase, capitalize, casecmp? and downcase(:fold) on strings in those encodings. UTF-8 strings are not affected.
What is the overflow worth to an attacker?
One byte sounds harmless. Astra cites a public AddressSanitizer reproduction in which that single byte lands on the size field of the next heap chunk in glibc. Corrupting a chunk size is a classic first step toward wider heap corruption, which is why Ruby and Veria treat it as a code execution risk. The result depends heavily on the heap layout of the specific process.
How does a request reach it in Rails?
This is the part that turned a niche bug into headline news. Veria Labs and CrowdSec describe the default Rails path: Rack’s method override middleware reads the _method form field on POST requests and uppercases it, before any controller or login check runs. A multipart form part can declare its own charset, such as ISO-8859-1, so the string arrives in a vulnerable encoding.
Veria says classic-style Sinatra apps are exposed the same way, while other frameworks and plain Rack apps are not exposed by default. Any application code that tags user input with a legacy encoding and then changes its case can also reach the bug.
How severe is Ruby2Shell really?
The sources disagree more than usual, and the disagreement is useful.
| Source | Verdict |
|---|---|
| MITRE CNA | CVSS 3.1 7.4 High, local vector, high complexity |
| GitHub advisory | Labelled Critical, no score |
| Veria Labs | Critical, network reachable without authentication |
| OX Security | “More Marketing Than Actual Risk”; upgrade, but not ASAP |
| watchTowr (to SecurityWeek) | Production exploitation challenging; denial of service most likely |
| Ubuntu | Medium priority, per Rescana |
The case for caution
OX Security argues that turning a one-byte write into reliable code execution needs heap grooming tailored to each target, and a miss tends to crash the process. Yordan Ganchev of watchTowr told SecurityWeek that the most likely outcome of malformed requests is denial of service. Rescana recorded an EPSS score of 0.00174 on 19 November, which is low.
The case for urgency
Ruby itself says RCE PoCs exist. Veria says it demonstrated RCE on stock Rails and planned to publish a PoC on 25 November 2026, or later if major vendors had not shipped fixes. Its page was last updated on 29 November and still described the PoC as upcoming; we could not confirm whether it has been released. Even if RCE stays hard, a request that crashes Puma or Unicorn workers on demand is a real availability problem.
What is the honest reading?
It is not magic. Ruby2Shell needs a legacy encoding, a case-changing call and a favourable heap. But default Rails satisfies the first two for anyone on the internet, so internet-facing Rails and Sinatra apps should be patched this week, not this quarter.
Who is affected by Ruby2Shell?
| Ruby branch | Vulnerable | 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, back to 2.4.0 per Veria | No fix (end of life) |
Ruby 3.3 is in its final maintenance phase, with support scheduled to end at the end of March 2027, according to the 3.3.14 release notes.
Exposure on the internet
Netics, citing Censys data from 19 November, reported about 4,500 internet-facing WEBrick hosts. Roughly 2,000 ran end-of-life Ruby 2.4 to 3.2, 285 ran a supported branch at a vulnerable version, and none ran a fixed release yet. WEBrick is only one Ruby web server, so treat this as a sample, not a total.
Self-hosted products that bundle Ruby
Many teams run Ruby without writing any. Veria Labs lists these products and their fixed releases:
| Product | Affected | Fixed |
|---|---|---|
| GitLab | 19.6.0 and earlier | 19.6.1, 19.5.8, 19.4.10 |
| GitHub Enterprise Server | 3.22.5 and earlier | 3.22.6, 3.21.11, 3.20.13, 3.19.17 |
| 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 |
| Chatwoot | 4.20.0 and earlier | 4.20.1 |
| Discourse | Base image before 2.0.20261119-0203 | 2.0.20261119-0203 |
How to check your exposure
Rescana and Sonatype suggest checking the Ruby that actually serves requests, not just the one on your laptop:
- Run
ruby -vas the application user, or logRUBY_DESCRIPTIONat boot. - On hosts, list packages with
dpkg -l 'ruby*',rpm -qa 'ruby*'orapk info -v ruby ruby-libs, and check the changelog for CVE-2026-132825. Distribution backports may not change the version string. - Inspect container images; official
rubyimages compile Ruby from source, so some SBOM tools may miss the interpreter. - After patching, look for processes still mapping a deleted
librubyin/proc/*/maps, which means they never restarted.
How do you detect Ruby2Shell attempts?
None of the sources publishes indicators of compromise or an ATT&CK mapping. The closest technique is T1190, Exploit Public-Facing Application, and detection relies on behaviour.
Request patterns
- POST requests with a multipart part that declares a legacy charset such as ISO-8859-1 or Windows-1252, especially on login and other pre-authentication routes.
- A
_methodfield that is long or full of 0xDF bytes. A valid_methodis a short word likePATCHorDELETE, so anything else is suspect.
Process and log signals
Rescana lists the crash signatures to watch for: exit codes 139 (segmentation fault) and 134 (abort), Ruby [BUG] lines in error output, and bursts of worker restarts in Puma, Unicorn, Passenger or Sidekiq. A shell, curl or wget spawned by a Ruby worker is a strong signal for any successful RCE.
WAF coverage
Cloudflare added managed rules on 20 November for CVE-2026-132825 and for the related integer overflow GHSA-87fm-7w84-j2px, blocking by default on all plans including Free. Cloudflare said it found no indication of compromise on its own systems and expected scanning to follow. CrowdSec published a free virtual-patching rule, crowdsecurity/vpatch-CVE-2026-132825, which covers the default Rails pre-login path but not your own code. Both vendors present WAF rules as a stopgap.
How do you fix Ruby2Shell?
- Upgrade Ruby to 4.0.10, 3.4.13 or 3.3.14, or your distribution’s patched package. Start with internet-facing Rails and classic Sinatra apps.
- Restart every Ruby process. Web workers, Sidekiq and other job runners keep the old interpreter in memory until they restart.
- Rebuild and redeploy container images from a fixed base image, then confirm the running version.
- Update self-hosted products that bundle Ruby, such as GitLab and GitHub Enterprise Server, to the fixed releases listed above.
- Plan off Ruby 3.2 and older. No upstream fix exists. Until you migrate, put those apps behind a VPN or IP allowlist and a WAF rule.
- Enable a WAF rule as a temporary layer while you patch, not instead of patching.
- Review your own code for
force_encodingorencodeto ISO-8859 or Windows-125x followed by case changes, and forRegexp.new,Regexp.unionor interpolation with untrusted input, which the other six bugs need.
Ruby2Shell vs other “2Shell” bugs
| Ruby2Shell | phpAfterShell | Java4Shell | |
|---|---|---|---|
| Where | Ruby interpreter | PHP session handler | OpenJDK Base64 decoder |
| CVE | CVE-2026-132825 | CVE-2026-126714 | CVE-2026-114938 |
| Bug class | One-byte heap overflow | Non-atomic file write | 62-byte heap overwrite |
| Default exposure | Rails, classic Sinatra | Default files handler | x86-64 with AVX-512 VBMI |
| Fix type | Upgrade interpreter | Upgrade PHP | Upgrade JDK |
The shared lesson: when the bug is in the runtime, dependency scanners that read lock files miss it. The same pattern showed up in our nginx2root breakdown, where the fix lived in the server binary, not the app.
What is still unknown?
- PoC status. Veria planned to publish on 25 November; its page, updated 29 November, still described it as upcoming. Whether it is out now is unconfirmed.
- Attack vector. MITRE says local and high complexity; Veria and the GitHub advisory treat it as remote and unauthenticated. The score may change.
- The other six CVEs. As of the sources reviewed, none of the other six advisories had a CVE, so scanners keyed on CVE IDs may not flag them.
- Real-world reliability. OX and watchTowr think RCE is hard; Ruby and Veria say they have it. No independent party has published a working exploit against a production app.
The bottom line
Ruby2Shell is a one-byte overflow in the Ruby interpreter that default Rails and Sinatra apps reach before login. Reliable code execution may be hard, but crashes are easy and the fix is simple: upgrade Ruby to 4.0.10, 3.4.13 or 3.3.14, rebuild your images and restart every worker. If you still run Ruby 3.2 or older, this is the bug that should end that.
Sources
- Ruby: Multiple vulnerabilities in Regexp and String (18 Nov 2026)
- Ruby 3.3.14 released
- Veria Labs: Ruby2Shell (CVE-2026-132825)
- SecurityWeek: Ruby Patches Ruby2Shell Vulnerability That Could Lead to RCE
- Cloudflare: How Cloudflare WAF protects against ruby2shell
- OX Security: Ruby2Shell, but is it an actual risk?
- Sonatype: November2Shell continues with 7 patched Ruby vulnerabilities
- CrowdSec: Ruby2Shell virtual patching
- Rescana: Ruby2Shell, patch Ruby now
- Astra Security: Ruby2shell advisory
- Orca Security: ruby2shell heap overflow
- Netics on DEV: Ruby2Shell lands in the interpreter
- CISA Known Exploited Vulnerabilities catalog
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.