A flaw in Ruby can cause a one-byte heap overflow when certain legacy-encoded strings are processed. The issue affects Ruby 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, 3.3.0 to 3.3.13, and all releases from 2.4.0 in the 3.2 and older series, which are listed as end-of-life.

Rails and Sinatra in classic style are affected in their default configurations. Other frameworks and plain Rack are not exposed by default, although application code that upcases strings received in a legacy encoding may also be vulnerable. UTF-8 strings use a different code path and are not affected.

The source lists these self-hosted software releases as bundling affected Ruby versions: GitLab 19.6.0 (Ruby 3.3.13), GitHub Enterprise Server 3.22.5 (4.0.9), Mastodon 4.7.5 (4.0.9), OpenProject 17.9.7 (4.0.9), Discourse 2026.10.1 (3.4.7), and Chatwoot 4.20.0 (3.4.4).

Users should upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10. For self-hosted software, the notice advises installing the vendor's fixed release. The notice was updated 19 November 2026 at 07:59 UTC.

The bug is in a loop used by several ISO-8859 and Windows-125x encodings, present since Ruby 2.4.0. It is reached by upcase, swapcase, downcase(:fold) and casecmp?. When upcasing ß, the code writes two bytes, SS, but checks space for only one. The output buffer is allocated as the input length plus 20 bytes; an input containing 21 ß characters overflows it by one byte.

The overflow writes S (0x53) during upcasing or s (0x73) during case-folding immediately after the output buffer. The attacker controls the buffer size through the input length, and copying the result out of the buffer then reads one byte out of bounds. The issue was fixed upstream in ruby/ruby@d582f8f.

The notice says a proof of concept will be published in a week, to give people time to upgrade.