Update Ruby to 3.3.14, 3.4.13, or 4.0.10 to fix ruby2shell code execution
The Ruby maintainers have issued updates for a critical vulnerability dubbed ruby2shell that permits remote code execution against default Ruby on Rails and Sinatra installations.
What changed
On November 19, 2026, the Ruby team disclosed ruby2shell, cataloged as CVE-2026-132825. The flaw is a heap buffer overflow in the interpreter's string case conversion routines.
When handling 14 legacy single-byte encodings—including ISO-8859 and Windows-125x variants—Ruby assumes that case conversions preserve byte lengths. That assumption fails for the German sharp s (ß), which expands to two bytes ("SS") in uppercase. In these encodings, the runtime writes both bytes but only checks for a single byte of available space. Passing 21 sharp s characters causes the output buffer to overflow by one byte. An attacker can trigger the vulnerability using the upcase, swapcase, downcase(:fold), or casecmp? methods. UTF-8 strings follow a separate path and remain unaffected.
The bug affects releases back to Ruby 2.4.0. Proofs of concept exist that weaponize the one-byte overflow for remote code execution.
Patches shipped in Ruby 3.3.14, 3.4.13, and 4.0.10. These versions also resolve six other memory safety issues, including GHSA-87fm-7w84-j2px (an integer overflow in string case handling) and five flaws in Ruby's regular expression parser.
Who should care
You should care if:
- You run servers or containers with Ruby 3.3.13 or older, 3.4.0 through 3.4.12, or 4.0.0 through 4.0.9.
- You operate web applications on Ruby on Rails or classic-style Sinatra. Rack's
MethodOverridemiddleware, which parses_methodparameters in multipart POST requests to simulate HTTP verbs, is enabled by default in both frameworks. It callsupcaseon the value before authentication or application routing takes place. - You run self-hosted products bundling Ruby, including GitLab 19.6.0, GitHub Enterprise Server 3.22.5, Mastodon 4.7.5, OpenProject 17.9.7, Discourse 2026.10.1, or Chatwoot 4.20.0.
- You host environments on Ruby 3.2 or earlier, which have reached end of life and will not receive official patches.
What to do
- Identify every host and container running Ruby in your infrastructure. If you use VR9 Infra to track inventory and services, review your server packages and exposed ports.
- Upgrade standalone installations to Ruby 3.3.14, 3.4.13, or 4.0.10, or update through your operating system distribution if it provides backported packages.
- Restart all running Ruby processes, application servers, and background workers so they load the patched binaries.
- Rebuild container images; Discourse operators running Docker can rebuild immediately to pull their updated Ruby 4.0.10 base image.
- Watch for and apply upstream patches for bundled self-hosted platforms like GitLab, GitHub Enterprise Server, Mastodon, OpenProject, and Chatwoot.
- Plan upgrades for applications still running on Ruby 3.2 or earlier to a supported release line.