Download the latest Vulnerability & Exploitation Report

Download now
Tutorial

Ruby2Shell virtual patch: a free WAF rule while you upgrade Ruby

Ruby2Shell (CVE-2026-132825, GHSA-34m4-m9fh-gqp5, also written ruby2ßhell) is a one-byte heap overflow in Ruby’s string case conversion. After PHP2Shell and Java4Shell, it’s Ruby’s turn: Veria Labs, which published the write-up, says it lets the bad guys run code without logging in on default Rails and classic Sinatra apps, and on self-hosted products such as GitLab. The fix is a Ruby upgrade to 4.0.10, 3.4.13, or 3.3.14. Until you get there, our free rule crowdsecurity/vpatch-CVE-2026-132825 blocks the exploit request on the path default Rails apps expose before login: a stopgap while you upgrade, not a fix.

The Ruby team shipped the fix on 18 November 2026 and says it knows of proofs of concept that reach code execution “in some scenarios”. NVD scores it 7.4 (CVSS 3.1), and Veria Labs rates it critical. The good news: as of 19 November 2026, no exploitation has been reported, and the CVE is not in the CISA KEV catalog. The less good news: Veria Labs plans to publish its proof of concept about a week after disclosure, so the clock is ticking.

What is Ruby2Shell, and am I affected?

Ruby2Shell is a one-byte heap overflow in the way Ruby changes the case of text in legacy single-byte encodings. The root cause is almost funny: some of these encodings, such as ISO-8859-1 and Windows-1252, have a lowercase ß (yes, the German “sharp s”) with no uppercase form, so Ruby writes it as SS when it upcases text. Two bytes go out, but the loop only checked there was room for one, so a crafted string writes one byte past the end of a heap buffer. UTF-8 strings take a different code path and are safe from this one.

You are affected if you run one of the versions below and legacy-encoded text reaches upcase, swapcase, downcase(:fold) or casecmp?. According to Veria Labs, Rails and classic Sinatra do exactly that in their default configuration; other frameworks only get there if your own code does.

Ruby seriesAffectedFixed in
4.04.0.0 to 4.0.94.0.10
3.43.4.0 to 3.4.123.4.13
3.33.3.13 and earlier3.3.14
3.2 and olderback to 2.4.0no fix (end of life)

Self-hosted products bring their own Ruby, so they need a vendor release. On 19 November, Veria Labs listed the latest GitLab (19.6.0), GitHub Enterprise Server (3.22.5) and Chatwoot (4.20.0) as affected, while Mastodon, OpenProject and Discourse had already shipped fixed releases.

Can a WAF stop Ruby2Shell?

On the path, default Rails apps expose before login: yes. How does it work? There, the whole attack fits in one POST request. Rails’ default middleware changes the case of one form field on every POST, and a multipart part declared as ISO-8859-1 carries the crafted value straight into the vulnerable code, before your application code even runs. Our AppSec rule crowdsecurity/vpatch-CVE-2026-132825 watches that field and blocks the request when it carries the pattern that triggers the overflow. Legitimate traffic has no business putting that pattern there, so false positives are not expected.

Does it cover everything? No. Your own code that changes the case of other legacy-encoded input is out of its reach, and so is GHSA-87fm-7w84-j2px, a related flaw fixed in the same release. Upgrading Ruby takes care of both.

How do I protect Rails and GitLab before I can upgrade?

OptionWhat it doesLimits
Upgrade Ruby and restart every Ruby processRemoves the bug and six related flawsRebuild container images bundle update does not change the interpreter
VPN or IP allowlist for GitLab and other self-hosted productsTakes them off the internet until the vendor ships a fixRemote users need the VPN too
CrowdSec virtual patchBlocks the pre-login Rails exploit request; no app restartDefault Rails path only; not a fix

Already running the CrowdSec WAF? Install the rule, then reload CrowdSec:

cscli appsec-rules install crowdsecurity/vpatch-CVE-2026-132825

New to it? The AppSec quickstart guide gets you set up first.

Ruby2Shell FAQ

Is there a WAF rule or virtual patch for Ruby2Shell?

Yes. CrowdSec’s free AppSec rule crowdsecurity/vpatch-CVE-2026-132825 blocks the Ruby2Shell exploit request on the path default Rails apps expose before login. It is a stopgap while you upgrade Ruby, not a fix.

Is Ruby2Shell exploited in the wild?

No exploitation of Ruby2Shell had been reported as of 19 November 2026, and CVE-2026-132825 is not in the CISA KEV catalog. Veria Labs plans to publish a proof of concept about a week after disclosure, so don’t count on that lasting.

Can a WAF stop Ruby2Shell?

A WAF can block the Ruby2Shell exploit request on the default Rails path before login. It can’t protect your own code that upcases other legacy-encoded input, so treat it as a stopgap until you upgrade Ruby.

Does updating Rails or running bundle update fix Ruby2Shell?

No. Ruby2Shell lives in the Ruby interpreter, so only a new Ruby release (4.0.10, 3.4.13 or 3.3.14) fixes it.

Is GitLab affected by Ruby2Shell?

Yes. GitLab 19.6.0 bundles Ruby 3.3.13, which is affected, per Veria Labs on 19 November 2026. Keep GitLab off the public internet until it ships a fixed release.

References

Related: Java4Shell virtual patch and PHP2Shell virtual patching.

WRITTEN BY

You may also like

When Bots Pretend to Be Browsers: CrowdSec Bot Detection with HAProxy
Tutorial

When Bots Pretend to Be Browsers: CrowdSec Bot Detection with HAProxy

Step-by-step: add CrowdSec bot detection to HAProxy on Debian 13 to catch headless Chrome bots with a browser challenge and score, while real users pass.

Java4Shell virtual patch: free WAF rule for CVE-2026-114938
Tutorial

Java4Shell virtual patch: free WAF rule for CVE-2026-114938

Java4Shell virtual patch: block the trigger of CVE-2026-114938 with a free CrowdSec WAF rule while you update Java 17 to 27 and restart your JVMs.

A network of sensors sends a stream of threat intelligence to a firewall, which stops malicious IPs before they reach the servers behind it.
Tutorial

How to add a threat intelligence feed to your firewall

Add a threat intelligence feed to any firewall with no agent: Palo Alto EDL, FortiGate, Check Point, pfSense. Steps, refresh rates and which lists to pick.