Ruby 3.3.14, 3.4.13 and 4.0.10 fix ruby2shell, a heap buffer overflow in the language's string case conversion code tracked as CVE-2026-132825 and rated Critical by the Ruby team. Proofs of concept that achieve remote code execution in some scenarios are known to exist, and Veria Labs says it will publish its own roughly a week after the November 19, 2026 disclosure.

Cloudflare WAF now blocks exploitation for all customers, Free plan included, as a stopgap while patching proceeds.

The defect

Ruby strings carry an encoding. Alongside UTF-8, Ruby supports legacy single-byte encodings such as ISO-8859-1 and Windows-1252, where case conversion normally yields output of the same length.

The German sharp s (ß) violates that: it uppercases to two characters, SS. In 14 ISO-8859 and Windows-125x encodings, Ruby writes both bytes but reserves space for only one. Veria Labs calculates a string of 21 sharp s characters overflow a output buffer by one byte. The vulnerable methods are upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings follow a separate code path and are unaffected.

A one-byte overwrite of heap memory can still corrupt an adjacent object or allocator metadata — enough, per Ruby, for known proofs of concept to reach code execution.

Why default Rails and Sinatra apps are exposed pre-authentication

Because HTML forms send only GET and POST, Rack's MethodOverride middleware converts a _method parameter into PUT, PATCH or DELETE by upcasing it. Rails ships this middleware by default and classic-style Sinatra applications enable it. An attacker can submit a multipart POST whose _method part declares a legacy character set and carries a run of sharp s characters; the upcasing happens during routing, before application code or authentication logic runs.

Veria Labs reports that other frameworks and plain Rack applications are not exposed by default. Application code that case-changes strings arriving in a legacy encoding remains a risk regardless of where those strings originate.

Scope of affected software

Rails and classic Sinatra reach the bug in their default configuration. Self-hosted products that ship an affected Ruby in their latest release at disclosure time include GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot.

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.

Distributions may backport the fix without bumping the Ruby version number, so compare the full package version against your distribution's advisory.

WAF coverage

Cloudflare added two rules, default action Block, to both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset (Ruleset ID efb7b8c949ac4650a09736fc376e9aee): one for ruby2shell, one for GHSA-87fm-7w84-j2px, an integer overflow in the same case-conversion code.

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

Free plan customers get the Free Managed Ruleset automatically; nothing needs enabling. Paid plans can deploy rulesets with more granularity, so verify that the Cloudflare Managed Ruleset is active on each zone and that neither rule has been overridden. The Zero Wire briefing links directly to both rules in the dashboard.

Paths the WAF cannot cover

Protection applies only to HTTP requests that traverse Cloudflare.

  • Traffic that bypasses Cloudflare. Requests sent straight to your origin IP, and service-to-service traffic, never reach the WAF. Restrict your origin to Cloudflare traffic, for example via Cloudflare Tunnel or Authenticated Origin Pulls.
  • Other inputs to the same methods. Case-changing strings from email, file imports, message queues or background jobs can reach ruby2shell without an HTTP request.

Detecting second-stage traffic

Corrupting memory is only a means to an end; attackers must deliver and operate a payload such as shell commands or a reverse shell. WAF attack score scores each request with machine learning for RCE payloads, catching exploit variants and post-exploitation traffic that signatures miss. A custom rule can block or challenge on cf.waf.score.rce le 20 (Enterprise) or cf.waf.score.class eq "attack" (Business).

Other flaws in the same release

The three Ruby releases also fix six further memory safety bugs, several of which Ruby says can lead to code execution. Besides GHSA-87fm-7w84-j2px, five sit in the regular expression engine and mostly require the application to compile or match an attacker-supplied pattern — uncommon in web applications, though seen in search features, filtering rules and admin tools.

Remediation steps

  1. Verify WAF state. Free plan rules already block. On paid plans, confirm the Cloudflare Managed Ruleset is deployed and both rules are unmodified.
  2. Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10, restarting every Ruby process including background workers. Rebuild container images, and move anything on Ruby 3.2 or earlier to a supported series.
  3. Patch bundled products — GitLab, GitHub Enterprise Server, Mastodon, OpenProject and Chatwoot — as each vendor publishes, and rebuild Discourse Docker installations immediately.
  4. Inventory runtimes. The Zero Wire briefing provides a prompt for an AI agent to locate every affected Ruby runtime in your infrastructure.

Cloudflare has updated its own Ruby systems and reports no indication of compromise. It continues to monitor attack traffic and says WAF rules will be revised as new techniques appear.