WritingCloudflare (Workers AI)Cloudflare (Workers AI)published Nov 19, 2026seen 1w

How Cloudflare WAF protects against ruby2shell (CVE-2026-132825)

Open original ↗

Captured source

source ↗
published Nov 19, 2026seen 1wcaptured 1whttp 200method plain

How Cloudflare WAF protects against ruby2shell (CVE-2026-132825) | Cloudflare Blog

Skip to content

On November 19, 2026, the Ruby team disclosed ruby2shell ( CVE-2026-132825 ), a heap buffer overflow in the way Ruby changes the case of strings. Ruby rates the flaw Critical and says it is aware of proofs of concept that achieve remote code execution in some scenarios. Fixes shipped in Ruby 3.3.14, 3.4.13, and 4.0.10 . The reach is wide. Veria Labs reports that Ruby on Rails and classic-style Sinatra applications reach the bug in their default configuration, before any authentication. Self-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest release at the time of disclosure. Cloudflare WAF blocks ruby2shell for all customers, including those on the Free plan. We have added two rules to both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, with Block as the default action: one for ruby2shell and one for GHSA-87fm-7w84-j2px, a related integer overflow in Ruby string case conversion fixed in the same releases. The WAF is a compensating control, not a replacement for patching. Exploits can reach the bug through paths a WAF does not see, and the only complete fix is to upgrade Ruby. Our team continues to monitor attack traffic and will update the rules as new techniques appear. You can track rule changes in the WAF changelog  and get the latest on the vulnerability in the Cloudflare Zero Wire briefing . Cloudflare has patched its own systems that use Ruby, and we have found no indication of compromise. What we know about ruby2shell Ruby strings carry an encoding, and Ruby still supports many legacy single-byte encodings, such as ISO-8859-1 (Latin-1) and Windows-1252, alongside UTF-8. In a single-byte encoding each character takes one byte, so changing the case of a string usually produces output of the same length. The German sharp s (ß) breaks that assumption. Its uppercase form is two characters, SS. In 14 ISO-8859 and Windows-125x encodings, Ruby writes those two bytes but checks for room for only one. According to Veria Labs, a string with 21 sharp s characters overflows the output buffer by one byte. The methods that reach the bug are upcase , swapcase , downcase(:fold)  and casecmp? . UTF-8 strings take a different code path and are not affected. A one-byte overflow can look harmless. In a memory-corruption exploit, though, a single byte written past the end of a heap buffer can be enough to corrupt an adjacent object or allocator metadata. Ruby says it is aware of proofs of concept that turn this flaw into code execution, and Veria Labs says it will publish its own proof of concept about a week after disclosure. We expect scanning to start soon after. Why default Rails and Sinatra apps are exposed HTML forms can only send GET and POST requests. To simulate PUT, PATCH, or DELETE, many web frameworks accept a _method  parameter in a POST request. Rack, the interface most Ruby web frameworks build on, implements this in its MethodOverride middleware, which converts the value of _method  to uppercase. Rails includes this middleware by default, and classic-style Sinatra applications enable it. An attacker can send a multipart POST request whose _method  part declares a legacy character set and contains a run of sharp s characters. The framework upcases the value while it is still routing the request, before any application code or authentication check runs. Veria Labs reports that other frameworks and plain Rack applications are not exposed by default. Application code that changes the case of strings received in a legacy encoding may still be affected, wherever the string comes from. Who is affected Condition Details

Ruby version Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Veria Labs reports the bug has been present since Ruby 2.4.0. Ruby 3.2 and earlier have reached end of life and will not receive the fix.

Framework Rails and classic-style Sinatra in their default configuration. Any other code that changes the case of attacker-controlled strings in a legacy single-byte encoding.

Bundled software As of November 19, 2026, Veria Labs lists 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 bundling an affected Ruby in their latest release. Discourse moved its Docker base image to Ruby 4.0.10 on November 19, so rebuilding a Docker install picks up the fix.

Distribution packages can backport fixes without changing the Ruby version number, so check the full package version against your distribution's advisory. Six more Ruby flaws in the same release Ruby 3.3.14, 3.4.13, and 4.0.10 also fix six other memory safety flaws , and Ruby says several of them can lead to code execution. One, GHSA-87fm-7w84-j2px, is an integer overflow in the same string case conversion code, and our second WAF rule covers it. The other five are in Ruby's regular expression engine. Most of them require the application to compile or match a regular expression pattern supplied by the attacker. That is uncommon in web applications, but it does happen in search features, filtering rules and admin tools. How Cloudflare WAF protects you Upgrading every Ruby runtime takes time, especially when Ruby is bundled inside self-hosted products and container images. Cloudflare WAF reduces your exposure while you patch. New managed rules, on for every customer Both rules are part of the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee), with Block as the default action. Rule description Rule ID Ruleset Default action

Ruby - Heap Overflow - CVE:CVE-2026-132825 7328f23691e44b07892ebd25b19210f1 Cloudflare Free Managed Ruleset (Free plan) Block

Ruby - Heap Overflow - CVE:CVE-2026-132825 1afa543a1ed84893b01df04c34402c88 Cloudflare Managed Ruleset (Pro, Business and Enterprise plans) Block

Ruby - Integer Overflow - GHSA-87fm-7w84-j2px 8660e37e86444f9f9267ba22e9855f05 Cloudflare Free Managed Ruleset (Free plan) Block

Ruby - Integer Overflow - GHSA-87fm-7w84-j2px 6defac6a52334542adf4a162daf25922 Cloudflare Managed Ruleset (Pro, Business and Enterprise plans) Block

On the Free plan, the Cloudflare Free Managed Ruleset runs automatically, so there is nothing to turn on. On paid plans, the rules are active wherever the...

Excerpt shown — open the source for the full document.

Notability

notability 2.0/10

Not AI-related; routine security blog post.