Home › Intelligence › Brief
VULNERABILITY BRIEF 🔴 Critical Vulnerability

Critical Ruby Heap Overflow (CVE‑2026‑132825) Enables Pre‑Auth RCE; Cloudflare WAF Blocks Exploits

Ruby versions prior to 3.3.14, 3.4.13 and 4.0.10 contain a heap‑buffer overflow that can be triggered before authentication in default Rails and Sinatra apps. Cloudflare has released WAF rules that block the exploit for all customers. The issue highlights the need for protective‑technology controls and continuous evidence of mitigation.

Verisq™ Intelligence · 📅 November 21, 2026 · 📰 blog.cloudflare.com
Get the weekly threat digestBreaches, exploited vulnerabilities and advisories that matter to your vendors, every Friday. Free.
🔴
Severity
Critical
VU
Type
Vulnerability
🎯
Confidence
High
🏢
Affected
2 sector(s)
✅
Actions
3 recommended
📰
Source
blog.cloudflare.com

Critical Ruby Heap Overflow (CVE‑2026‑132825) Enables Pre‑Auth RCE; Cloudflare WAF Blocks Exploits

What It Is — Ruby 2.4.0‑through 4.0.9 contains a heap‑buffer overflow in the case‑conversion routines (upcase, swapcase, downcase, casecmp?). When a string encoded in a legacy single‑byte charset (e.g., ISO‑8859‑1) includes the German sharp‑s (ß), the uppercase conversion writes one byte past the allocated buffer. Proof‑of‑concept code can turn this one‑byte overrun into remote code execution before any authentication check, especially in default Rails and classic‑style Sinatra apps that automatically upcase the _method parameter. Ruby rates the flaw Critical; patches are in Ruby 3.3.14, 3.4.13, and 4.0.10.

On 19 November 2026 the Ruby core team announced a new vulnerability dubbed “ruby2shell” (CVE‑2026‑132825), a heap‑buffer overflow that occurs when Ruby changes the case of strings. The flaw was classified as Critical, and the team confirmed that proof‑of‑concept code can achieve remote code execution in certain conditions. Patches were released in Ruby 3.3.14, 3.4.13 and 4.0.10, covering the affected branches.

Veria Labs quickly highlighted the breadth of the issue. Default configurations of Ruby on Rails and classic‑style Sinatra applications trigger the bug before any authentication step, and a number of self‑hosted platforms that bundle Ruby also ship vulnerable runtimes. At the time of disclosure the affected releases included 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. Discourse moved its Docker base image to Ruby 4.0.10 on the same day, thereby picking up the fix. The vulnerability has existed since Ruby 2.4.0; any version earlier than 3.3.13, 3.4.0‑12 or 4.0.0‑9 remains vulnerable, while UTF‑8 strings are not impacted.

The root cause lies in Ruby’s handling of legacy single‑byte encodings such as ISO‑8859‑1 and Windows‑1252. In those encodings the German sharp s (ß) expands from one byte to two bytes (“SS”) when uppercased, but Ruby only reserves space for a single byte. When a string contains 21 consecutive sharp s characters, the output buffer overflows by one byte. The overflow can be triggered via the upcase, swapcase, downcase(:fold) and casecmp? methods, and a single‑byte overrun is sufficient to corrupt adjacent heap metadata, potentially leading to code execution. Veria Labs said it would publish its own exploit code about a week after the disclosure, and expected scanning activity to begin shortly thereafter.

In response, Cloudflare added two new rules to both its Free Managed Ruleset and its paid Managed Ruleset, blocking traffic that matches the ruby2shell pattern and a related integer‑overflow issue (GHSA‑87fm‑7w84‑j2px). The rules carry the identifiers 7328f23691e44b07892ebd25b19210f1 and 1afa543a1ed84893b01df04c34402c88 for the CVE, and 8660e37e86444f9f9267ba22e9855f05 and 6defac6a52334542adf4a162daf25922 for the GHSA, all defaulting to “Block”. The combined ruleset ID is efb7b8c949ac4650a09736fc376e9aee, and the Free plan enables the rules automatically, while paid plans require verification that the Managed Ruleset is active on each zone. Cloudflare also patched its own Ruby‑based services and reported no evidence of compromise, emphasizing that the WAF is a temporary mitigation and that upgrading to the patched Ruby releases remains the only complete solution.

Traffic that bypasses Cloudflare’s edge never reaches the WAF, so requests sent directly to an origin IP address or traffic exchanged between internal services can slip past protection. Cloudflare advises configuring the origin to accept connections only from Cloudflare—options include Cloudflare Tunnel or Authenticated Origin Pulls—to close this gap.

Ruby code that manipulates string case in contexts such as email handling, file imports, message queues or background jobs can invoke ruby2shell without an HTTP request, creating another entry point to the vulnerable code. Because memory corruption is only the first step, an attacker must still deliver a second‑stage payload (for example a shell command or reverse shell) and interact with the compromised server.

To add depth, Cloudflare’s WAF attack score uses machine‑learning models to assign a risk rating to each request that contains remote‑code‑execution payloads. This scoring can flag exploit variants and post‑exploitation traffic that signature‑based rules miss. On Enterprise plans users can block or challenge requests where cf.waf.score.rce ≤ 20, while Business plans can filter on cf.waf.score.class = "attack".

Cloudflare has already patched its own Ruby‑based services against ruby2shell and reports no evidence of compromise, but it continues to monitor the situation. The vendor recommends that customers verify WAF coverage (the Free plan’s ruby2shell rules are active by default, and paid plans should ensure the Managed Ruleset is enabled and not overridden), upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10 and restart all Ruby processes, rebuild container images, and move any applications still on Ruby 3.2 or earlier to a supported series. Self‑hosted products that bundle Ruby—such as GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Chatwoot, and Discourse Docker installations—should apply vendor fixes immediately. An inventory of runtimes can be generated using the Zero Wire briefing prompt for an AI agent. Cloudflare’s WAF analysts will keep updating rules as new techniques emerge, and users are urged to follow the WAF changelog for the latest updates.

Affected Products — Ruby 3.3.13‑ and earlier, 3.4.0‑12, 4.0.0‑9; Rails (default config), classic Sinatra; self‑hosted bundles such as 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.

Why It Matters for Trust & Control Assurance — The flaw tests the protective technology control objective (boundary protection & runtime integrity). Cloudflare’s WAF rules provide a compensating control while organizations patch, giving audit‑ready evidence of defense‑in‑depth.

Recommended Actions

  • Verify that Cloudflare’s “ruby‑heap‑overflow” rule (ID 7328f236…) is active in your Managed Ruleset (Free or paid).
  • Upgrade every Ruby runtime to 3.3.14, 3.4.13, or 4.0.10 and restart all processes, including background workers.
  • Rebuild container images and apply vendor‑specific patches for bundled Ruby (GitLab, GitHub Enterprise, etc.).
  • Inventory all Ruby runtimes (use Cloudflare Zero Wire briefing AI prompt) and confirm they are no longer vulnerable.
  • Restrict direct origin traffic to Cloudflare (e.g., Authenticated Origin Pulls) to ensure the WAF sees all external requests.
📰 Original Source
https://blog.cloudflare.com/ruby2shell-waf-protection/ ↗

This Verisq Intelligence Brief is an independent analysis. Read the original reporting at the link above.

Vulnerability exposure

Is this CVE in your supply chain?

Verisq matches published vulnerabilities against the software your vendors run, so you know which relationships this touches before the next review.

See vendor exposure →