Cloudflare Adds WAF Protection Against Critical Ruby2Shell Vulnerability (CVE-2026-132825)
Cloudflare has introduced new WAF rules to block the critical Ruby2Shell vulnerability (CVE-2026-132825) across Free and paid plans. The flaw could enable pre-authentication remote code execution in vulnerable Ruby applications.
Xcademia Team

Cloudflare has introduced new Web Application Firewall (WAF) protections against Ruby2Shell (CVE-2026-132825), a critical heap buffer overflow vulnerability in Ruby that could allow remote code execution under certain conditions.
Disclosed by the Ruby team on November 19, 2026, the vulnerability affects string case-conversion operations involving specific legacy single-byte character encodings. Ruby has confirmed it is aware of proof-of-concept exploits that can achieve remote code execution in some scenarios.
Cloudflare has added two managed WAF rules to its Free Managed Ruleset and Cloudflare Managed Ruleset, with Block configured as the default action. The protections cover both Ruby2Shell and a related integer overflow vulnerability, GHSA-87fm-7w84-j2px.
According to Cloudflare, the new rules protect customers across Free, Pro, Business and Enterprise plans, although paid-plan customers need to verify that the relevant managed ruleset is deployed.
Cloudflare also emphasised that WAF protection is a temporary defensive measure, not a replacement for upgrading vulnerable Ruby installations.
Understanding the Ruby2Shell Vulnerability (CVE-2026-132825)
Ruby2Shell is a heap buffer overflow vulnerability affecting the way Ruby handles certain string case-conversion operations.
Ruby strings support multiple character encodings, including UTF-8 and legacy single-byte formats such as ISO-8859-1 (Latin-1) and Windows-1252.
In single-byte encodings, each character normally occupies one byte. This means changing the case of a string generally produces output of the same length.
However, the German sharp s character (ß) creates an exception. Its uppercase representation consists of two characters: SS.
Cloudflare explains that in 14 ISO-8859 and Windows-125x encodings, Ruby writes both output bytes but calculates available buffer space for only one byte.
According to Veria Labs, a string containing 21 sharp s characters can trigger a one-byte overflow in the output buffer.
The affected Ruby methods include:
upcaseswapcasedowncase(:fold)casecmp?
UTF-8 strings follow a different processing path and are not affected by this specific vulnerability.
Although the overflow involves only one byte, it can still create a memory-corruption condition. A write beyond the allocated heap buffer could corrupt an adjacent object or allocator metadata, potentially creating an opportunity for code execution.
Ruby has confirmed awareness of proof-of-concept exploits that achieve remote code execution in some scenarios. Veria Labs also indicated that it planned to publish its own proof of concept approximately one week after disclosure.

Why Default Ruby on Rails and Sinatra Applications Are Exposed
One of the significant concerns surrounding Ruby2Shell is that certain commonly used web framework configurations can reach the vulnerable code before authentication.
HTML forms primarily support GET and POST requests. To handle other HTTP methods, such as PUT, PATCH and DELETE, many web frameworks use a _method parameter inside POST requests.
Ruby's Rack interface provides this functionality through its MethodOverride middleware. The middleware converts the _method parameter value to uppercase when processing the request.
Ruby on Rails includes this middleware by default, while classic-style Sinatra applications enable it.
An attacker can potentially exploit this behavior by sending a specially crafted multipart POST request. The request contains a _method field that declares a legacy character encoding and includes a sequence of sharp s characters.
The framework attempts to convert the value to uppercase while routing the request. This happens before application-level code or authentication checks run.
As a result, default Ruby on Rails and classic-style Sinatra applications can reach the vulnerable code without requiring an authenticated user.
Veria Labs reports that other frameworks and plain Rack applications are not exposed by default. However, application code that performs case conversion on attacker-controlled strings using legacy encodings may still be vulnerable, regardless of the framework.
Which Ruby Versions and Applications Are Affected?
Cloudflare identifies the following Ruby versions as affected:
Ruby Branch | Affected Versions |
|---|---|
Ruby 3.3 | 3.3.13 and earlier |
Ruby 3.4 | 3.4.0 through 3.4.12 |
Ruby 4.0 | 4.0.0 through 4.0.9 |
Veria Labs reports that the vulnerability has existed since Ruby 2.4.0.
Ruby 3.2 and earlier have reached end of life and will not receive the security fix.
The issue also affects applications and products that bundle vulnerable Ruby runtimes.
As of November 19, 2026, Veria Labs identified the following self-hosted software releases as including an affected Ruby version:
Software | Release |
|---|---|
GitLab | 19.6.0 |
GitHub Enterprise Server | 3.22.5 |
Mastodon | 4.7.5 |
OpenProject | 17.9.7 |
Discourse | 2026.10.1 |
Chatwoot | 4.20.0 |
These versions reflect the releases identified in the disclosure context, not a statement that every deployment remains vulnerable regardless of subsequent updates.
Cloudflare also notes that Discourse moved its Docker base image to Ruby 4.0.10 on November 19. Rebuilding a Docker installation therefore picks up the fixed Ruby version.
Organizations using distribution-provided Ruby packages should also check their package advisories. Linux distributions may backport security fixes without changing the upstream Ruby version number, making the complete package version important when determining exposure.

Ruby Releases Also Fix Six Additional Memory Safety Vulnerabilities
The Ruby releases addressing Ruby2Shell also include fixes for six other memory safety vulnerabilities.
Ruby indicates that several of these additional flaws could also lead to code execution.
One of them, tracked as GHSA-87fm-7w84-j2px, is an integer overflow affecting the same string case-conversion functionality.
Cloudflare has included protection against this issue in its second managed WAF rule.
The remaining five vulnerabilities affect Ruby's regular expression engine.
Most of these issues require an application to compile or match a regular expression pattern supplied by an attacker. Although this behavior is uncommon in typical web applications, it can occur in features involving search functionality, filtering rules and administrative tools.
The fixes for these vulnerabilities are included in Ruby 3.3.14, 3.4.13 and 4.0.10.
How Cloudflare WAF Protects Against Ruby2Shell
Cloudflare has introduced two managed WAF rules to help customers reduce their exposure while upgrading vulnerable Ruby installations.
Both rules are included in:
Cloudflare Free Managed Ruleset.
Cloudflare Managed Ruleset for Pro, Business and Enterprise plans.
The default action for both protections is Block.
New Managed WAF Rules and Rule IDs
Cloudflare has deployed separate rule identifiers for its Free and paid managed rulesets.
Vulnerability | Plan / Ruleset | Rule ID | Default Action |
|---|---|---|---|
Ruby Heap Overflow (CVE-2026-132825) | Free |
| Block |
Ruby Heap Overflow (CVE-2026-132825) | Pro, Business, Enterprise |
| Block |
Ruby Integer Overflow (GHSA-87fm-7w84-j2px) | Free |
| Block |
Ruby Integer Overflow (GHSA-87fm-7w84-j2px) | Pro, Business, Enterprise |
| Block |
The managed ruleset ID for Cloudflare's paid-plan ruleset is:
efb7b8c949ac4650a09736fc376e9aee
Protection Across Free and Paid Plans
Cloudflare says that the Free Managed Ruleset runs automatically for customers on the Free plan. Users do not need to enable it separately.
For Pro, Business and Enterprise customers, the rules are active wherever the Cloudflare Managed Ruleset has been deployed.
However, paid plans provide greater control over ruleset deployment. Consequently, the managed ruleset may not be active on every zone.
Cloudflare recommends that paid-plan customers check their dashboard to confirm that the relevant ruleset is running and that the new protections have not been overridden.

Where Cloudflare WAF Protection Has Limitations
Although managed WAF rules can block malicious HTTP requests passing through Cloudflare, they cannot protect every possible route to vulnerable Ruby code.
Cloudflare identifies two important limitations.
1. Traffic That Bypasses Cloudflare
Requests sent directly to an origin server's IP address do not pass through Cloudflare's WAF.
Similarly, traffic exchanged between internal services does not reach the WAF for inspection.
To reduce this exposure, Cloudflare recommends configuring origin servers to accept traffic only from Cloudflare.
It identifies Cloudflare Tunnel and Authenticated Origin Pulls as examples of approaches that can help enforce this restriction.
2. Non-HTTP Entry Points
Ruby2Shell is not limited to requests received through web applications.
Vulnerable code may also process attacker-controlled strings originating from other sources, including:
Email.
File imports.
Message queues.
Background jobs.
If these inputs reach vulnerable string case-conversion operations without passing through Cloudflare, WAF rules cannot inspect or block the associated processing path.
This is why Cloudflare describes its WAF protections as a compensating control rather than a complete solution.
Additional Protection Through Cloudflare WAF Attack Score
Cloudflare also recommends using WAF Attack Score as an additional defensive layer.
Memory corruption is not necessarily the final stage of an attack. An attacker may need to deliver a second-stage payload, such as shell commands or a reverse shell, before interacting with a compromised server.
Cloudflare's WAF Attack Score uses machine learning to assess incoming requests for remote code execution payloads.
According to the company, this can help identify variations of exploits and post-exploitation traffic that signature-based rules may not detect.
Cloudflare provides the following custom-rule conditions:
For Enterprise plans:
cf.waf.score.rce le 20
For Business plans:
cf.waf.score.class eq "attack"
These conditions can be used to configure rules that block or challenge matching requests.
This approach provides an additional layer of protection alongside the specific Ruby2Shell managed rules.
Cloudflare Reports No Indication of Compromise
Cloudflare says it has patched its own systems that use Ruby against Ruby2Shell.
The company also reports that it has found no indication of compromise and continues to monitor its infrastructure.
Its security team plans to monitor attack traffic and update the managed WAF rules as new exploitation techniques emerge.
Customers can follow changes through the Cloudflare WAF changelog.
What Organizations Should Do Now
Cloudflare recommends that organizations take several steps to identify vulnerable Ruby installations and reduce their exposure.
1. Verify WAF Coverage
Free-plan customers receive the new protections through the automatically running Free Managed Ruleset.
Customers on Pro, Business and Enterprise plans should verify that the Cloudflare Managed Ruleset is deployed and that the relevant rules have not been overridden.
2. Upgrade Vulnerable Ruby Installations
Organizations should upgrade to the fixed Ruby releases:
Ruby 3.3.14
Ruby 3.4.13
Ruby 4.0.10
After upgrading, restart every Ruby process, including background workers, and rebuild container images.
Applications running Ruby 3.2 or earlier should move to a supported Ruby series because these older releases have reached end of life and will not receive the fix.
3. Update Self-Hosted Software
Organizations using products that bundle Ruby should monitor vendor security updates and install fixed releases when available.
This includes GitLab, GitHub Enterprise Server, Mastodon, OpenProject and Chatwoot.
Discourse Docker installations should be rebuilt to pick up the Ruby 4.0.10 base image.
4. Inventory Ruby Runtimes
Organizations should identify every Ruby runtime across their infrastructure, including those embedded in self-hosted applications and container images.
Cloudflare's Zero Wire briefing includes a prompt that can be provided to an AI agent to help locate affected Ruby installations.
Cloudflare also recommends following its WAF changelog for updates to the managed protections.
Why Ruby2Shell Requires More Than WAF Protection
Ruby2Shell demonstrates how a small memory-management error in a widely used programming language can create significant security exposure across web applications and self-hosted software.
Cloudflare's new managed rules provide an additional defensive measure for customers while they work through the process of identifying and upgrading vulnerable Ruby installations.
However, HTTP-based protection cannot cover traffic that bypasses the WAF or vulnerable code reached through non-HTTP inputs.
For organizations using Ruby, the priority remains upgrading to a fixed release, checking bundled runtimes, rebuilding affected containers and verifying WAF coverage.
Cloudflare's announcement reinforces an important security principle: network-level protections can reduce exposure, but they do not replace fixing the underlying software vulnerability.
Source: Cloudflare Blog
About the Author