sudo cscli appsec-rules install crowdsecurity/vpatch-CVE-2026-132825Then reload CrowdSec: sudo systemctl reload crowdsec
Sign in to see which of your engines run it →Hover a line or a note to see what each field does.
# Initial rule contributed by SISheogorath in crowdsecurity/hub#2018.name: crowdsecurity/vpatch-CVE-2026-132825description: 'Detect 21 or more sharp s bytes in the _method override field, the pre-auth Ruby2Shell vector through Rack method override'rules:# Rack::MethodOverride (default Rails middleware) upcases the _method field# of a POST body, and Rack tags a multipart part with the charset it# declares. In the affected single-byte encodings, upcasing 21 or more# sharp s (0xDF) overflows the case-mapping buffer.- and:- zones:- METHODmatch:type: equalsvalue: 'POST'# Rack drops a backslash before any character in a quoted part name,# Coraza keeps it, so _meth\od reaches the app as _method.# No lowercase transform: it would turn the raw 0xDF byte into U+FFFD.- zones:- BODY_ARGSvariables:- '/^\\?_\\?m\\?e\\?t\\?h\\?o\\?d$/'match:type: regexvalue: '(?:\xdf[^\xdf]*){21}'labels:type: exploitservice: httpconfidence: 3spoofable: 0behavior: 'http:exploit'label: 'Ruby2Shell - RCE'classification:- cve.CVE-2026-132825- attack.T1190- cwe.CWE-122- cwe.CWE-193
Sign in to see the Security Engines that run this waf rule, the version they run and whether it was modified locally.
This rule provides virtual patching for CVE-2026-132825 (GHSA-34m4-m9fh-gqp5, nicknamed Ruby2Shell), a one-byte heap buffer overflow (CWE-122, caused by an off-by-one, CWE-193) in Ruby's case conversion for single-byte encodings, present since Ruby 2.4.0. In ISO-8859-1/2/3/4/9/10/13/14/15/16 and Windows-1250/1252/1254/1257, upcasing the sharp s (byte 0xDF) writes the two bytes SS while the conversion loop only checks for room for one. The output buffer is the input length plus 20 bytes, so a string needs at least 21 sharp s to write past the end. The bug is reached through upcase, swapcase, downcase(:fold) and casecmp?. It is fixed in Ruby 3.3.14, 3.4.13 and 4.0.10.
Detection: In a default Rails app, the pre-authentication vector is the _method form field. Rack's multipart parser tags a text/plain part with the charset it declares, and Rack::MethodOverride, part of the default Rails middleware, calls .upcase on the _method field of every POST. A _method part declared charset=ISO-8859-1 and holding 21 or more 0xDF bytes triggers the overflow before any application code runs.
The rule blocks a POST whose _method field contains 21 or more 0xDF bytes. The field name is matched with a regex because Rack strips a backslash before any character in a quoted part name, while the WAF's multipart parser keeps it: name="_meth\od" reaches the application as _method. A legitimate _method is a short HTTP verb such as PATCH or DELETE, so false positives are not expected.
Limits:
Content-Disposition header takes its name from Content-ID. Rack accepts it, but the WAF does not expose it as a form field, so this shape is not detected._method reach the bug only if the application itself case-converts them in an affected encoding. That depends on application code and is not covered.rb_str_casemap) uses a UTF-8 payload and is not covered.Virtual patching mitigates exploitation attempts but does not fix the vulnerability. Upgrade Ruby, or the self-hosted software that bundles it (GitLab, GitHub Enterprise Server, Mastodon, Discourse, OpenProject, Chatwoot and others).