Security Digest · Nov 18, 2026 · Vulnerability · Language runtime
Ruby2Shell: Heap Overflow in Ruby's String Case Conversion
A one-byte heap overflow in Ruby's string upcase is reachable pre-auth in default Rails. Fixed in 4.0.10, 3.4.13, 3.3.14. Not exploited; patch before Nov 25.
Our verdict
Patch this week
Upgrade Ruby on every server and image before November 25, when a remote exploit for stock Rails is due to go public: the trigger needs no login in default Rails, but turning it into code execution is hard and nobody has been seen doing it.
Who must act: Teams running Rails (other than API-only apps), classic-style Sinatra or other Rack apps on Ruby before 3.3.14, 3.4.13 or 4.0.10, and admins of products that bundle Ruby, such as GitHub Enterprise Server, GitLab, Mastodon, OpenProject, Chatwoot and Discourse.
Who can relax: GitLab.com users, since GitLab says it has already remediated the service, and developers who only run Ruby locally for scripts that never change the case of untrusted text; they can upgrade on their normal schedule.
- Affected
- Ruby 3.3.13 and earlier
Ruby 3.4.0 through 3.4.12
Ruby 4.0.0 through 4.0.9
Ruby 3.2 and earlier back to 2.4.0 (end of life, no upstream fix)
GitHub Enterprise Server 3.22.5 and earlier (no fix as of Nov 21, per Veria Labs)
GitLab CE/EE before 19.4.10, 19.5.x before 19.5.8, 19.6.x before 19.6.1 - Fixed in
- Ruby 4.0.10
Ruby 3.4.13
Ruby 3.3.14
GitLab 19.6.1, 19.5.8, 19.4.10
Mastodon 4.7.6, 4.6.12, 4.5.22, 4.4.29
OpenProject 17.9.8, 17.8.3
Chatwoot 4.20.1
Discourse base image 2.0.20261119-0203 - CVSS
- 7.4 (v3.1, CNA)
- EPSS
- 2.0% (percentile 81)
- CISA KEV
- Not listed
- Exploitation
- No known exploitation
- Severity
- Critical
What to do
- Inventory every Ruby interpreter on servers, CI runners, workers and container images with ruby -v, and check each app's running version with bin/rails runner 'puts RUBY_DESCRIPTION'.
- Upgrade to Ruby 4.0.10, 3.4.13 or 3.3.14 and update the version pins in .ruby-version, .tool-versions and the Gemfile ruby line.
- Rebuild container images from fixed base tags such as ruby:3.4.13, redeploy, and restart every Puma, Unicorn and Sidekiq process.
- Install vendor fixes for products that bundle Ruby, such as GitLab 19.6.1 and Mastodon 4.7.6, and limit network access to GitHub Enterprise Server until GitHub ships a fix.
- Move anything still on Ruby 3.2 or earlier to a supported branch, unless your distribution vendor confirms a backported fix.
- For distribution Ruby packages, confirm the fix in the package changelog or security tracker rather than trusting the version string.
How to check if you are affected or compromised
- Run Semgrep's open-source Ruby2Shell detector on hosts and Kubernetes nodes to find running processes that use an unpatched interpreter.
- Search application server logs and the systemd journal for Ruby [BUG] Segmentation fault reports or glibc malloc()/free() abort messages from web workers.
- Treat any unexplained web worker crash on an unpatched Ruby as a possible exploitation attempt and preserve logs and core dumps before restarting.
- No indicators of compromise have been published; a clean search does not prove a server was not attacked.
What happened#
On November 18, 2026, the Ruby core team released Ruby 4.0.10, 3.4.13 and 3.3.14 to fix seven memory-safety bugs in the regular expression engine and in string case conversion. The team says it is "aware of PoCs that prove some of them can be used to trigger remote code execution." The one drawing attention is a one-byte heap overflow in case conversion, GHSA-34m4-m9fh-gqp5, which MITRE assigned CVE-2026-132825 on November 19 with a CVSS 3.1 score of 7.4. Veria Labs, which says it independently found the bug and first showed code execution, named it Ruby2Shell. Ruby credits Stephan Lipp (Ada Logics) and Anthropic.
Veria's write-up explains the root cause. Several ISO-8859 and Windows-125x encodings, including ISO-8859-1 and Windows-1252, have no capital ß, so upcasing it produces two bytes, SS. The loop checks room for only one. The output buffer is the input length plus 20 bytes, so 21 ß characters overflow it by one byte. The code is reached through upcase, swapcase, downcase(:fold) and casecmp? and has existed since Ruby 2.4.0. UTF-8 strings take a different path and are not affected.
Who is affected#
Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9 are affected. Ruby 3.2 and earlier are end of life and get no upstream fix. The bug is in the interpreter, so updating Rails or other gems does not help.
A UTF-8 app is still exposed because attackers can choose the encoding. Veria says Rails and classic-style Sinatra are reachable without authentication in their default configuration. Semgrep, in its detection scripts, says it confirmed the path: Rack::MethodOverride, which Rails mounts unless the app is API-only, lets a multipart part's declared charset reach the case-conversion call before authentication. Other frameworks and plain Rack are not exposed by default.
Bundled Rubies need vendor updates. GitLab fixed it in 19.6.1, 19.5.8 and 19.4.10 on November 20. Veria lists Mastodon, OpenProject, Chatwoot and the Discourse base image as patched, and GitHub Enterprise Server 3.22.5 and earlier as vulnerable with no fix. GitHub's own advisory was not disclosed as of Nov 21, 2026. Ubuntu's tracker still showed its ruby3.0, ruby3.2 and ruby3.3 packages as "Needs evaluation" on November 21.
Do you really need to act?#
Yes, this week, and before November 25. The ratings disagree. Ruby and GitLab call it Critical. MITRE's 7.4 assumes a local attack vector and high complexity. CISA's assessment in the CVE record marks it not automatable with no known exploitation, and none had been reported as of Nov 21, 2026.
Exploitation is hard. watchTowr's Yordan Ganchev told SecurityWeek that attackers "would also need the right non-glibc memory allocator, runtime configuration, and application logic preconditions," and must defeat ASLR. A stock glibc system is not proof of safety, though. An independent public analysis found that glibc's alignment absorbs the naive trigger, but a crafted string still corrupted glibc heap metadata in local tests.
The timing is what makes this urgent. The trigger needs no login in a default Rails app, and Veria plans to publish a remote code execution exploit for stock Rails on November 25. Five of the six other bugs are in the regex engine, so apps that compile patterns from user input have another reason to upgrade.
What to do now#
- Find every Ruby you run: hosts, CI runners, workers and images. Check
ruby -v,docker run --rm --entrypoint ruby <image> -v, andbin/rails runner 'puts RUBY_DESCRIPTION'inside each app. - Upgrade to 4.0.10, 3.4.13 or 3.3.14. Update the pins in
.ruby-version,.tool-versionsor the Gemfilerubyline, then install, for examplerbenv install 3.4.13orasdf install ruby 3.4.13after updating ruby-build or the asdf plugin. - Rebuild images from fixed tags such as
ruby:3.4.13, which Docker Hub published on November 19. Redeploy and restart every Puma, Unicorn and Sidekiq process; running processes keep the old interpreter. - For distribution packages, confirm the fix in the changelog or tracker rather than trusting the version string, which backports may not change.
- Patch products that bundle Ruby. Limit network access to GitHub Enterprise Server until GitHub ships a fix.
- Move anything on Ruby 3.2 or earlier to a supported branch.
How to tell if you were hit#
No exploitation or indicators of compromise had been published as of Nov 21, 2026. Semgrep's detectors report which running processes and containers use an unpatched interpreter. They find exposure, not compromise. Failed heap exploits often crash the process, so look for unexplained web worker crashes, such as Ruby's [BUG] Segmentation fault report or glibc malloc() or free() aborts. A first pass is journalctl -u <app-service> | grep -E '\[BUG\]|malloc\(\)|free\(\)'. A clean result proves little: a successful exploit need not crash anything. If an unpatched server shows such crashes, preserve its logs and investigate before you restart it.
Timeline#
- — Ruby publishes seven advisories and releases 4.0.10, 3.4.13 and 3.3.14.
- — MITRE assigns CVE-2026-132825 (CVSS 3.1 7.4). Docker Hub publishes fixed ruby images, and Semgrep merges its detection scripts.
- — GitLab ships 19.6.1, 19.5.8 and 19.4.10 with the patched Ruby.
- — Veria lists GitHub Enterprise Server 3.22.5 and earlier as still vulnerable.
- — Veria plans to publish a remote code execution exploit for stock Rails, or later if major vendors have not shipped fixes by then.
Vulnerability records
- CVE-2026-132825 · Ruby before 3.3.14, 3.4.13, and 4.0.10 has a heap-based buffer overflow during case conversion.
Sources
Original sources first: vendor and project advisories, CVE and government records, the discoverers’ write-ups. Every claim above links to one of these. See how the Security Desk works.
Original and primary sources
- Ruby — Security advisories: multiple vulnerabilities in Regexp and String case conversion ruby-lang.org
- CVE record — CVE-2026-132825 cve.org
- GitHub ruby/ruby — GHSA-34m4-m9fh-gqp5: Heap buffer overflow in case conversion of strings github.com
- Veria Labs — Ruby2Shell (CVE-2026-132825) verialabs.com
- watchTowr — Frequently Asked Questions About the Ruby Remote Code Execution (Ruby2Shell CVE-2026-132825) watchtowr.com
- GitLab — Critical Patch Release: 19.6.1, 19.5.8, 19.4.10 docs.gitlab.com
- oss-security — Re: Ruby: multiple vulnerabilities in Regexp and String case conversion openwall.com
- Ubuntu — CVE-2026-132825 ubuntu.com
- Semgrep detection-scripts — PR #16: Add CVE-2026-132825 "Ruby2Shell" detection github.com
- evenomn — Ruby2Shell Research: independent root-cause analysis and reproduction github.com
- Docker Hub — ruby official image hub.docker.com
- Previdian — Ruby2Shell (CVE-2026-132825): What We Know So Far blog.previdian.com