Upper-casing 21 German ß characters overflowed Ruby's memory by one byte, and default Rails apps were exposed before login, Veria Labs says
Upper-case the German letter ß and you get two letters, SS. That fact is behind a flaw the Ruby team fixed on 19 November 2026: in some older single-byte text encodings, Ruby writes both bytes of SS but checks room for only one, so with enough ß characters the last byte lands past the end of the memory set aside for the result.
The Ruby advisory calls it a one-byte heap-based buffer overflow that "may allow remote code execution", and says the team is aware of proofs of concept that trigger code execution "in some scenarios". The security firm Veria Labs, which named the bug ruby2shell, reports that default Rails and classic-style Sinatra web apps reach it before anyone logs in. The fix is to upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10.
In short
- Ruby fixed a one-byte heap overflow in string case conversion (GHSA-34m4-m9fh-gqp5, now CVE-2026-132825), alongside six other memory-safety flaws.
- Per Veria Labs, the output buffer has 20 spare bytes, so a string of 21 ß characters overflows it by one byte; the bug has been in Ruby since 2.4.0.
- Veria Labs reports Rails and classic Sinatra apps are exposed in their default configuration, without authentication; Cloudflare says the route is the form-method override. It plans to publish a proof of concept on 25 November 2026.
- Cloudflare says its web application firewall now blocks the attack for all its customers, and calls that a stopgap, not a fix.
What goes wrong
Every Ruby string carries an encoding. Besides UTF-8, Ruby supports legacy single-byte encodings such as ISO-8859-1 (Latin-1) and Windows-1252, where each character is one byte, so changing case normally keeps the length the same.
The sharp s breaks that. Veria Labs explains that most of Ruby's single-byte encodings have no capital ß, so upper-casing writes S twice, while the loop checks the room left for only one byte. Ruby allocates the output as the input length plus 20 bytes; each ß adds one byte, so the 21st spills one byte past the end. Veria says the stray byte is an S (0x53) when upper-casing, or s (0x73) when case-folding, and that the attacker sets the buffer's size through the length of the input.
Cloudflare counts 14 affected ISO-8859 and Windows-125x encodings; Veria says "several". Both name the same four Ruby methods that reach the code: upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different path and are not affected.
One byte sounds trivial, but Cloudflare explains that a single byte written past a heap buffer can be enough to corrupt a neighbouring object or the allocator's bookkeeping.
Why a web form reaches it
HTML forms can only send GET and POST. To fake PUT, PATCH or DELETE, Ruby frameworks accept a hidden _method field in a POST. Rack, the layer most Ruby web frameworks sit on, handles this in its MethodOverride middleware, which upper-cases the field's value. Cloudflare reports that Rails includes this middleware by default and classic-style Sinatra enables it, so the value is upper-cased while the request is still being routed, before any application code or login check runs. According to Cloudflare, a multipart POST can declare a legacy character set for that one field.
Veria reports that other frameworks and plain Rack apps are not exposed by default, though any code that changes the case of outside text in a legacy encoding may be; Cloudflare lists email, file imports, message queues and background jobs.
Who is affected
These products bundle their own Ruby, so each vendor must ship the fix. Cloudflare's post of 20 November listed all six as shipping an affected Ruby; Veria's table, updated 21 November at 03:52 UTC, shows five patched. Cloudflare notes that Linux distributions can backport fixes without changing Ruby's version number.
How serious: the ratings differ
The CVE record's score treats the attack as local; Veria's network-reachable path through Rails is what makes it more serious in practice (our reading). Ruby's own advisory went out before the CVE number existed and refers to the flaw only by its GitHub identifier.
Six more fixes in the same releases
Ruby's advisory covers seven flaws. One, GHSA-87fm-7w84-j2px, is an integer overflow in the same case-conversion code. Five are in the regular-expression engine and mostly matter, per Ruby, where an application compiles or matches attacker-supplied patterns.
Ruby credits the case-conversion overflow to Stephan Lipp (Ada Logics) and Anthropic. Veria Labs says it found the bug independently and was first to show remote code execution, and lists Moritz Sanft, working with OpenAI, as another discoverer.
The firewall stopgap
Cloudflare says it added two blocking rules, for this flaw and the integer overflow, to its free and paid managed rulesets. It calls the firewall "a compensating control, not a replacement for patching": traffic sent straight to a server, between internal services or from non-web inputs never reaches it. Cloudflare says it has patched its own Ruby systems and found no sign of compromise.
Terms in plain English
- Heap buffer overflow: a program writes past the end of a block of memory it was given while running, into whatever sits next to it (our wording).
- Proof of concept (PoC): working code showing that a flaw can actually be exploited (our wording).
- Pre-authentication: reachable before a user logs in (our wording).
- WAF (web application firewall): a filter in front of a website that drops requests matching attack patterns (our wording).
Where things stand
Ruby's advice is to upgrade to 4.0.10, 3.4.13 or 3.3.14 and to move off Ruby 3.2 or older. Cloudflare adds: restart every Ruby process, background workers included, and rebuild container images. Veria Labs says it will publish its proof of concept against stock Rails on 25 November 2026, or later if major vendors have not shipped a fix; Cloudflare expects scanning to start soon after.
Sources
- Security advisories: multiple vulnerabilities in Regexp and String case conversion, Ruby, published 19 November 2026 (UTC)
- GHSA-34m4-m9fh-gqp5: Heap buffer overflow in case conversion of strings, Ruby on GitHub, 19 November 2026
- CVE-2026-132825, CVE record, 19 November 2026
- Ruby2Shell (CVE-2026-132825), Veria Labs, updated 21 November 2026
- How Cloudflare WAF protects against ruby2shell (CVE-2026-132825), Cloudflare blog, 20 November 2026
Sources
- Security advisories: multiple vulnerabilities in Regexp and String case conversion
- GHSA-34m4-m9fh-gqp5: Heap buffer overflow in case conversion of strings
- CVE-2026-132825
- Ruby2Shell (CVE-2026-132825)
- How Cloudflare WAF protects against ruby2shell (CVE-2026-132825)
More from Debug Duck
- NVIDIA GTC Washington, D.C. 2026: everything NVIDIA announced
- A half-billion-parameter open model converts whole pages, tables and formulas included, at 18.49 pages a second on one GPU, IBM says
- nginx2root: five nginx bugs, one in every release since 2015 and exploitable with HTTP/2 alone, chained with a Linux kernel flaw to get root; Cloudflare says its proxy blocks the worst
- Six-dimensional optical data storage reaches 99.45% raw accuracy, preprint reports, with 0.38 petabits per disc projected
- November 2026 TOP500: ten fastest supercomputers unchanged and only 27 systems new, the fewest in the list's history, TOP500 says