---
title: "Ruby2Shell (CVE-2026-132825): find vulnerable Ruby across your repos"
description: "Ruby2Shell (CVE-2026-132825) is a critical heap overflow in Ruby's string case conversion that researchers say default Rails and classic Sinatra apps expose without authentication, with remote code execution proofs of concept known."
url: "https://swe.quest/articles/ruby2shell-cve-2026-132825-find-vulnerable-ruby-across-your-repos-943808a4d97a4f48"
canonical: "https://sourcegraph.com/blog/ruby2shell-cve-2026-132825-find-vulnerable-ruby"
source: "Sourcegraph"
published: "2026-11-20"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["ruby","vulnerability-research","supply-chain-security","developer-tools"]
---

# Ruby2Shell (CVE-2026-132825): find vulnerable Ruby across your repos

A post on [Sourcegraph](https://swe.quest/sources/sourcegraph.md), published 2026-11-20, 5 min read, How-to. Original: [https://sourcegraph.com/blog/ruby2shell-cve-2026-132825-find-vulnerable-ruby](https://sourcegraph.com/blog/ruby2shell-cve-2026-132825-find-vulnerable-ruby)

## Summary

Ruby2Shell (CVE-2026-132825) is a critical heap overflow in Ruby's string case conversion that researchers say default Rails and classic Sinatra apps expose without authentication, with remote code execution proofs of concept known. Fixed releases are 3.3.14, 3.4.13 and 4.0.10, and the hard part is finding which interpreter actually runs, because Dockerfiles, .ruby-version, Gemfile and Gemfile.lock can disagree and vendor products may bundle their own Ruby. Sourcegraph gives regex Code Search queries for affected version pins, a Deep Search prompt to reconcile pins per repo, and an Agentic Batch Changes prompt to bump exact pins within each series. Floating tags, unresolved build args and Ruby 3.2 or earlier are flagged for rebuild, review or migration rather than edited automatically.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Ruby](https://swe.quest/tags/ruby.md) (Languages)
- [Vulnerability research](https://swe.quest/tags/vulnerability-research.md) (Security)
- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- Ruby version management ([easy posts on Ruby](https://swe.quest/tags/ruby.md?difficulty=easy))
- Dockerfile multi-stage builds
- regular expressions

## Keywords

CVE-2026-132825, Ruby2Shell, Sourcegraph, Rails, Sinatra, Deep Search, Batch Changes, Gemfile.lock

## Related posts

- [How Cloudflare WAF protects against ruby2shell (CVE-2026-132825)](https://swe.quest/articles/how-cloudflare-waf-protects-against-ruby2shell-cve-2026-132825-7727483822350470.md): Cloudflare · 2026-11-20 · Medium · 6 min read · Vulnerability research, Ruby, Application security, Memory safety
  ruby2shell (CVE-2026-132825) is a heap buffer overflow in Ruby's string case conversion: in 14 legacy single-byte encodings, uppercasing the German ß writes two bytes (SS) but reserves room for one, so 21 sharp s characters overflow by a byte, with proofs of concept reaching remote code execution.
- [How We Fixed the Dependency Confusion Vulnerability in Over 600 Ruby Applications](https://swe.quest/articles/how-we-fixed-the-dependency-confusion-vulnerability-in-over-600-ruby-14f9a0a0836510b2.md): Shopify Engineering · 2022-01-27 · Medium · 9 min read · Supply chain security, Ruby, Refactoring & migrations, CI/CD
  Shopify closed a dependency confusion hole across roughly 600 Ruby applications by migrating each \`Gemfile.lock\` to Bundler's newer format, which pins every gem to an explicit source.
- [Making Open Source Safer for Everyone with Shopify’s Bug Bounty Program](https://swe.quest/articles/making-open-source-safer-for-everyone-with-shopify-s-bug-bounty-program-48c56c4f3d09ee13.md): Shopify Engineering · 2022-06-15 · Medium · 5 min read · Application security, Ruby, Open source
  A Shopify bug bounty report showed that a leaked Rails development secret could be escalated to remote code execution because ActiveSupport's MessageEncryptor deserialized data with Marshal by default.
- [php2shell: patching PHP is easy, finding it is the hard part](https://swe.quest/articles/php2shell-patching-php-is-easy-finding-it-is-the-hard-part-9a45e6f935b2d2f4.md): Sourcegraph · 2026-10-21 · Medium · 5 min read · PHP, Vulnerability research, Supply chain security, Incidents & postmortems, Memory safety
  PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated RCE memory-safety bugs (CVE-2026-109618/109619, dubbed php2shell) in the request lifecycle, reachable on mod\_php via a crafted multipart POST before application code runs.
- [Docker patches Java4Shell and the NGINX HTTP/2 with Docker Hardened Images](https://swe.quest/articles/docker-patches-java4shell-and-the-nginx-http-2-with-docker-hardened-images-8ddbd959f327792f.md): Docker · 2026-11-19 · Medium · 15 min read · Vulnerability research, Java & JVM, Containers, Supply chain security
  Java4Shell (CVE-2026-114938) is a HotSpot memory-corruption bug in the AVX-512 VBMI Base64 decoding intrinsic that writes up to 62 bytes past a heap buffer, enabling heap disclosure and pre-auth RCE in apps like Keycloak and Jenkins on Java 17.0.6+ running on affected x86-64 CPUs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
