Ruby Patches Seven Flaws Including Critical Ruby2Shell Rails RCE Bug
Ruby released versions 4.0.10, 3.4.13, and 3.3.14 to patch seven memory-safety vulnerabilities, including the critical Ruby2Shell (CVE-2026-132825) heap overflow affecting default Rails applications.
Maintainers of the Ruby programming language have released security updates resolving seven memory-safety vulnerabilities in its regular expression engine and string case-conversion code. Five of the flaws carry proof-of-concept exploits demonstrating remote code execution. The batch is led by a critical heap-based buffer overflow tracked as CVE-2026-132825.
Fixed in Ruby 4.0.10, 3.4.13, and 3.3.14 on November 18, the vulnerabilities were detailed by The Hacker News and Cyber Kendra. “We are aware of PoCs that prove some of them can be used to trigger remote code execution,” the Ruby maintainers said in their security announcement. The advisories report no in-the-wild attacks so far.
How Ruby2Shell Reaches Rails Applications
Dubbed Ruby2Shell by researchers at Veria Labs, CVE-2026-132825 carries a CVSS score of 7.4 from MITRE and a critical severity rating from the Ruby project. The flaw has existed in the interpreter since version 2.4.0, released in 2016. It occurs during character case-conversion operations in legacy single-byte encodings including ISO-8859-1 and Windows-1252.
When Ruby converts the German sharp s character to uppercase in those single-byte encodings, the resulting string expands into two characters. “In affected code, Ruby checks that sufficient space exists for one byte but writes two, potentially corrupting adjacent heap memory,” Previdian explains. Standard UTF-8 strings are not affected by the buffer calculation error.
Separate technical analyses were published on November 19 by Veria Labs and by Moritz Sanft of Durendal. Their findings show that the bug is reachable over the network without authentication in default Ruby on Rails and classic-style Sinatra configurations. In Rails, the path runs through Rack, the web server interface that processes incoming form submissions before application controllers execute.
Rack’s default MethodOverride middleware calls uppercase conversion on a form request field and honors an attacker-supplied character set tag. As a result, a crafted multipart request reaches the vulnerable routine before any login check runs. Durendal reported its first end-to-end exploit against a test Rails application on October 26, followed by code execution demonstrations with OpenAI on November 5 and November 6.
Regex Bugs and Interpreter Upgrades
WatchTowr principal threat intelligence specialist Yordan Ganchev told SecurityWeek that reliable production exploitation of Ruby2Shell remains challenging. Attackers must align heap memory, match specific non-glibc memory allocator conditions, bypass Address Space Layout Randomization, and contend with concurrent internet traffic. In many live deployments, malformed requests are more likely to cause denial-of-service crashes and service disruption than remote code execution.
Alongside Ruby2Shell, the release resolves four other vulnerabilities that have remote code execution proof-of-concept exploits. Those bugs include a double free, two integer overflows, and a second heap-based buffer overflow. The update also patches two out-of-bounds read defects in the Onigmo regular expression engine that can cause memory corruption, memory disclosure, or process crashes.
The project credits Stephan Lipp of Ada Logics and Anthropic with four of the findings, alongside researchers baba__yaga, aphantom, Hiroya Fujinami, and Hiroshi SHIBATA. This marks the second time in a month that maintainers have patched the regular expression engine. Earlier updates shipped on October 23 in Ruby 4.0.9, 3.4.12, and 3.3.13 for compilation bugs uncovered by GitLab.
Because all seven fixes reside inside the Ruby interpreter itself, updating application gems or Rails frameworks does not remove the exposure. Administrators must upgrade the underlying interpreter to Ruby 4.0.10, 3.4.13, or 3.3.14, rebuild container images, and restart running server processes. Operators should also migrate off end-of-life Ruby 3.2 ahead of Ruby 3.3 support ending in March 2027.
Disclosure: Tech Tabloid may earn an affiliate commission from qualifying purchases through Amazon links on this page at no additional cost to you.