How Cloudflare WAF protects against ruby2shell (CVE-2026-132825)
A heap buffer overflow in Ruby's string case conversion for legacy single-byte encodings allows a one-byte overflow when upcasing the German sharp s, which can corrupt adjacent memory. An attacker could send a crafted HTTP request to default Rails or Sinatra applications to trigger the bug before authentication, potentially leading to remote code execution.
Published on blog.cloudflare.com
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.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code that converts strings to uppercase in certain legacy encodings writes two bytes for the German sharp s but only checks for space for one byte, causing a one-byte heap overflow.
Impact
An attacker could achieve remote code execution in default Rails and Sinatra applications before authentication, though Cloudflare WAF blocks known exploit attempts and the text notes that exploits can reach the bug through paths a WAF does not see.
What the attacker needed
Ruby version 3.3.13 or earlier, 3.4.0-3.4.12, or 4.0.0-4.0.9; Default Rails or classic-style Sinatra app; Attacker can send HTTP requests
The fix
Upgrade Ruby to version 3.3.14, 3.4.13, or 4.0.10 and restart all Ruby processes; the text also recommends updating bundled software and using WAF as a compensating control.
How it was found
- Send a multipart POST request with a _method parameter that declares a legacy character set and contains many sharp s characters.
- The Rack MethodOverride middleware converts the _method value to uppercase before routing, triggering the overflow.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Ruby is a programming language used by many websites. When it changes lowercase letters to uppercase, it made a small counting mistake for a special German letter, writing two bytes where it had only reserved space for one. That extra byte can overwrite nearby memory, and in some cases an attacker can use this to run their own code on the server.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.