Ruby Patches Ruby2Shell Heap Overflow and Six Other Vulnerabilities with RCE PoCs

Ruby has released security updates addressing seven vulnerabilities in its regular expression engine and string case conversion functionality. The most severe issue, CVE-2026-132825, is a heap-based buffer overflow dubbed Ruby2Shell that can occur during case conversion in single-byte encodings such as ISO-8859-1 and Windows-1252. Proof-of-concept code demonstrating remote code execution exists for five of the flaws, including a double free, two integer overflows, and another heap-based buffer overflow. Affected applications include GitHub Enterprise Server, while Chatwoot, GitLab, Mastodon, OpenProject, and the Discourse base image have already applied patches. Exploitation in default configurations is possible via Rails and classic-style Sinatra applications, though successful attacks in production are considered challenging due to memory layout requirements, non-glibc allocators, and ASLR. Users are strongly advised to upgrade to Ruby versions 4.0.10, 3.4.13, or 3.3.14 immediately.

SecurityWeekTranslated from English

Read at source

Ruby has issued fresh security updates that resolve seven vulnerabilities affecting its regular expression engine and string case-conversion operations. Proof-of-concept (PoC) code demonstrating remote code execution (RCE) is available for five of these issues.

At the top of the list is CVE-2026-132825 (CVSS 7.4), a heap-based buffer overflow in string case conversion that could lead to RCE under certain conditions. The flaw, dubbed Ruby2Shell, impacts character case-conversion operations. In single-byte encodings such as ISO-8859-1 and Windows-1252, Ruby may write one byte past the allocated output buffer when converting strings. For example, converting the German character ß to uppercase produces SS; the code checks for space for one byte but writes two, potentially corrupting adjacent heap memory.

According to Veria Labs, unauthenticated attackers could trigger the defect from Rails, classic-style Sinatra, and potentially other frameworks in default Ruby configurations. WatchTowr states that any Ruby application changing the case of external text in a single-byte encoding is affected. GitHub Enterprise Server is confirmed vulnerable, while Chatwoot, GitLab, Mastodon, OpenProject, and the Discourse base image have already released patches.

Successful exploitation of Ruby2Shell in production is likely difficult. Correct memory layout, specific non-glibc allocators, runtime configuration, and application logic preconditions are required, and attackers must also defeat Address Space Layout Randomization (ASLR). Malformed requests are more likely to result in denial-of-service (DoS) conditions.

The remaining four vulnerabilities with RCE PoCs include a double free, two integer overflows, and another heap-based buffer overflow. An additional out-of-bounds read in the regular expression engine can cause memory leaks and process crashes. All seven issues are fixed in Ruby versions 4.0.10, 3.4.13, and 3.3.14.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Vulns & Exploits

Microsoft Entra Connect Health Flaw Exploited to Access Tenant Metadata and Admin Emails
GnuPG Warns of Critical Double-Free Flaw in GPGME Exposing App Data to Malicious OpenPGP Keys
CISA Adds Four Critical Flaws in Apache Roller, Cisco Expressway, SAP NetWeaver, and VMware vCenter to Known Exploited Vulnerabilities Catalog