the short version
- Affected: Ruby 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, 3.3.0 to 3.3.13, and every release back to 2.4.0. Fixed: Ruby 3.3.14, 3.4.13 and 4.0.10. Ruby 3.2 and older are end of life and get no patch.
- Rails and classic-style Sinatra expose the bug in their default configuration. Neither source names a Rails version boundary, so exposure follows the Ruby version. Application code on other frameworks that upcases legacy-encoded strings may also be vulnerable.
- Products that bundle their own Ruby need a vendor release. As of 20 November 2026, GitLab 19.6.0 and earlier, GitHub Enterprise Server 3.22.5 and earlier, and Chatwoot 4.20.0 and earlier have none.
- The Rails exploit chain is not public yet. Veria Labs plans to publish a proof of concept on 25 November 2026, or later if major vendors have not shipped fixes.
Ruby2Shell (CVE-2026-132825), written Ruby2ßhell by Veria Labs, is a pre-authentication remote code execution bug in Ruby's string case conversion. It is reachable on stock Rails and classic-style Sinatra. Affected versions are Ruby 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, 3.3.0 to 3.3.13, and every older release back to 2.4.0. The trigger is a string in a single-byte legacy encoding containing 21 ß characters, which overflows a heap buffer by one byte when upcased. The full chain to code execution on Rails is not yet public. The fixes are Ruby 3.3.14, 3.4.13 and 4.0.10, released on 18 November 2026. Ruby 3.2 and older are end of life and will not be patched.
Veria Labs published its write-up on 19 November 2026. The name points at the trigger: upcasing ß in a single-byte encoding. The Ruby core team's advisory, posted on 18 November, lists a one-byte heap buffer overflow in string case conversion as GHSA-34m4-m9fh-gqp5. It sits alongside six other Regexp and case-conversion bugs fixed in the same releases. The Ruby advisory notes that CVE identifiers had been requested but not yet assigned when it was published, which is why it uses GHSA identifiers while Veria Labs uses the CVE number.
Which Ruby and Rails versions Ruby2Shell affects
The affected component is the Ruby interpreter, not the framework. Veria Labs lists Rails and Sinatra (classic style) as affected in their default configuration when they run on an affected Ruby. Other frameworks and plain Rack are not exposed by default. Neither source lists specific Rails versions, so the safe reading is that any Rails app running on a vulnerable Ruby is in scope.
- Ruby 4.0: 4.0.0 to 4.0.9 affected, fixed in 4.0.10
- Ruby 3.4: 3.4.0 to 3.4.12 affected, fixed in 3.4.13
- Ruby 3.3: 3.3.0 to 3.3.13 affected, fixed in 3.3.14
- Ruby 3.2 and older: all releases back to 2.4.0 affected, end of life, no fix
Veria Labs adds that application code that upcases strings received in a legacy encoding may also be vulnerable, even outside Rails and Sinatra. Teams running plain Rack or other frameworks should not treat themselves as clear without auditing for that pattern.
Why 21 ß characters overflow the buffer
Most of Ruby's single-byte encodings have no capital ß, so upcasing one writes two bytes, SS. The conversion loop only bounds-checks for one. The output buffer is sized as the input length plus 20 bytes, and each ß adds one byte of output. An input with 21 of them therefore overflows the buffer by one byte. The loop, as Veria Labs excerpts it:
while (*pp < end && to < to_end) { /* room for one byte */
code = *(*pp)++;
if (code == SHARP_s) {
if (flags & ONIGENC_CASE_UPCASE) {
*to++ = 'S'; /* first byte */
code = 'S';
}
/* ... */
}
/* ... */
*to++ = code; /* second byte, unchecked */
}One commenter on Hacker News pointed out that the 20-byte slack suggests the original author expected output could grow, but the slack is fixed and does not scale with input. The same loop appears in several ISO-8859 and Windows-125x encodings and has been there since Ruby 2.4.0. It is reached through upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different code path and are not affected. The upstream fix is commit ruby/ruby@d582f8f.
One commenter asked whether other expanding characters, such as the ffi ligature, could open the same hole. Another replied that ß is the only character that expands in a way that works for this bug. The Veria Labs write-up names only ß in this loop, so that claim rests on the thread rather than on the published analysis.
How one written byte reaches code execution on Rails
The primitive is narrow. One byte lands directly after the output buffer: S (0x53) when upcasing, or s (0x73) when case-folding. The attacker controls the buffer size through the input length. Copying the result out of the buffer then reads one byte out of bounds. The Ruby advisory says the core team is aware of proofs of concept that prove this flaw can be used to trigger RCE in some scenarios.
Neither source publishes the chain from that byte to a shell on stock Rails. Veria Labs says it will release a proof of concept on 25 November 2026, or later if major vendors have not shipped a fix by then. On the entry point, one commenter on Hacker News said that Rails respects the charset attribute in the Content-Type of multipart/form-data POSTs, for example Content-Type: text/plain; charset=Windows-1252. If that is correct, it could be how an unauthenticated request puts a legacy-encoded string in front of a case conversion. The sources do not say which Rails code path performs the case conversion.
One commenter asked how a single-byte overflow becomes RCE. Replies pointed to a 1999 Phrack 55 article on single-byte overflows and to overwriting an adjacent allocation's size field. Others cited heap grooming and Project Zero's 2014 work turning a single NUL byte heap overflow in glibc into code execution. Another commenter doubted that such exploits are generic rather than tied to specific library and kernel versions. These are general techniques and opinions, not a description of this exploit, and the sources do not answer that question until the proof of concept is out.
GitLab, GitHub Enterprise Server and Chatwoot have no fix
Products that bundle their own Ruby cannot be fixed by upgrading the host Ruby; the fix has to come from the vendor. Veria Labs' table, updated 20 November 2026 at 01:28 UTC, splits them into patched and vulnerable products.
- GitLab 19.6.0 and earlier: no fixed release, vulnerable
- GitHub Enterprise Server 3.22.5 and earlier: no fixed release, vulnerable
- Chatwoot 4.20.0 and earlier: no fixed release, vulnerable
- Mastodon 4.7.5 and earlier: fixed in 4.7.6, 4.6.12, 4.5.22, 4.4.29
- OpenProject 17.9.7 and earlier: fixed in 17.9.8, 17.8.3
- Discourse base image before 2.0.20261119-0203: fixed in 2.0.20261119-0203
For the three unpatched products, Veria Labs says every current version is vulnerable. The sources offer no interim mitigation for them. One commenter defended holding back the proof of concept by pointing out that self-hosted GitLab had not yet shipped a patched Ruby.
Ruby 3.3.14, 3.4.13 and 4.0.10 close the bug
The only remediation either source gives is upgrading Ruby to 3.3.14, 3.4.13 or 4.0.10, and installing vendor releases for bundled software. Neither source describes a configuration-level workaround. Ruby 3.3 is in the security maintenance phase. Anything on 3.2 or older needs a version jump rather than a patch bump, and should be planned before the 25 November proof of concept date.
The same releases close six other bugs. Four have proofs of concept that the advisory says can trigger RCE in some scenarios: a double free and an integer-overflow heap overflow in Regexp compilation, a heap overflow in Regexp#to_s, and an integer overflow in string case conversion. The three Regexp bugs apply to applications that compile attacker-controlled patterns. The remaining two are out-of-bounds reads in case-insensitive Regexp matching, described as allowing memory corruption or memory disclosure and crashes. Upgrading for Ruby2Shell fixes all of them.
Veria Labs says it found the bug independently and was first to demonstrate RCE. The Ruby advisory credits GHSA-34m4-m9fh-gqp5 to Stephan Lipp (Ada Logics) and Anthropic. Veria Labs also lists Moritz Sanft, in collaboration with OpenAI, as an additional discoverer.
Questions this raises
Which Ruby versions fix Ruby2Shell?
Ruby 3.3.14, 3.4.13 and 4.0.10, released on 18 November 2026, fix the bug. Ruby 3.2 and older are end of life and will not be patched, so those apps need a version jump.
Is there a workaround for Ruby2Shell if I cannot upgrade Ruby?
Neither Veria Labs nor the Ruby advisory describes a configuration-level workaround. The only remediation given is upgrading Ruby or installing vendor releases for products that bundle their own Ruby.
Are GitLab and GitHub Enterprise Server patched against Ruby2Shell?
Not yet. Veria Labs' table, updated 20 November 2026, lists GitLab 19.6.0 and earlier, GitHub Enterprise Server 3.22.5 and earlier, and Chatwoot 4.20.0 and earlier as vulnerable with no fixed release. Mastodon, OpenProject and Discourse have shipped fixes.
Spotted an error? Email samir.s.sengupta@gmail.com and I will correct it and date the change at the top of the note. How these notes are researched, drafted and checked is in the editorial policy.
