Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

Ruby Patches Ruby2Shell Vulnerability That Could Lead to RCE

Tracked as CVE-2026-132825, the bug is a heap-based buffer overflow that could lead to remote code execution (RCE).

Exploited Vulnerabilities

Fresh security updates for the Ruby programming language resolve seven vulnerabilities in its regular expression engine and in the case conversion of strings. Proof-of-concept (PoC) code demonstrating remote code execution (RCE) exists for five of them.

At the top of the list sits CVE-2026-132825 (CVSS score of 7.4), described as a heap-based buffer overflow in the case conversion of strings that could potentially lead to RCE in certain scenarios.

Dubbed Ruby2Shell, the flaw impacts character case-conversion operations. In some single-byte encodings, including ISO-8859-1 and Windows-1252, when changing the case of a string, Ruby may end up writing one byte past the output buffer.

“For example, converting the German character ß to uppercase produces SS. In affected code, Ruby checks that sufficient space exists for one byte but writes two, potentially corrupting adjacent heap memory,” Previdian explains.

Veria Labs reports that, in default Ruby configurations, unauthenticated attackers could trigger the security defect from Rails, classic-style Sinatra, and potentially other frameworks.

According to preemptive exposure management firm WatchTowr, “any Ruby application that changes the case of external text in a single-byte encoding” is affected by the vulnerability.

Advertisement. Scroll to continue reading.

According to Veria Labs, which plans to release a PoC after major vendors have rolled out patches, GitHub Enterprise Server is affected. Chatwoot, GitLab, Mastodon, OpenProject, and the Discourse base image have patched the bug.

Successful exploitation of Ruby2Shell in production environments is likely to be challenging, WatchTowr principal threat intelligence specialist Yordan Ganchev told SecurityWeek.

According to him, correctly laying out memory is difficult, and “attackers would also need the right non-glibc memory allocator, runtime configuration, and application logic preconditions, making exploitation even more challenging.”

“And if that weren’t enough, they’d need to contend with anyone else hammering the system on the internet and, in the end, defeat Address Space Layout Randomization (ASLR), making the whole journey a complete odyssey,” Ganchev noted.

Most likely, malformed requests could lead to denial-of-service (DoS) and service disruption, he said.

The other four vulnerabilities with a PoC demonstrating RCE include a double free, two integer overflows, and a heap-based buffer overflow. CVE identifiers for these issues have been requested but not assigned yet. PoC code also exists for an out-of-bounds read, demonstrating memory corruption.

Ruby also resolved an out-of-bounds read in its regular expression engine that could lead to memory leaks and process crashes.

Patches for all seven vulnerabilities were included in Ruby versions 4.0.10, 3.4.13, or 3.3.14. Users are advised to apply the fixes as soon as possible.

Related: PHP Patches Seven Critical RCE Vulnerabilities

Related: Hackers Exploit Cisco Expressway Vulnerability Soon After PoC Release

Related: Critical Apache Roller, Axis Vulnerabilities Exploited in Attacks

Related: F5 Patches Critical NGINX2Root Flaws as PoC Exploits Go Public

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

NOW LIVE: CISO Forum 2026 Summit

Join as we bring together CISOs, senior cybersecurity executives, practitioners, industry experts, and other security leaders to share practical experience and examine the issues shaping enterprise cybersecurity strategy.

Register

Join to learn the four levels of architecting security into the agentic SDLC – from securing the code your developers' agents write to running a coordinated system of security agents you've built yourself.

Register

People on the Move

Zeke Maldonado has been named Principal Deputy CIO at the US Department of Commerce.

FusionAuth has appointed Phil Allen as CRO.

Dave Farrow has become CISO at Bitwarden.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.