Ruby2Shell Patch Alert: Upgrade Ruby on Your Rails or Sinatra App Now

Quick answer: A Ruby bug lets strangers attack default Rails and classic Sinatra apps before login. Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10. How to check and patch an old app.

The problem

On November 18, 2026 the Ruby team released Ruby 3.3.14, 3.4.13 and 4.0.10 to fix seven memory-safety bugs. The most serious one is nicknamed Ruby2Shell (CVE-2026-132825, GitHub advisory GHSA-34m4-m9fh-gqp5). Ruby rates it Critical and says it knows of proof-of-concept exploits that "can be used to trigger RCE in some scenarios" (RCE means remote code execution). In plain English, that means an attacker may be able to run their own commands on your server.

The researchers who named it, Veria Labs, say a default Rails app or a classic-style Sinatra app can be hit before anyone logs in. They said they planned to publish a working exploit for stock Rails on or after November 25, 2026 ("or later if major vendors have not shipped a fix by then"). Once an exploit is public, expect bots to scan for unpatched apps.

If you vibe-coded a Rails or Sinatra app, deployed it, and haven't touched it since, it's very likely still on a vulnerable Ruby. This guide shows how to check it and patch it.

Facts on this page were checked on November 22, 2026 against the official Ruby advisory, the GitHub advisory, the CVE record and Veria Labs' write-up. This is a developing story, so check those links for updates.

What the hole is, in plain words

Ruby can change text to upper or lower case. For some old text encodings (such as ISO-8859-1 / Latin-1 and Windows-1252), the German letter ß turns into two letters, SS, when upper-cased. Ruby only checked that it had room for one, so a string with enough ß characters writes one byte past the end of its memory buffer. One stray byte sounds harmless, but in skilled hands that kind of memory corruption can be turned into running code. UTF-8 text, which most modern apps use, takes a different code path and isn't affected.

How does a stranger reach it in a Rails app? HTML forms can only send GET and POST, so Rails and Sinatra accept a hidden _method field to fake PUT, PATCH and DELETE. A small piece of middleware, Rack::MethodOverride, upper-cases that field. An attacker can send a form upload that says "this field is in Latin-1" and fill it with ß. According to Veria Labs, Cloudflare and Semgrep, this happens while the request is still being routed, before your login check or any of your code runs.

The bug is in Ruby itself, not in Rails, Sinatra or Rack. That means updating Rails or running bundle update does not fix it. You have to upgrade the Ruby version your app runs on.

Who's affected

Ruby versions (from Ruby's advisory):

Frameworks (per Veria Labs, also confirmed by Cloudflare and Semgrep; Ruby's own advisory doesn't name frameworks):

The same releases also fix six other bugs. One is a second overflow in case conversion (GHSA-87fm-7w84-j2px), and five are in Ruby's regular expression engine. Ruby says several of them can also lead to code execution. That's one more reason to upgrade even if you're not on Rails.

Fixes

1. Find out which Ruby your app actually runs

Your laptop's Ruby and your server's Ruby can be different. Check both. In the project folder:

ruby -v                               # Ruby on this machine
cat .ruby-version                     # version the project asks for (if the file exists)
grep -n "^ruby" Gemfile               # a "ruby" line in the Gemfile, if any
grep -A1 "RUBY VERSION" Gemfile.lock  # Ruby recorded in the lockfile
grep -n "RUBY_VERSION\|FROM .*ruby" Dockerfile   # Docker-based deploys (Fly.io, Kamal, Render Docker, etc.)

Then check the live server. For example:

heroku run ruby -v -a your-app        # Heroku
fly ssh console -C "ruby -v"          # Fly.io

On Render, Railway or a VPS, open the service's shell or SSH in and run ruby -v. If the number is below the fixed version for its series, you're vulnerable.

If your Ruby comes from a Linux distribution package, the distro may have backported the fix without changing the version number. In that case, compare your full package version with your distro's advisory (for example, Ubuntu's CVE page).

2. Check whether your app is Rails or Sinatra, and which style

bundle exec rails -v                          # Rails version (if it's a Rails app)
grep -n "api_only" config/application.rb      # "config.api_only = true" means API-only
bin/rails middleware | grep MethodOverride    # shows Rack::MethodOverride if it's loaded
grep -n "sinatra \|rack " Gemfile.lock        # Sinatra and Rack gem versions
grep -rn "Sinatra::Base\|require 'sinatra'" --include=*.rb .   # classic vs modular Sinatra

The Rails version doesn't matter for this bug. A Rails 8 app on Ruby 3.4.12 is vulnerable, and a Rails 6.1 app on Ruby 3.3.14 isn't. This step just tells you how urgent the upgrade is.

3. Back up, then install the fixed Ruby locally

Commit or copy your project first (git add -A && git commit -m "before ruby upgrade"). Then pick the fixed version in the same series you're on. That's the smallest, safest jump:

Install it with whichever version manager you use:

# rbenv (update ruby-build first so it knows the new versions)
brew upgrade ruby-build        # or: git -C "$(rbenv root)"/plugins/ruby-build pull
rbenv install 3.4.13

# mise
mise install ruby@3.4.13

# asdf
asdf install ruby 3.4.13

4. Point the project at the new Ruby

Change every place the old version is written:

Then update the lockfile and make sure the app still boots:

bundle install
bundle update --ruby     # records the new Ruby in Gemfile.lock
bin/rails test           # or bundle exec rspec, if the app has tests
bin/rails server         # open the app locally and click around

5. Redeploy on your host

Push the change and make sure the host rebuilds with the new Ruby. Restarting alone keeps the old one.

6. Confirm the fix is live

Run ruby -v on the live server again (step 1 commands), and check it from inside the app too:

heroku run 'bin/rails runner "puts RUBY_VERSION"' -a your-app   # Heroku example

It should print 3.3.14, 3.4.13, 4.0.10 or newer. Then check that the site loads and your forms (sign-up, edit, delete) still work.

7. Can't patch today? Reduce the risk

Ruby's advisory lists no workaround. Upgrading is the fix. Until you can upgrade:

Prompt to paste into Cursor, Claude Code, Lovable, Bolt or Replit

My Ruby app needs an urgent security upgrade for Ruby2Shell (CVE-2026-132825). The fix is upgrading the Ruby interpreter itself to 3.3.14, 3.4.13 or 4.0.10. Updating Rails or gems does not fix it. First, without changing anything, tell me: the Ruby version in .ruby-version, the Gemfile, Gemfile.lock (RUBY VERSION), the Dockerfile and any CI config; whether this is Rails (and whether config.api_only is true) or Sinatra (classic or modular); and how this app is deployed. Then upgrade to the fixed Ruby in the SAME series I'm on (3.3.x → 3.3.14, 3.4.x → 3.4.13, 4.0.x → 4.0.10). If I'm on Ruby 3.2 or older, tell me before doing anything, because that's a bigger upgrade. Update every place the version is pinned, run bundle install and bundle update --ruby, and run the tests. Do NOT upgrade Rails or other gems unless the new Ruby requires it, and if it does, explain why first. Finally, give me the exact steps to redeploy on my host and the command to confirm the live server reports the new Ruby version.

FAQ

Is updating Rails enough? No. The bug is in the Ruby interpreter. bundle update rails changes nothing here. You need Ruby 3.3.14, 3.4.13, 4.0.10 or newer.

Is there a real exploit yet? Ruby says it is aware of private proofs of concept that reach code execution "in some scenarios". Veria Labs said it planned to publish a remote-code-execution proof of concept for stock Rails on November 25, 2026, or later if major vendors hadn't shipped fixes. Check Veria Labs' page to see whether it's out. When we last checked, on November 22, 2026, we hadn't seen reports of attacks. Either way, patch now.

My app is API-only, or modular Sinatra. Am I safe? Probably not reachable through the default _method route, according to Veria Labs and Semgrep. Your own code may still upper- or lower-case user input in a legacy encoding, and the same Ruby release fixes six other memory bugs. Upgrade anyway.

Why does the CVE say "High 7.4" when Ruby says "Critical"? The CVE record's score (7.4, "local" attack) was filed with the CVE request. Ruby's GitHub advisory rates the bug Critical, and the known route into Rails and Sinatra is an ordinary web request with no login. Treat any internet-facing app as urgent.

I'm on Ruby 3.2 or older. What now? Ruby 3.2 and earlier are end of life and won't get this fix from Ruby. Move to a supported series (3.3.14 is the smallest jump). If your Ruby comes from a Linux distribution, check whether your distro shipped a backported fix.

I use GitLab, Mastodon, Discourse or another self-hosted app built on Ruby. Those bundle their own Ruby, so the fix has to come from the vendor. Install the vendor's patched release. Veria Labs keeps a list of fixed versions.

Sources

Related guides

Still stuck? Paste your exact error into the free Error Fixer to get a plain-English cause, the fix, and a prompt to paste back into your AI tool.

Fix it faster

The Fix Pack: top 50 errors, explained

18-page PDF with causes, step-by-step fixes and AI prompts for the 50 most common vibe-coding errors.

What you get: 18-page PDF: 50 errors, each with the cause, fix steps and a prompt for your AI tool. Try the free Error Fixer first

$9

Buy now

Instant download via Payhip · Secure checkout with PayPal

Debug & Fix Prompt Pack

20 prompts plus a strict version of each, to diagnose and fix errors without looping.

What you get: 8-page PDF: 20 prompts plus a strict version of each (40 in total). Get the free 10-prompt sample first

$9

Buy now

Instant download via Payhip · Secure checkout with PayPal

Get the free "10 Prompts That Fix Broken AI Code" pack

Join the UnbreakKit newsletter: one short email a week with real errors from Cursor, Lovable, Bolt & Replit users and how to fix them. Unsubscribe anytime.

Newsletter signup powered by beehiiv. We only use your email to send the newsletter.