Ruby2Shell (GHSA-34m4-m9fh-gqp5): Update to this version to fix the critical RCE flaw

20 Nov 2026

On November 19, Security researchers disclosed a critical security vulnerability in Ruby, a widely used programming language. The vulnerability, named Ruby2Shell and tracked as GHSA-34m4-m9fh-gqp5, is a one-byte heap-based buffer overflow flaw that allows attackers to execute arbitrary code.

 

Through this blog, we will understand what Ruby2Shell is, the threat it poses, and what organizations should do.

About Ruby2Shell

GHSA ID – GHSA-34m4-m9fh-gqp5

 

Name – Ruby2Shell

 

Affected component – Ruby String Case Conversion Functionality

 

Type – One-byte heap-based buffer overflow (CWE-193 – Off-by-One Error)

 

Severity – Critical

 

Impact 

Authentication requirement 

Affected Encodings 

Affected deployment environments 

Affected versions + platforms 

Fixed versions 

Remote Code Execution (RCE) and memory corruption 

Unauthenticated exploitation is possible in affected default Ruby on Rails and classic-style Sinatra configurations. 

ISO-8859-1, Windows-1252, and other affected single-byte character encodings. 

– Ruby-based web applications and application servers. 
 

Ruby on Rails and classic-style Sinatra deployments. 
 
– Containerized applications bundling vulnerable Ruby runtimes. 
 
– Self-hosted enterprise products that include their own Ruby runtime. 

– Ruby 4.0: Versions 4.0.0 through 4.0.9. 
 
– Ruby 3.4: Versions 3.4.0 through 3.4.12. 
 
– Ruby 3.3: Version 3.3.13 and earlier. 
 
– Ruby 3.2 and older: Older releases dating back to Ruby 2.4.0 are also reported as affected. These versions are end-of-life and do not receive the applicable security fixes. 

Ruby 3.3: 3.3.14 
 
 
 
Ruby 3.4: 3.4.13 
 
 
 
Ruby 4.0: 4.0.10 

 

This vulnerability arises due to an error in how Ruby handles certain text conversions. Ruby has a built-in function that changes the case of text. The problem arises when Ruby processes text containing special characters, specifically one that uses older character encodings (like ISO-8859-1 and Windows-1252). Ruby incorrectly calculates how much memory it needs to store the converted text, writing an extra byte beyond the memory allocated for that text (off-by-one buffer overflow). Attackers can exploit this by sending specially crafted text with characters that trigger this flaw, allowing them to execute malicious code remotely.

What can attackers do with this vulnerability?

Successful exploitation could have serious consequences for organizations running vulnerable Ruby-based applications, including:

 

  • Remote Code Execution: Attackers could execute arbitrary code on vulnerable application servers with the privileges of the affected Ruby process.
  • Application Compromise: Internet-facing Ruby applications, including enterprise platforms, could be compromised through specially crafted input.
  • Memory Corruption: The heap-based buffer overflow could corrupt application memory and potentially affect process stability.
  • Sensitive Information Exposure: Successful exploitation may provide opportunities to access sensitive application data.
  • Service Disruption: Memory corruption could cause application crashes and denial-of-service conditions.
  • Further Network Compromise: If an application server is compromised, attackers may attempt additional activities using the privileges and network access available to the affected process.

SharkStriker’s recommendations

Identify Ruby Deployments: Inventory Ruby runtimes across servers, virtual machines, containers, cloud workloads, and enterprise applications. Include runtimes bundled within third-party products.

 

Verify Installed Versions: Identify the exact Ruby version used by running application processes rather than relying only on the system-installed Ruby version.

 

Prioritize Exposed Applications: Give priority to internet-facing Ruby on Rails and classic-style Sinatra applications, particularly those processing externally supplied strings.

 

Apply Security Updates: Upgrade affected Ruby installations to the following fixed versions or later:

  • Ruby 3.3.14
  • Ruby 3.4.13
  • Ruby 4.0.10

 

Update Bundled Applications: For products such as GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse, and Chatwoot, apply the respective vendor-provided security updates that incorporate the patched Ruby runtime. Do not independently replace bundled Ruby runtimes.

 

Address End-of-Life Versions: Migrate Ruby 3.2 and older installations to supported Ruby branches containing the security fixes, as these older versions do not receive the applicable security updates.

 

Restrict Exposure Where Patching Is Pending: If immediate patching is not possible, restrict public access to vulnerable application endpoints through VPNs, IP allowlisting, or other appropriate access-control mechanisms. These measures are temporary and do not replace patching.

 

Validate Remediation: After updates, verify the Ruby version used by running applications and confirm that all affected services and container workloads are running patched versions. Restart affected services where necessary.

Get in Touch With us

We have explored what risk tolerance and risk appetite are and how important they are together in helping businesses align cybersecurity with their business goals. It can help CISOs, and C-suite make informed investment decisions for cybersecurity.

LEARN MORE