Ruby2Shell is a one-byte heap buffer overflow in Ruby's string case conversion, rated Critical and reachable without authentication in a default Rails app. Ruby fixed it on 18 November 2026 in 3.3.14, 3.4.13 and 4.0.10. The maintainers say they have seen proof-of-concept code achieving remote code execution. No public exploit exists yet, but Veria Labs, which named the bug, plans to publish one in about a week.
What's is Ruby2Shell?
Most of Ruby's single-byte legacy encodings have no capital sharp s. Upcasing `ß` writes two bytes, `SS`, but the loop bounds-checks only one. Ruby allocates the output buffer as the input length plus 20 bytes, so an input carrying 21 sharp-s characters overflows it by one byte. Veria Labs reports the flawed loop appears across several ISO-8859 and Windows-125x encodings and has been present since Ruby 2.4.0. The overflowing byte lands directly after the buffer, and the attacker controls the buffer size through the input length. It is reached through `upcase`, `swapcase`, `downcase(:fold)` and `casecmp?`. UTF-8 strings take a different code path and are not affected. Veria Labs describes the bug as reachable without authentication in the default configuration of common Ruby frameworks, but has not published the request path, and says it will release a proof of concept in about a week.
Which versions are affected?
Rails and classic-style Sinatra apps are exposed by default. Other frameworks and plain Rack are not, though any code that upcases untrusted input in a legacy encoding reaches the same bug. Self-hosted products bundle their own interpreter, so a system package update does nothing for them. GitLab 19.6.0, GitHub Enterprise Server 3.22.5 and Chatwoot 4.20.0 still ship an affected Ruby.
What should you do?
- Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10, then restart your app servers so no old workers remain. Ruby lists no workaround.
- Check bundled runtimes separately. GitLab, GitHub Enterprise Server and Chatwoot ship their own Ruby. Wait for the vendor release and restrict access meanwhile.
- Plan off Ruby 3.2 and older. Those branches are end of life and never get this fix.
Ruby publishes no workaround, so upgrading is the fix. WAF rules may not be enough here. The trigger is a short run of otherwise legitimate characters.
How Ethiack helps
Ethiack detects affected Ruby exposure across your attack surface, including Rails and Sinatra services outside your known inventory, and flags products that need a vendor release rather than a package update. Track status in the Ethiack Zero entry.
Ruby2Shell FAQ
Is Ruby2Shell being exploited in the wild?
No public exploit, no CISA Known Exploited Vulnerabilities entry and no credible report at the time of writing.
References
- Ruby security advisory, 18 November 2026
- GitHub Security Advisory GHSA-34m4-m9fh-gqp5
- Veria Labs Ruby2Shell disclosure
- Upstream fix: ruby/ruby commit d582f8f
