Original announcement: Cloudflare · 2026-11-20. Read the official announcement.
Summary of the ruby2shell Vulnerability and Cloudflare’s Response
On November 19, 2026, the Ruby team disclosed a critical security flaw known as ruby2shell (CVE-2026-132825), which is a heap buffer overflow in the string case conversion logic of Ruby. This vulnerability enables attackers to potentially execute remote code on vulnerable applications, including default Ruby on Rails and classic Sinatra apps without requiring authentication.
Cloudflare responded promptly by introducing protective Web Application Firewall (WAF) rules that block exploit attempts for all their customers, including those on free plans. These rules are part of the managed WAF rulesets and are set with a default action to block malicious requests related to ruby2shell and a related integer overflow vulnerability.
Who Should Be Concerned?
- Developers and administrators of Ruby applications running versions prior to the patched releases (before Ruby 3.3.14, 3.4.13, and 4.0.10) are at risk.
- Users of Ruby on Rails and classic Sinatra apps in their default setups, as these frameworks use middleware that triggers the vulnerable code path upon upcasing certain HTTP parameters.
- Operators of self-hosted software bundling Ruby, such as GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse, and Chatwoot, which shipped with vulnerable Ruby versions at the time of disclosure.
- Organizations relying on legacy single-byte character encodings, such as ISO-8859-1, because the vulnerable code occurs when converting strings with the German sharp s character (ß) to uppercase.
Technical Details of the Vulnerability
The ruby2shell flaw arises from a fundamental miscalculation in buffer size when Ruby converts strings to uppercase or changes their case in certain legacy encodings. The German sharp s character (ß) uppercases to “SS,” which is two bytes, but Ruby only checks for space for one byte, allowing a one-byte heap overflow. While this seems small, attackers can exploit this overflow to corrupt memory and achieve code execution.
Notably, UTF-8 encoded strings, which follow different code paths, are not affected. The vulnerability is triggered by the automatic uppercasing of HTTP _method parameters in Rack middleware, commonly used in Rails and Sinatra, before any authentication layer.
Actionable Steps for Developers and Administrators
- Verify Cloudflare WAF Coverage: If you use Cloudflare’s free plan, the protected rules are active by default and block ruby2shell attempts. Paid plan users should confirm that the Cloudflare Managed Ruleset is deployed and the ruby2shell rules remain enabled.
- Upgrade Ruby Versions: Update all Ruby runtimes to the fixed versions (3.3.14, 3.4.13, or 4.0.10) and restart all Ruby processes, including background workers and containerized environments.
- Update Self-Hosted Applications: Apply vendor patches for bundled Ruby versions in self-hosted products like GitLab, GitHub Enterprise Server, and others. For example, rebuild Discourse Docker images to incorporate fixed Ruby versions immediately.
- Audit Your Runtime Inventory: Use available guidance, such as tools recommended by Cloudflare’s Zero Wire briefing, to identify all Ruby runtime instances in your infrastructure to ensure none remain vulnerable.
- Implement Defense-in-Depth: Consider enhancing WAF settings using attack scoring for remote code execution attempts if your plan allows, to detect post-exploit behavior beyond initial blocking rules.
- Restrict Direct Origin Access: Configure your origin servers to accept traffic only from Cloudflare to maximize WAF protection coverage and block bypass traffic.
Limitations and Ongoing Monitoring
While Cloudflare’s WAF rules provide critical protection, they cannot cover all exploit vectors, such as internal service traffic or inputs delivered outside HTTP requests. Therefore, patching Ruby remains the only comprehensive remediation. Cloudflare continues to monitor attack patterns related to ruby2shell and will update rules accordingly.
As of this announcement, Cloudflare’s systems utilizing Ruby have been patched with no evidence of compromise detected.
Practical Checklist
- Confirm your Cloudflare WAF has ruby2shell rules enabled.
- Upgrade Ruby runtimes to fixed versions and restart all services.
- Apply updates to self-hosted software bundling Ruby and rebuild containers.
- Audit your infrastructure for vulnerable Ruby runtimes.
- Configure origin server policies to restrict traffic to Cloudflare only.
- Enhance WAF security by enabling attack scoring features if available.


