Ruby2Shell: a one-byte heap overflow in Ruby's upcase reaches stock Rails
Veria Labs has published Ruby2Shell, tracked as GHSA-34m4-m9fh-gqp5, a heap overflow in Ruby's string case conversion. Most of Ruby's single-byte encodings have no capital ß, so upcasing it writes two bytes, SS, while the loop bounds-checks only one. The output buffer is the input length plus 20 bytes, so an input with 21 such characters overflows it by one byte. The same loop sits in several ISO-8859 and Windows-125x encodings, has been there since Ruby 2.4.0, and is reached by upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different path and are not affected.
According to the advisory, the bug is reachable from Rails and from classic-style Sinatra in their default configuration; other frameworks and plain Rack are not exposed by default, though application code that upcases strings received in a legacy encoding may be. Fixed releases are Ruby 3.3.14, 3.4.13 and 4.0.10; the 3.2 series and older are end of life. The fix upstream is commit d582f8f.
The page lists self-hosted products whose latest release bundles an affected Ruby, as of 19 November 10:00 UTC: GitLab 19.6.0, GitHub Enterprise Server 3.22.5, Mastodon 4.7.5, OpenProject 17.9.7, Discourse 2026.10.1 and Chatwoot 4.20.0. Veria Labs says it will publish a proof of concept in a week.

Why it matters
For most operators the fix is not theirs to apply: it arrives when the vendor of the bundled Ruby ships a release. The one-week window before the proof of concept is the time that matters.