Ruby case-conversion bug enables one-byte heap overflow, pre-auth RCE in Rails
Security researchers found that Ruby's handling of the German ß character in certain single-byte encodings (used by upcase, swapcase, downcase(:fold) and casecmp?) miscalculates buffer bounds, letting an input with 21 ß characters overflow the output buffer by exactly one byte. The flaw has existed since Ruby 2.4.0 and affects only legacy ISO-8859 and Windows-125x encodings, not UTF-8 strings; it has now been patched upstream in the Ruby source repository.
GoKawiil's interpretation of the reporting above, not reported fact.
A single attacker-controlled byte written past a heap buffer can be enough to corrupt adjacent memory, and researchers describe this as reachable pre-authentication on a stock Rails application, which could let an attacker trigger memory corruption before any login is required. Because the overflow size and timing are attacker-influenced through input length, this kind of primitive is often a building block for more complex exploitation chains rather than an immediate one-shot RCE, so the severity in practice depends on how Rails and the underlying allocator handle the corrupted byte.
- A heap buffer overflow of exactly one byte exists in Ruby's case-conversion routines for certain legacy single-byte encodings.
- The bug stems from an unbounded second write when upcasing the German ß character, present since Ruby 2.4.0.
- UTF-8 encoded strings are not affected, and the issue has been fixed in the upstream Ruby repository.
Source: verialabs.com, 2026-11-19
Published there as: “Ruby2ßhell: Pre-authentication RCE on stock Rails”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.