Cloudflare Adds WAF Rules for Ruby2Shell, a Pre-Authentication Ruby Heap Overflow

· Original article ↗

Summary

Ruby’s CVE-2026-132825 heap overflow can enable pre-authentication code execution in default Rails and classic Sinatra setups. Cloudflare added blocking WAF rules, but says they are only a compensating control; upgrading Ruby is the complete fix.

Key points

  • Ruby disclosed a heap buffer overflow in string case conversion affecting 14 ISO-8859 and Windows-125x encodings; UTF-8 strings use an unaffected code path.
  • Ruby says it is aware of proofs of concept for remote code execution in some scenarios. Veria Labs reports default Rails and classic Sinatra configurations can reach the flaw before authentication through Rack’s MethodOverride middleware.
  • Affected releases include Ruby 3.3.13 and earlier, 3.4.0–3.4.12, and 4.0.0–4.0.9; fixes are in 3.3.14, 3.4.13, and 4.0.10.
  • Cloudflare added blocking managed WAF rules for ruby2shell and the related integer overflow GHSA-87fm-7w84-j2px. Paid-plan customers should confirm the managed ruleset is deployed.
  • The WAF cannot protect vulnerable code reached through traffic that bypasses Cloudflare or through non-HTTP inputs such as email, file imports, and background jobs; upgrading Ruby is the complete fix.
  • Cloudflare says it patched its own Ruby systems, has found no indication of compromise, and continues to monitor attack traffic.

Article Details

Vulnerability Types
  • Heap buffer overflow
  • Integer overflow
Severity
Critical
Affected Versions
  • Ruby 3.3.13 and earlier
  • Ruby 3.4.0–3.4.12
  • Ruby 4.0.0–4.0.9
Exploitation Status
unknown
Exploit Availability
claimed_or_private
Patch Status
available
Workarounds
  • Deploy the Cloudflare WAF rules for ruby2shell as a compensating control; this does not replace patching.
  • Configure the origin to accept traffic only from Cloudflare to reduce exposure to requests that bypass the WAF.

MITRE ATT&CK

CVE

Vendors

Products

Chatwootthat bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest release at the time of disclosure.Cloudflare WAFCloudflare WAF blocks ruby2shell for all customers, including those on the Free plan. We have added two rules to both the Cloudflare Free Managed Ruleset and the Cloudflare Managed Ruleset, with Block as the defaultDiscourseproducts that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest release at the time of disclosure.GitHub Enterprise Serverbefore any authentication. Self-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest releaseGitLabtheir default configuration, before any authentication. Self-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby inMastodonany authentication. Self-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest release at the time ofOpenProjectSelf-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, shipped an affected Ruby in their latest release at the time of disclosure.RubyOn 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 thatRuby on RailsThe reach is wide. Veria Labs reports that Ruby on Rails and classic-style Sinatra applications reach the bug in their default configuration, before any authentication. Self-hosted products that bundle Ruby, includingSinatraThe reach is wide. Veria Labs reports that Ruby on Rails and classic-style Sinatra applications reach the bug in their default configuration, before any authentication. Self-hosted products that bundle Ruby, including

Related Articles