Skip Navigation

November 23, 2026 |

Ruby2Shell: Ruby memory corruption flaw

Loading table of contents...

At a glance:

  • Researchers disclosed Ruby2Shell on November 19, 2026, one day after Ruby released security updates addressing seven vulnerabilities, including CVE-2026-132825

  • CVE-2026-132825 is a heap out-of-bounds write in Ruby string case-conversion functions. The flaw affects multiple versions of Ruby.

  • Product updates are available for major platforms that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Chatwoot, and Discourse. Updating Rails gems or the host operating system's Ruby installation does not remediate bundled Ruby runtimes.

Threat summary

On November 19, 2026, researchers published technical details showing that a recently patched Ruby vulnerability could be reached through unauthenticated requests in default Ruby on Rails and Sinatra deployments. The disclosure comes one day after Ruby released security updates for seven vulnerabilities, including CVE-2026-132825, dubbed Ruby2Shell.

Ruby is a programming language widely used by applications built on frameworks such as Ruby on Rails and Sinatra. The vulnerable functionality exists within several string case-conversion methods, including:

  • upcase

  • swapcase

  • capitalize

  • downcase(:fold), and

  • casecmp?

These functions convert strings between uppercase and lowercase forms and can process user-supplied input during normal application requests.

CVE-2026-132825 is a heap out-of-bounds write vulnerability (CWE-787) that affects several legacy character encodings, including ISO-8859 variants and Windows-1250, Windows-1252, Windows-1254, and Windows-1257.

The issue stems from the way Ruby handles certain character conversions. The German character "ß" expands to "SS" when converted to uppercase. Ruby allocates a buffer based on the original string length plus a 20-byte margin, but the conversion routine checks available space as though only one output byte will be written. A string containing 21 expansion-triggering characters can cause Ruby to write one byte beyond the end of the allocated heap buffer.

Ruby assigned the vulnerability a Critical severity rating, while the published CVSS v3.1 score is 7.4. The difference stems from how the vulnerability is assessed. The CVSS score reflects a local attack vector, while researchers reported that the vulnerable functionality is reachable through request processing in default Rails and Sinatra deployments.

Public reporting currently documents memory corruption and process crashes. Ruby has stated that it is aware of proof-of-concept exploits that achieve code execution in some scenarios, while researchers plan to publish a public proof of concept on November 25, 2026.

Affected versions include Ruby 2.4.0 through 3.2.x, Ruby 3.3.0 through 3.3.13, Ruby 3.4.0 through 3.4.12, and Ruby 4.0.0 through 4.0.9. Fixed versions are Ruby 3.3.14, Ruby 3.4.13, and Ruby 4.0.10. Ruby 2.4.0 through 3.2.x have reached end of life, making migration to a supported release the available remediation path.

Analysis

Internet-facing Ruby applications are likely more at risk, particularly those running default Ruby on Rails or Sinatra deployments. This threat is also relevant to organizations that do not write Ruby code themselves, making the patching process more complicated than a simple Ruby upgrade.

A vulnerable runtime may be present even in environments where Ruby is not actively managed but embedded, including in products such as:

  • GitLab

  • GitHub Enterprise Server

  • Mastodon

  • OpenProject

  • Chatwoot

  • Discourse

Ruby application servers often hold database credentials, cloud access tokens, API keys, source code and connections to internal services. A crafted request can crash the Ruby process, causing denial of service.

Reliable code execution depends on complex heap memory layout manipulation and application-specific conditions. Where code execution succeeds, adversaries could run commands with the privileges of the Ruby process, retrieve data and credentials, and move into connected systems. GitLab and GHES hold source code, continuous integration secrets and deployment access, which extends a compromise to the software supply chain of the organization.

The planned public PoC on November 25, 2026 is likely to shorten the window between disclosure and exploitation attempts. Internet-facing GitLab and GHES instances are the first priority, followed by internet-facing Rails and Sinatra applications.

The outcome will vary by environment. In some cases, exploitation may result in application crashes or service instability. In environments where code execution becomes possible, an adversary could gain access to data, credentials, or infrastructure available to the affected application. Applications that process external user requests while maintaining privileged access to backend systems with present a wider attack surface.

Mitigations

Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10, which also fix the six related vulnerabilities. Restart application servers and background workers, such as Puma and Sidekiq, so running processes load the updated interpreter, rebuild container images, and update version-pinning files such as Dockerfiles and .ruby-version files. Migrate applications on Ruby 3.2 and earlier, which have reached end of life, to a supported release series. For Linux distribution packages, confirm fix status against the distribution advisory, as patched builds may keep the original version number. Ruby lists software updates as the only remediation.

Upgrade products that bundle Ruby to the vendor fixed release: GitLab 19.6.1, 19.5.8 or 19.4.10, GHES 3.22.6, Mastodon 4.7.6, 4.6.12, 4.5.22 or 4.4.29, OpenProject 17.9.8 or 17.8.3, Chatwoot 4.20.1, and the Discourse base image 2.0.20261119-0203. Packaged and container deployments receive the fixed runtime through the application update, and source-based installations also require installing the fixed Ruby version. Until updates are complete, restrict internet access to affected systems through a virtual private network (VPN) or IP allowlist, and investigate unexpected Ruby process crashes, which may indicate failed exploitation attempts.

ThreatRoundUp_SignUp_Simplifiedx2

Stay on top of emerging threats like this.

Sign up to receive a weekly roundup of our security intelligence feed. You'll be the first to know of emerging attack vectors, threats, and vulnerabilities. 

Sign up