Ruby2ßhell: Pre-authentication RCE on stock Rails

401 points · 181 comments on HN · read original →

Points and comments are a snapshot, not live.

A single-byte heap overflow in Ruby's upcase function allows pre-authentication RCE on stock Rails.

Veria Labs discovered Ruby2Shell (CVE-2026-132825), a pre-authentication RCE affecting Rails, Sinatra, and other frameworks on Ruby 2.4.0 through 4.0.9. The bug is in the upcase function for ISO-8859 and Windows-125x encodings: upcasing 'ß' writes two bytes ('SS') but the loop only bounds-checks one. The output buffer is input length plus 20 bytes; 21 'ß' characters overflow by one byte. Ruby 3.3.14, 3.4.13, and 4.0.10 fix it. Self-hosted software packaging their own Ruby (GitHub Enterprise Server, Chatwoot, GitLab, Mastodon, OpenProject, Discourse) are affected; most have patches. A PoC may be published November 25, 2026.

What commenters are saying

Commenters praised the vulnerability's name ("Ruby2Shell") and its clever tie-in to the mechanism. Several noted the root cause: the original code assumed case conversion doesn't change byte length, and the 'ß' to 'SS' expansion was added without proper bounds checking. A subthread debated German orthography, whether 'ẞ' is a valid uppercase for 'ß', and who governs it. Some commenters questioned exploitability of a single-byte heap overflow; others referenced historical techniques (e.g., glibc's poisoned NUL byte) but noted modern exploitation is harder. One user reported a crash PoC written quickly; another argued publishing a PoC before all vendors patch would be irresponsible.