Twenty-one ß characters walk one byte past Ruby's heap
A one-byte heap overflow in Ruby's single-byte case conversion gives pre-auth RCE; fixed in Ruby 3.3.14, 3.4.13 and 4.0.10.
Twenty-one ß characters are enough to walk one byte past the end of a heap buffer in Ruby. Veria Labs’ writeup, which they call ruby2shell, traces a one-byte heap overflow in Ruby’s single-byte case conversion to pre-auth remote code execution, reachable in the default configuration of common Ruby web frameworks and self-hosted software. It is fixed in Ruby 3.3.14, 3.4.13 and 4.0.10, under GHSA-34m4-m9fh-gqp5, with a CVE still pending.
The mechanism is specific to the German sharp s. In most of Ruby’s single-byte encodings there is no capital ß, so upcasing it produces two bytes, SS. The conversion loop writes both but only bounds-checks one against the output end (to < to_end). Ruby allocates the output buffer as the input length plus 20 bytes of slack. Every ß in the input turns one input byte into two output bytes, eating one byte of that slack. An input carrying 21 of them exhausts the 20-byte margin and writes one byte past the buffer.
The byte that lands out of bounds is S (0x53) on upcase or s (0x73) on case-fold, placed directly after the output buffer. The attacker controls the buffer’s size through the length of the input string, which is the useful part: a single-byte overflow sitting next to an allocation whose size you choose is a workable heap primitive. Copying the result back out of the buffer then reads one byte out of bounds as well.
The same loop sits in several ISO-8859 and Windows-125x encodings and has been there since Ruby 2.4.0. It is reached through upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different code path and are not affected. The vulnerable path only opens when a string in one of the legacy single-byte encodings reaches one of those methods.
That is the condition to check in your own code. The listed frameworks reach the bug in their default configuration, so for those the answer is to upgrade. Beyond that, application code that upcases or case-folds strings received in a legacy encoding is exposed too, even on a framework that is safe by default. Anywhere you call upcase, swapcase, downcase(:fold) or casecmp? on attacker-supplied input, confirm the string’s encoding rather than relying on a framework default to save you.
Remediation is a Ruby upgrade to 3.3.14, 3.4.13 or 4.0.10. For self-hosted products that bundle their own Ruby, the latest release of several popular packages still ships an affected interpreter, so install the vendor’s fixed release. Veria Labs says it will publish a proof of concept in a week, once people have had time to upgrade, so the window to patch ahead of a public exploit is short.
Keep Reading
apache-rollerApache Roller deserializes XML-RPC before authenticating
Apache Roller 6.1.6 patches CVE-2026-129448, an unauthenticated XML-RPC deserialization RCE being exploited in the wild. Upgrade and mitigation details.
javaBuffer overflow in OpenJDK's Base64 decoder enables unauthenticated RCE
Java4Shell (CVE-2026-114938) is a Base64-decoder overflow in OpenJDK 17, 21, 25 and 27 that can give pre-auth RCE on x86-64 CPUs with AVX-512 VBMI.
openjdkSixty-four A's and an equals sign break OpenJDK's Base64
Java4Shell (CVE-2026-114938) is a heap overflow in OpenJDK's Base64 decoder that Calif turned into pre-auth RCE across widely deployed Java apps.
Latest on the Wire
Full wire →- 15 Million Web Servers: Ports Aren't the Real BottleneckHacker News
- Anthropic Prices $83 IPO, Shares to Trade on NasdaqHacker News
- Building an 8-page zine from A4: Local-first editor automates layoutHacker News
- Claude Cracks Two Black Hole Physics ProblemsHacker News
New signal daily · RSS
Stay in the loop
New writing delivered when it's ready. No schedule, no spam.