Skip to content

Advertisement

DevOps Society
DevOpsNews

Ruby2Shell Is Fixed in the Ruby Interpreter, Not Your Gemfile, and Scanners Will Not Tell You

CVE-2026-132825 is a heap overflow in how Ruby changes the case of some strings, reachable in stock Rails apps before login. Running bundle update does nothing. How to find every Ruby runtime and fix it.

Published your local timeupdated

Ruby2Shell Is Fixed in the Ruby Interpreter, Not Your Gemfile, and Scanners Will Not Tell You

Most Ruby security fixes arrive as gem updates. Dependabot opens a pull request, CI runs, someone merges it, done. Ruby2Shell does not work like that, and that is exactly why it is worth a careful look.

The bug, CVE-2026-132825, lives in the Ruby interpreter itself. Ruby fixed it on 18 November in versions 3.3.14, 3.4.13 and 4.0.10, along with six other memory safety issues in the regex engine and string handling.

A one-byte mistake with the German sharp s

The technical write-up from Veria Labs explains it well. Most single-byte encodings, such as ISO-8859-1 and Windows-1252, have no capital form of the German letter ß. Upcasing it produces two characters, SS. Ruby's case conversion code checked for room for one byte, not two. The output buffer has 20 bytes of slack, so a string with 21 sharp s characters overflows the heap by one byte.

One byte sounds harmless. It is not. Ruby says it knows of proofs of concept that reach code execution in some cases. The bug has been in the code since Ruby 2.4.0. Strings in UTF-8 are not affected, which is why most normal text never triggers it.

How it reaches a Rails app before login

Semgrep's analysis shows the path that makes this serious for web apps. Rails uses a piece of Rack middleware that lets HTML forms fake PUT and DELETE requests through a hidden _method field, and it upcases that field. A multipart form part can declare its own character set. And this middleware runs before routing, CSRF checks and authentication.

So an unauthenticated request to a stock Rails app can reach the vulnerable code. API-only Rails apps (config.api_only = true) do not include that middleware. Classic Sinatra apps are exposed. Modular Sinatra apps are only exposed if method override is turned on.

The CVE record carries a CVSS 3.1 score of 7.4 with a local attack vector, which undersells it. Ruby's own team rates it critical.

Why your tools may stay quiet

Your Gemfile.lock looks identical whether the interpreter underneath is vulnerable or fixed. Dependency scanners that only read lockfiles will report nothing. bundle update changes nothing. The fix is a new Ruby binary, which usually means a new base image.

That also means checking places you may not think of as "Ruby apps": internal tools, background workers, products that bundle their own Ruby.

Products that ship their own Ruby

Veria Labs keeps a table of affected products. As of 21 November, fixes were out for GitLab (19.6.1, 19.5.8 and 19.4.10), Mastodon, OpenProject, Chatwoot and Discourse. GitHub Enterprise Server 3.22.5 and earlier were still listed as vulnerable with no fix yet.

If the GitLab angle sounds familiar, it is. Alpine Linux learned in October that upgrading GitLab is not enough when the fix lives in Ruby and your image uses a different Ruby. Same lesson, one month later.

What to do

  1. Find every Ruby runtime. Base images, VM images, bundled products. An image-level SBOM makes this a query rather than a hunt; we explained how to generate one in what an SBOM is.

  2. Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10, or your distribution's patched package. Ubuntu has shipped backports, and backported packages keep their old version strings, so check against the advisory rather than the version number.

  3. Rebuild images and restart everything. App servers and job workers keep running the old interpreter until they restart. Do not trust ruby -v in a shell; check what the running process actually uses. Semgrep has published detection scripts that help.

  4. Update bundled products to the vendor releases above.

  5. Plan your way off Ruby 3.2 and older. They are end of life and will not get this fix.

No attacks were reported as of the latest advisories, but Veria Labs said it planned to publish a working exploit against stock Rails. Treat this as urgent for anything internet-facing.

Advertisement

Follow DevOps Society on LinkedIn

Practical infrastructure engineering in your feed.

Follow

Written by

DevOpsSociety Editorial Team

Editorial Team

The DevOpsSociety Editorial Team covers DevOps, cloud infrastructure, Kubernetes, AI infrastructure, platform engineering, cybersecurity, FinOps, and modern engineering practices. We publish practical insights, technical guides, architecture analysis, and research for engineers and technology leaders.

More from DevOpsSociety →
The Infrastructure Briefing

Get the infrastructure briefing.

Practical DevOps, cloud, AI infrastructure and engineering insights, delivered weekly. Read by engineers and engineering leaders.

No spam. Unsubscribe anytime.

Ruby2Shell Is Fixed in the Ruby Interpreter, Not Your Gemfile, and Scanners Will Not Tell You, DevOps Society