The Ruby team published details of ruby2shell (CVE-2026-132825) on November 19, 2026—a heap buffer overflow triggered during string case conversion operations. The flaw carries a Critical severity rating, and the Ruby maintainers have confirmed the existence of working proofs of concept that achieve remote code execution under certain conditions. Patched versions arrived in Ruby 3.3.14, 3.4.13, and 4.0.10.

The vulnerability's scope extends across a significant portion of the Ruby ecosystem. According to Veria Labs, Ruby on Rails and classic-style Sinatra deployments in their standard configuration are vulnerable before any authentication layer takes effect. Multiple self-hosted products that ship with Ruby—GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse, and Chatwoot—included an affected Ruby version in their most recent releases at the time of disclosure.

Cloudflare WAF now blocks ruby2shell attempts for all customers, including those on the Free tier. The company has deployed two new rules to both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, configured to block by default: one targeting ruby2shell itself and another addressing GHSA-87fm-7w84-j2px, a related integer overflow in the same string case conversion code that received fixes in the same releases.

The WAF serves as a compensating control rather than a substitute for patching. Exploits may traverse code paths that the WAF cannot inspect, and upgrading Ruby remains the only complete remediation. Cloudflare's team continues tracking attack patterns and will adjust rules as new exploitation techniques emerge. Updates to WAF rules are documented in the WAF changelog, and additional vulnerability details are available in the Cloudflare Zero Wire briefing.

Cloudflare has applied patches to its own Ruby-based systems and reports no evidence of compromise.

Understanding ruby2shell

Ruby strings include encoding metadata, and the language maintains support for numerous legacy single-byte character encodings—ISO-8859-1 (Latin-1), Windows-1252, and others—alongside UTF-8. In single-byte encodings, each character occupies one byte, so case conversion typically produces output of identical length.

The German sharp s character (ß) violates this assumption. Its uppercase representation consists of two characters: SS. Across 14 ISO-8859 and Windows-125x encodings, Ruby writes both bytes but allocates space for only one. Veria Labs determined that a string containing 21 sharp s characters overflows the output buffer by a single byte. The vulnerable methods include upcase, swapcase, downcase(:fold), and casecmp?. UTF-8 strings follow a different code path and remain unaffected.

A one-byte overflow may appear inconsequential in isolation. Within memory corruption exploits, however, a single byte written beyond a heap buffer's boundary can corrupt adjacent objects or allocator metadata. Ruby's team acknowledges awareness of proofs of concept converting this flaw into executable code, and Veria Labs indicated plans to publish its own proof of concept approximately one week after disclosure. Security scanning tools are expected to activate shortly thereafter.

Why default Rails and Sinatra configurations are vulnerable

HTML forms restrict communication to GET and POST methods. To emulate PUT, PATCH, or DELETE operations, numerous web frameworks accept a _method parameter within POST requests. Rack, the foundation underlying most Ruby web frameworks, implements this behavior through its MethodOverride middleware, which converts the _method value to uppercase. Rails activates this middleware by default, and classic-style Sinatra applications enable it as well. An attacker can craft a multipart POST request where the _method section specifies a legacy character set and includes a sequence of sharp s characters. The framework performs the case conversion while processing the request routing, before application code or authentication mechanisms execute.

Veria Labs reports that other frameworks and plain Rack applications are not vulnerable under default settings. Application code that performs case conversion on strings received in legacy encodings—regardless of their source—may still be susceptible.

Affected versions and products

  • Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Veria Labs indicates the flaw has existed since Ruby 2.4.0. Ruby 3.2 and earlier versions have reached end of life and will not receive patches.
  • Rails and classic-style Sinatra in default configurations, plus any code performing case conversion on attacker-supplied strings in legacy single-byte encodings.
  • As of November 19, 2026, Veria Labs identified 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 vulnerable Ruby versions in their latest releases. Discourse updated its Docker base image to Ruby 4.0.10 on November 19, so rebuilding Docker installations will incorporate the fix.

Distribution packages may backport fixes without incrementing the Ruby version number, so verify the complete package version against your distribution's security advisory.

Six additional Ruby flaws in the same release

Ruby 3.3.14, 3.4.13, and 4.0.10 also address six other memory safety vulnerabilities, several of which Ruby states can lead to code execution. GHSA-87fm-7w84-j2px, an integer overflow in the identical string case conversion code, is covered by Cloudflare's second WAF rule. The remaining five flaws reside in Ruby's regular expression engine. Most require applications to compile or match regular expression patterns supplied by the attacker—an uncommon scenario in web applications, though it occurs in search functionality, filtering systems, and administrative interfaces.

How Cloudflare WAF provides protection

Patching every Ruby installation requires time, particularly when Ruby is embedded within self-hosted products and container images. Cloudflare WAF narrows your risk window during the patching process.

New managed rules active for all customers

Both rules are included in the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee), with Block configured as the default action:

  • Ruby - Heap Overflow - CVE:CVE-2026-132825
  • Ruby - Integer Overflow - GHSA-87fm-7w84-j2px

On the Free plan, the Cloudflare Free Managed Ruleset operates automatically without requiring manual activation. On paid plans, the rules are active wherever the Cloudflare Managed Ruleset is deployed. Since paid plans offer greater control over ruleset deployment, the Cloudflare Managed Ruleset may not be active on every zone. Verifying its status is recommended to ensure the rules are running. The Zero Wire briefing contains links to access the rules directly in your dashboard.

WAF visibility limitations

A WAF blocks exploits when malicious input arrives in HTTP requests passing through Cloudflare infrastructure. However, it cannot intercept every route to vulnerable code:

  • Traffic circumventing Cloudflare. Requests sent directly to your origin IP and traffic between internal services bypass the WAF entirely. Configure your origin to accept traffic exclusively from Cloudflare using methods such as Cloudflare Tunnel or Authenticated Origin Pulls.
  • Alternative entry points to the same code. Ruby code performing case conversion on strings from email, file uploads, message queues, or background jobs can trigger ruby2shell without involving HTTP requests.

Layering defense with WAF attack score

Memory corruption typically represents only the initial stage of an attack. To execute commands, an attacker must deliver a secondary payload—such as shell commands or a reverse shell—and establish interaction with the compromised system. WAF attack score applies machine learning to evaluate each request for remote code execution payloads, helping identify exploit variations and post-exploitation activity that signature-based rules might overlook. On Enterprise plans, create a custom rule blocking or challenging requests with cf.waf.score.rce le 20; on Business plans, use cf.waf.score.class eq "attack".

Impact on Cloudflare systems

Cloudflare has patched its Ruby-based systems against ruby2shell. No evidence of compromise has been identified, and monitoring continues.

Patching guidance

ruby2shell transforms a one-byte miscalculation in string case conversion into a pre-authentication code execution pathway in standard Rails and Sinatra deployments. With a public proof of concept expected within days, the patching window is narrow. Follow these steps:

  1. Verify your WAF coverage. On the Free plan, ruby2shell rules are already blocking. On paid plans, confirm the Cloudflare Managed Ruleset is deployed and the rules have not been customized.
  2. Upgrade Ruby to 3.3.14, 3.4.13, or 4.0.10 and restart all Ruby processes, including background workers. Rebuild container images. Migrate applications running Ruby 3.2 or earlier to a supported version.
  3. Update self-hosted products bundling Ruby—GitLab, GitHub Enterprise Server, Mastodon, OpenProject, and Chatwoot—as vendors release fixes. Rebuild Discourse Docker installations immediately.
  4. Document your runtimes. The Zero Wire briefing provides a prompt for AI agents to identify every affected Ruby runtime across your infrastructure.

Cloudflare's WAF analysts will continue enhancing protections as new exploitation techniques surface. Monitor the WAF changelog for rule updates.