Ruby2ßhell: Critical Remote Code Execution Vulnerability in Ruby (CVE-2026-132825)
Executive Summary
On November 18th, 2026, the Ruby team published an advisory detailing seven critical vulnerabilities in the Ruby language interpreter and released fixed versions. Most had not been assigned CVE IDs at time of writing except for one, tracked as CVE-2026-132825. That flaw lets a remote attacker corrupt heap memory by supplying a crafted string that an application converts to upper or lower case. Ruby 4.0.0 through 4.0.9, 3.4.0 through 3.4.12, and 3.3.13 and earlier are affected by these vulnerabilities.
Ruby powers Ruby on Rails and Sinatra web applications and ships inside self-hosted platforms such as GitLab and Mastodon. Veria Labs, which named CVE-2026-132825 "ruby2ßhell", reports it is reachable without authentication in default Rails and classic-style Sinatra applications. It should also be noted that of the seven reported bugs, the five that were reported to have researcher supplied proof of concept code available were all heap corruption bugs. This is meaningful in two main ways, first, heap corruption bugs are non-trivial to exploit and often result in system crashes instead of remote code execution. Second, this vulnerability class is old and well-known, and system level protections like ASLR are industry standards. These factors will likely reduce the world-wide impact of these vulnerabilities.
No exploitation in the wild has been reported for any of the seven vulnerabilities at the time of writing. The Ruby team is aware of non-public proof-of-concept (PoC) exploits for each that achieve code execution in some scenarios. Veria Labs plans to publish its CVE-2026-132825 PoC about a week after disclosure, to give affected organizations time to update. Given unauthenticated reach in default Rails and an imminent public PoC, Beazley Security recommends affected organizations apply available fixes as soon as possible. The official patch covers all seven reported vulnerabilities.
Affected Systems or Products
Mitigations / Workarounds
The Ruby team has not published a workaround. Upgrading the interpreter to 4.0.10, 3.4.13, or 3.3.14 is the only remediation, and a single upgrade also addresses the six other flaws fixed in the same release. The fix applies to the Ruby interpreter rather than in a gem, so updating Rails or running bundle update does not remediate it. Ruby 3.2 and earlier have reached end of life and will not receive the fix. Linux distributions may ship the fix as a patched package without changing the Ruby version number, so confirm status against the relevant distribution advisory.
Self-hosted platforms that bundle their own Ruby runtime are not protected by upgrading the host's system Ruby. Veria Labs found that the latest release of each of the following platforms still bundled an affected Ruby as of November 19th, 2026:
- GitLab 19.6.0 (Ruby 3.3.13)
- GitHub Enterprise Server 3.22.5 (Ruby 4.0.9)
- Chatwoot 4.20.0 (Ruby 3.4.4)
This list covers only the latest release of each platform at disclosure so it should not be assumed that earlier releases are unaffected. Check the bundled Ruby version of every deployed release, and apply fixed builds from each platform vendor as they become available.
If patching cannot be immediately applied, the following may help to temporarily reduce risk:
- Restrict access to self-hosted platforms that bundle Ruby to trusted networks, for example behind a VPN or an IP allowlist, until their vendors release fixed builds.
- Inventory every Ruby runtime in the environment, including operating system packages, version manager and source installs, Ruby bundled inside applications, and container base images.
- Prioritize internet-facing Rails and Sinatra applications and any Ruby service that calls case conversion functions.
Patches
The Ruby team released Ruby 4.0.10, 3.4.13, and 3.3.14 to fix this vulnerability. Details are in the Ruby security announcement. After upgrading, restart application servers and background workers, rebuild container images on patched base images, and update pinned versions in files such as Dockerfiles and .ruby-version. Self-hosted platforms that bundle Ruby require a fixed release from their own vendor.
Technical Details
CVE-2026-132825 is a one-byte heap-based buffer overflow in the case conversion routines Ruby uses for several legacy single-byte encodings, including ISO-8859 variants and Windows-1250, Windows-1252, Windows-1254, and Windows-1257. The flaw is centered around the capital form of the German sharp s ("ß", byte 0xDF), where upper-casing it produces two bytes, SS. The core of this bug is that the second byte is not properly bounds-checked. The output buffer is set at the size of the input buffer plus 20 bytes, so 20 0xDF characters will overflow that buffer by one. This was enough for Verilabs researchers to achieve remote code execution.
The flaw is reachable through upcase, swapcase, downcase(:fold), and casecmp?. UTF-8 strings take a different code path and are not affected. The vulnerable loop has been present since Ruby 2.4.0, and the upstream fix (ruby/ruby commit d582f8f) ensures two bytes of output space are available when the sharp s is converted.
How Beazley Security is responding
Beazley Security is monitoring client perimeter devices through our Exposure Management Platform to identify impacted devices and support organizations in remediation of any issues found.
We are also conducting threat hunts across our MDR environment to detect potential exploitation attempts against our clients.
If you believe your organization may have been impacted by this vulnerability and need support, please contact our Incident Response team.
Sources
Aware of an incident impacting your industry? Let us know: