Ruby Releases ruby2shell Fix: Rails and Sinatra Apps at Risk
Ruby has fixed the critical ruby2shell vulnerability in versions 3.3.14, 3.4.13, and 4.0.10. It may affect Rails and Sinatra apps and, in some cases, lead to remote code execution.
On November 19, 2026, the Ruby team disclosed the critical ruby2shell vulnerability (CVE-2026-132825) and released fixes in Ruby 3.3.14, 3.4.13, and 4.0.10. According to Cloudflare, the vulnerable code can be reached by an unauthenticated request in Rails and classic-style Sinatra apps with default settings. Cloudflare added blocking WAF rules for all customers, including those on the free plan, but the rules are no substitute for updating Ruby.
From case conversion to a buffer overflow
Ruby supports UTF-8 and older single-byte encodings. When converted to uppercase, the German letter ß becomes two characters: SS. In 14 encodings from the ISO-8859 and Windows-125x families, the vulnerable code writes two bytes but checks whether there is room for only one. According to Veria Labs, a string of 21 ß characters overflows the buffer by one byte. UTF-8 strings are handled differently and are not affected by this bug.
The issue affects upcase, swapcase, downcase(:fold), and casecmp?. Even one extra byte can corrupt an adjacent object or memory allocator metadata. The Ruby team is aware of examples in which the bug leads to remote code execution under certain conditions. Veria Labs plans to publish its own example about a week after the disclosure.
In web apps, the path to the bug runs through the _method parameter, which lets a POST request be handled as PUT, PATCH, or DELETE. The Rack MethodOverride component uppercases the parameter’s value during routing, before application code runs or authorization is checked. Rails includes this component by default; classic-style Sinatra apps have the same path. An attack can use a multipart POST request whose _method part declares an older encoding and contains a sequence of ß characters.
According to Veria Labs, other frameworks and ordinary Rack apps are not affected through this path by default. But custom application code can also reach a vulnerable method if it changes the case of an externally supplied string in one of the affected encodings.
Cloudflare protection and the Ruby update
Cloudflare added two blocking rules to each of its free and paid managed WAF rulesets: one for ruby2shell and one for the related integer overflow GHSA-87fm-7w84-j2px in the case-conversion mechanism. The free ruleset works automatically. On paid plans, customers need to check that the Cloudflare Managed Ruleset is deployed in the relevant zone and that the rules’ actions have not been overridden.
The WAF processes only HTTP requests that pass through Cloudflare. Direct access to the origin server and traffic between internal services remain outside its view. The bug can also surface when processing strings from email, files, message queues, and background jobs. Blocking requests therefore reduces risk but does not eliminate the vulnerability itself.
Fixes are available in Ruby 3.3.14, 3.4.13, and 4.0.10. After updating, all Ruby processes, including background processes, must be restarted, and container images must be rebuilt. Ruby 3.2 and earlier series are no longer supported and will not receive fixes. For distribution packages, check the full version against the distributor’s advisories: the fix may be backported without changing the major version number.
Products that ship with their own Ruby are also worth checking. At the time of disclosure, Veria Labs listed the latest releases of GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse, and Chatwoot among those affected. The Discourse Docker image was moved to Ruby 4.0.10 on November 19, so the fix can be obtained by rebuilding the installation. The same Ruby releases also fix six other memory-safety issues, five of them related to the regular expression engine.
What site owners and teams should check
The practical order is to find out where Ruby is used—in the app, background processes, containers, and installed products—check versions and available fixes, then check WAF coverage and update the runtimes. For Rails and Sinatra in the configurations described, this check cannot wait for a change to application code: the vulnerable call happens earlier. Confirming that a WAF rule is working and confirming that Ruby has been updated are separate tasks.
My take
I would start by listing the runtimes and the paths through which data enters the system. Otherwise, you could update the web container but leave an older Ruby in a background worker or a product with an embedded runtime. If strings arrive through channels other than HTTP, checking a single route does not give you the full picture.
I see the WAF as a temporary additional barrier while updates are rolled out. I would prioritize the work based on Ruby versions, whether the app is accessible from outside, and whether all affected processes can be restarted. An enabled rule alone does not tell you whether vulnerable code remains in the infrastructure.
Sources
Where the news comes from. The text is a retelling in the author’s own words; the facts come from the source, the opinion is the author’s.
- How Cloudflare WAF protects against ruby2shell (CVE-2026-132825) blog.cloudflare.com
Backend developer
I develop APIs and services with catalogs and user accounts. I work in Baku; in discussions, I usually start by clarifying the traffic load and data model.
All posts by the authorRelated articles
PHP Core Vulnerabilities Patched That Could Allow Remote Code Execution
PHP has patched core vulnerabilities that could lead to remote code execution and process memory disclosure. Website owners should check their PHP version and install the security update.
Linux Kernel Vulnerability Allows Attacks via Incoming TCP Connections
A critical Linux kernel flaw allows attackers to target servers through incoming TCP connections without a password. Server owners should check their distribution’s patch status and install the update.
Two Critical NGINX Vulnerabilities Allow Code Execution via HTTP/2
F5 has patched two critical NGINX HTTP/2 vulnerabilities that could allow unauthenticated code execution on the server. Administrators should check their versions and update affected instances.
Discussion 4
Sardor N.
The “Rails and Sinatra apps at risk” framing feels broader than the mechanism described: the overflow depends on specific legacy encodings reaching the vulnerable case-conversion path, so framework and default settings alone don’t establish that an app is exploitable. I’d treat the framework list as a reason to check exposure, not as a vulnerability verdict.
Ramin Aliyev
@sardor.web, fair distinction: the framework list is a signal to investigate, not proof of exploitability. Do you know whether the vulnerable conversion path is reachable with ordinary request data in those default setups, or does it still require an app-specific route to feed legacy-encoded strings into it?
Murad Huseynov Post author
The report says an unauthenticated request can reach the vulnerable code in Rails and classic-style Sinatra apps with default settings, so it doesn’t appear to require a custom route. That establishes reachability, not that every app can supply the specific legacy-encoded string needed for the overflow; teams should verify how request data is decoded and passed into case conversion.
Rustam Yuldashev
We’ve had to patch Ruby across several store services after encoding-related edge cases surfaced, and the hidden cost was rebuilding every image pinned to an affected runtime; a WAF rule is useful cover, not a release plan.