ruby2ßhell: Critical One-Byte Heap Overflow in Ruby Could Allow RCE Attacks

Blog WriterCybersecurity News - Original News Source is cybersecuritynews.com


Ruby has patched a critical memory corruption flaw that can allow remote code execution (RCE) on vulnerable servers. Tracked as GHSA-34m4-m9fh-gqp5 and named ruby2ßhell by Veria Labs, the flaw affects Ruby’s string case conversion code.

Researchers report that attackers can reach the vulnerable code over the network without logging in to applications running Ruby on Rails or classic-style Sinatra with default settings. A CVE identifier was still pending at disclosure.

The flaw occurs in case conversion routines for several legacy single-byte encodings, including some ISO-8859 and Windows-125x variants.

In those encodings, Ruby converts the German lowercase letter ß to SS when uppercasing it. That conversion produces two output bytes from one input byte, but the loop checks only whether the output buffer has room for one more byte. If the conversion needs two bytes and only one fits, the second write crosses the buffer boundary.

This is a heap buffer overflow because the output buffer sits in memory allocated at runtime. A subsequent copy of the converted string can also read one byte beyond the buffer.

The affected code dates back to Ruby 2.4.0 and can be reached through upcase, swapcase, downcase(: fold), and casecmp?. UTF-8 strings follow a separate code path and do not trigger this flaw.

ruby2ßhell – One-Byte Heap Overflow in Ruby

Ruby’s maintainers say proof-of-concept exploits have demonstrated code execution in some scenarios, not that every out-of-bounds write leads to RCE.

Affected releases include Ruby 3.3.0 through 3.3.13, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. The flaw also affects older releases, including Ruby 2.4.0. Ruby 3.2 and earlier are end-of-life and have no fix for this issue.

Plain Rack is not exposed by default, according to Veria Labs. However, custom application code can still introduce exposure if it applies an affected case conversion to untrusted text in a legacy encoding.

Veria Labs identified affected Ruby runtimes bundled with GitLab 19.6.0, GitHub Enterprise Server 3.22.5, Mastodon 4.7.5, OpenProject 17.9.7, Discourse 2026.10.1, and Chatwoot 4.20.0.

Affected Ruby Web Frameworks

Framework Default Exposure
Ruby on Rails Affected
Sinatra (Classic Style) Affected
Plain Rack and Other Frameworks Not exposed by default

Affected Self-Hosted Software :

Self-Hosted Software Affected Release Bundled Ruby Version Status
GitLab 19.6.0 3.3.13 Affected
GitHub Enterprise Server 3.22.5 4.0.9 Affected
Mastodon 4.7.5 4.0.9 Affected
OpenProject 17.9.7 4.0.9 Affected
Discourse 2026.10.1 3.4.7 Affected
Chatwoot 4.20.0 3.4.4 Affected

For administrators, the key detail is which Ruby runtime the application actually loads. Updating the host’s system Ruby does not replace a separate runtime shipped inside an application package, appliance, or container image.

The Ruby team released 3.3.14, 3.4.13, and 4.0.10 on November 18, 2026. The official Ruby security release addresses seven flaws across string case conversion and the regular expression engine.

These are separate from the earlier GitLab CI/CD regex vulnerability tracked as CVE-2026-97229, which Cyber Security News also covered when CISA warned of active exploitation. That earlier exploitation does not establish that ruby2ßhell has been exploited in the wild.

Teams that manage their own Ruby runtime should upgrade to the fixed release for their branch or move to a supported branch if they run Ruby 3.2 or older.

Administrators of self-hosted products should install the vendor’s fixed build, then verify the Ruby version inside the running application environment. Prioritize internet-facing deployments where the vulnerable code is reachable without authentication.

The Veria Labs disclosure tracks affected products and vendor fixes. The researchers said they planned to publish a proof of concept about a week after disclosure.

Give your SOC the alert context on the latest threats to stop incidents quickly -> Integrate Threat Intel from 16K SOCs

The post ruby2ßhell: Critical One-Byte Heap Overflow in Ruby Could Allow RCE Attacks appeared first on Cyber Security News.