Alert

Logo de Ruby

Alert 2026-177 Ruby2Shell vulnerability in Ruby may allow remote code execution and affects GitLab

Affected product(s): 

ProductAffected versionsFix
Ruby 4.0.x4.0.0 to 4.0.94.0.10
Ruby 3.4.x3.4.0 to 3.4.123.4.13
Ruby 3.3.x3.3.13 and earlier3.3.14
Ruby 3.2 and earlierOut of support (according to researchers, since 2.4.0)No patch; migrate to a supported branch
GitLab CE/EE self-managedAll versions before 19.4.10; 19.5 before 19.5.8; 19.6 before 19.6.119.6.1, 19.5.8 or 19.4.10
GitHub Enterprise Server3.22.5 and earlier (according to researchers)No fixed version yet (according to researchers)

GitLab.com and GitLab Dedicated are already patched; their customers do not need to take action. According to researchers, products that bundle their own Ruby, such as Mastodon, Chatwoot, OpenProject and the Discourse base image, are also affected and already have fixed versions. Ruby packages from Debian, Ubuntu and Red Hat do not have a published fix at the time of this alert.

Description

A vulnerability has been reported in Ruby, known as Ruby2Shell (CVE-2026-132825, CVSS 7.4, high), that can cause a one-byte heap buffer overflow when converting certain strings to upper or lower case in legacy single-byte encodings, such as ISO-8859-1 or Windows-1252, and, in some scenarios, allow remote code execution. The vendor made it public on Nov 18, 2026 and rates it as critical; GitLab also rates it as critical. This bulletin is classified as HIGH.

The vendor stated that it is aware of proofs of concept that achieve remote code execution in some scenarios. According to researchers, the flaw can be reached without authentication from Rails and from Sinatra (classic style) in their default configuration; other frameworks and plain Rack do not expose it by default, although any application that changes the case of attacker-controlled text in one of those encodings may be exposed. It also affects products that bundle their own Ruby, such as self-managed GitLab and, according to researchers, GitHub Enterprise Server. In the same update the vendor fixed six other flaws in the regular-expression engine and in string case conversion, which are not the main subject of this bulletin. The regular-expression issues affect applications that compile attacker-controlled patterns.

The flaw is in the case conversion of several ISO-8859 and Windows-125x encodings: when converting “ß” to “SS”, Ruby writes two bytes after checking space for only one. Researchers report that methods such as upcase, swapcase, downcase(:fold) and casecmp? reach the vulnerable code, and that the defect has been present since Ruby 2.4.0. According to researchers, UTF-8 strings are not affected. Other researchers warn that achieving code execution in production is difficult and that a process crash is the most likely outcome.

No active exploitation is known, and the flaw is not listed in the catalog of known exploited vulnerabilities. There is not yet a public proof of concept for remote code execution. Researchers announced that they will publish one on Nov 25, 2026, so it is advisable to update before that date.

Mitigation

Inventory applications and products that use Ruby, including those that bundle it, and check the version with ruby -v.

The fix is to update to the versions listed in Solution. There is no official temporary workaround. The fix is in the Ruby interpreter: updating only Rails or the gems does not resolve it.

As a reduction of exposure, and not as a temporary workaround, it is advisable to restrict Internet access to self-managed GitLab and GitHub Enterprise Server instances that have not yet been updated.

Detection

Watch for unexpected crashes of Ruby processes (Puma, Unicorn, Sidekiq), which may indicate exploitation attempts. The patch does not undo a prior compromise.

Solution

In Ruby, update to 4.0.10, 3.4.13 or 3.3.14, according to the branch, or to a later release on that branch. Applications on Ruby 3.2 or earlier should be migrated to a supported, updated branch. Ruby 3.3 is in the security maintenance phase.

In self-managed GitLab, update to 19.6.1, 19.5.8 or 19.4.10. Official GitLab Linux packages and container images already include the patched Ruby. For installations compiled from source, the Ruby used to run GitLab must be rebuilt with 3.3.14 or 3.4.13 (or a later release in the same series). GitLab.com and GitLab Dedicated are already patched.

The fix is in the Ruby interpreter: updating only Rails or the gems does not resolve it. Rebuild container images with the official ruby image, which has already been published for 4.0.10, 3.4.13 and 3.3.14.

For GitHub Enterprise Server and Linux distribution packages, apply the fixed version as soon as the vendor publishes it. There is no official temporary workaround.

For information on how to update, visit the following link:

https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/

https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-6-1-released/

Additional information: