Ruby2ßhell pre-auth RCE on stock Rails
Archived — this story has rotated out of today’s deck. It is kept here in full.
The gist
Security firm Veria Labs disclosed Ruby2Shell, a one-byte heap overflow in Ruby's case conversion that can give unauthenticated code execution on stock Rails apps.
The fix is in the Ruby interpreter itself, so updating Rails or any gem does nothing.
Background
Ruby2Shell is the name Veria Labs, a security firm, gave to a one-byte heap buffer overflow in Ruby's string case conversion for legacy single-byte encodings, a bug present since Ruby 2.4.0. The route into Rails runs through Rack's MethodOverride middleware, enabled by default in Rails, which calls .upcase on the _method value and honours a charset parameter on multipart form fields. Because the flaw sits in the Ruby interpreter, updating Rails or any other gem does nothing to fix it. Ruby released fixed versions 4.0.10, 3.4.13 and 3.3.14 on November 18, 2026, alongside six other flaws in its regular expression engine and case conversion.
How it unfolded
- 2016Ruby 2.4.0 is released; the vulnerable case-conversion loop has been present since this version.
- Oct 26, 2026Durendal's timeline puts its first end-to-end exploit against a toy Rails app on this date.
- Nov 5, 2026OpenAI researcher Sylvie demonstrated code execution against a stock Rails app using the jemalloc allocator; OpenAI reported the flaw to the Ruby security team.
- Nov 6, 2026Sylvie reproduced the code execution with glibc's default allocator.
- Nov 18, 2026Ruby released fixed versions 4.0.10, 3.4.13 and 3.3.14 together with six other flaws; Veria Labs disclosed the flaw as Ruby2Shell (GHSA-34m4-m9fh-gqp5).
- Nov 19, 2026Moritz Sanft of Durendal, working with OpenAI, published a separate technical account describing working pre-auth exploits against a fresh rails new app; Discourse updated its Docker base image. Veria Labs' status table listed GitLab 19.6.0, GitHub Enterprise Server 3.22.5, Mastodon 4.7.5, OpenProject 17.9.7, Discourse 2026.10.1 and Chatwoot 4.20.0 as affected, while Mastodon 4.7.6, OpenProject 17.9.8 and Discourse base image 2.0.20261119-0203 already ship the fixed 4.0.10.
- Nov 20, 2026As of this date the fix exists only in upstream Ruby 4.0.10, 3.4.13 and 3.3.14; Ruby 3.2 and earlier are end of life and will not be patched.
Key terms
- RCE
- A security flaw letting an attacker run any commands or code of their choice on a target machine or process.
- heap overflow
- A software bug where a program writes more data into a memory buffer than it can hold, overwriting nearby memory.
- Rails
- An open-source server-side web application framework written in Ruby that follows the model-view-controller pattern.
Source: Wikipedia
Who’s saying what
- Official
- Ruby's advisory says the team is aware of PoCs that prove the flaw can be used to trigger RCE in some scenarios.
- Analysts
- Beazley Security says heap corruption bugs are non-trivial to exploit and often crash the system instead of yielding remote code execution, and that protections like ASLR will likely reduce the world-wide impact.
- Caution
- Veria Labs says Rails and classic-style Sinatra are exposed by default, while plain Rack and other frameworks are exposed only if application code uppercases text in a legacy encoding.
- Party
- Durendal says it found the same flaw while using OpenAI's Codex to map Ruby's pre-auth attack surface, and that Ruby's advisory does not credit Durendal or OpenAI.
Still unverified
Equixly reported no CVE had been assigned as of November 19, while other sources track the flaw as CVE-2026-132825; Equixly also found no reports of exploitation in the wild as of November 19. Veria Labs said it plans to publish its proof of concept about a week after disclosure. The write-up's RCE claim rests on heap grooming around the one byte, which the DEV Community author did not attempt.