Ruby Patches “Ruby2Shell” Vulnerability That Could Lead to Remote Code Execution

Fresh security updates for the Ruby programming language fix seven vulnerabilities in its regular expression engine and in string case conversion. Proof-of-concept (PoC) code demonstrating remote code execution (RCE) exists for five of them.
The main flaw: Ruby2Shell (CVE-2026-132825)
The top vulnerability, CVE-2026-132825 (CVSS 7.4), is a heap-based buffer overflow in string case conversion that could lead to RCE in certain scenarios. It’s been dubbed Ruby2Shell.
How it works
The flaw affects character case-conversion operations. In some single-byte encodings, including ISO-8859-1 and Windows-1252, Ruby may write one byte past the output buffer when changing a string’s case.
As Previdian explains, converting the German character ß to uppercase produces SS. In affected code, Ruby checks that there’s room for one byte but writes two, potentially corrupting adjacent heap memory.
Who is affected
- Veria Labs reports that in default Ruby configurations, unauthenticated attackers could trigger the flaw from Rails, classic-style Sinatra, and potentially other frameworks.
- WatchTowr says any Ruby application that changes the case of external text in a single-byte encoding is affected.
- According to Veria Labs, GitHub Enterprise Server is affected. Chatwoot, GitLab, Mastodon, OpenProject, and the Discourse base image have already patched the bug.
How hard is it to exploit?
WatchTowr’s Yordan Ganchev told SecurityWeek that successful exploitation in production is likely to be challenging. Attackers would need to correctly lay out memory, the right non-glibc memory allocator, specific runtime configuration and application-logic preconditions, and would still have to defeat Address Space Layout Randomization (ASLR). More likely, he said, malformed requests could lead to denial-of-service (DoS) and service disruption.
Veria Labs plans to release a PoC after major vendors have rolled out patches.
The other vulnerabilities
The other four flaws with an RCE PoC include a double free, two integer overflows, and another heap-based buffer overflow. CVE identifiers for these have been requested but not yet assigned. PoC code also exists for an out-of-bounds read demonstrating memory corruption. Ruby also fixed an out-of-bounds read in its regular expression engine that could cause memory leaks and process crashes.
Patched versions
Patches for all seven vulnerabilities are included in Ruby:
- 4.0.10
- 3.4.13
- 3.3.14
Users are advised to apply the fixes as soon as possible.



