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

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

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

Sources

More from Debug Duck

All stories from Debug Duck