CVE-2026-132825: Ruby2Shell flaw hits default Rails apps

Ruby has patched a critical flaw that researchers say can be reached over the network without logging in on web applications built with its most popular framework. The bug, tracked as CVE-2026-132825 and nicknamed Ruby2Shell, sits in the programming language itself, so every application running a vulnerable version of Ruby carries it.
The Ruby project released the fixes on 18 November in versions 4.0.10, 3.4.13 and 3.3.14. The release addresses seven memory-safety flaws in total: three rated critical, three high and one moderate. For five of the seven, the maintainers say they are aware of proof-of-concept exploits showing that crafted input can run code on the machine. No attacks using the flaws have been reported so far.
One byte too many
CVE-2026-132825 is a one-byte heap overflow in the code Ruby uses to change the case of text. It affects strings in certain single-byte encodings, such as ISO-8859-1 and Windows-1252. In those encodings, the German letter sharp s (ß) becomes two characters, SS, when it is upper-cased. Ruby checked that the output buffer had room for one more byte, then wrote two, spilling a single byte past the end of a heap buffer. That small overflow can be leveraged into remote code execution, the Ruby team says.
What makes this flaw stand out is how easily it can be reached. Research published on 19 November by Veria Labs under the name Ruby2Shell says the vulnerable code is reachable without authentication in the default configuration of Ruby on Rails and classic-style Sinatra applications. A separate analysis by Moritz Sanft, published the same day, traces the path through Rack, the request-handling layer underneath Rails: during normal processing of a crafted form submission, Rack changes the case of one request field, so a newly generated Rails application reaches the flaw before any of its own code runs. The vulnerable code has been present since Ruby 2.4.0.
Popular platforms in scope
Because the bug lives in the Ruby interpreter rather than in a library, updating an application's gems does nothing to fix it. The Ruby version running on application servers, background workers and container images must be updated and then restarted or rebuilt. The researchers list widely used self-hosted software as affected in the versions current at disclosure, including GitLab, GitHub Enterprise Server, Mastodon and Discourse, which will need their own vendor updates.
Versions 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, and 3.3.13 and earlier are affected. Ruby 3.2 and earlier have reached end of life and will not receive a fix; the project recommends moving to a supported line. Veria Labs says it will publish its proof of concept about a week after disclosure, once users have had time to upgrade, which is likely to accelerate exploitation attempts.
Six more flaws in the same release
The other two critical flaws are both in Ruby's regular expression engine: a double free when compiling a crafted pattern that uses a character-class intersection, and a heap overflow when the size of a compiled regular expression overflows during compilation. Both have proof-of-concept exploits showing remote code execution. The remaining flaws cover a heap overflow in case conversion, a heap overflow in turning a compiled regular expression back into text, and two out-of-bounds reads in case-insensitive matching. Six of the seven flaws do not yet have CVE numbers, and the project says it has requested them.
It is the second time in a month that Ruby has patched its regular expression engine. Fixes released on 23 October sat behind four critical GitLab flaws, one of which drew an attempted attack on Alpine Linux's own GitLab server and was later added to the US CISA list of known exploited vulnerabilities. The lesson for teams running Ruby is the same this time: patch the interpreter, not just the application, and prioritise internet-facing services that process untrusted input.
Sources: The Hacker News; Orca Security.