learn deep. ship safe.Practice testsFollow ByteMunSubscribe
Cyber Security

Ruby2Shell: Ruby Fixes 7 Memory Flaws, How to Check and Patch

Ruby fixed Ruby2Shell and six other memory-safety flaws in Ruby 4.0.10, 3.4.13 and 3.3.14. Researchers disagree on how easily the bug becomes code execution, but the fix is the same: upgrade the interpreter, rebuild and restart.

Ruby2Shell patch illustration: a violet gem with a teal check-mark shield and fixed Ruby versions 4.0.10, 3.4.13 and 3.3.14
Ruby fixed Ruby2Shell (CVE-2026-132825) and six related flaws in Ruby 4.0.10, 3.4.13 and 3.3.14 on November 18, 2026.

Status: Fixed Ruby versions 4.0.10, 3.4.13 and 3.3.14 were released on November 18, 2026. Only one of the seven flaws has a CVE so far; this article will be updated as CVEs, scores and the public proof-of-concept arrive.

Ruby2Shell (CVE-2026-132825) is a one-byte heap overflow in Ruby's string case conversion. It is one of seven memory-safety flaws the Ruby core team fixed in Ruby 4.0.10, 3.4.13 and 3.3.14 on November 18, 2026. Veria Labs says default Rails and classic Sinatra apps reach the bug without logging in. A watchTowr researcher says code execution is hard in production and a crash is more likely.

Every Ruby before those releases is affected, including October's 4.0.9, 3.4.12 and 3.3.13. Ruby 3.2 and older are end-of-life and get no fix. The flaws are in the interpreter (CRuby, the standard C implementation), so updating Rails or gems does not fix them. The Hacker News first reported the release.

The seven flaws in the Ruby security update

Ruby's announcement lists the flaws by GitHub Security Advisory (GHSA) ID. Severity labels come from each advisory page. When ByteMuni checked on November 20, all seven pages still said a CVE was pending. MITRE has since published CVE-2026-132825 for the first one; the other six have no CVE yet.

Advisory / CVEComponentBug classRuby severityProof-of-concept status (per Ruby)
GHSA-34m4-m9fh-gqp5 / CVE-2026-132825String case conversionOne-byte heap buffer overflowCriticalRCE "in some scenarios"
GHSA-7x2q-68qv-6p8x / pendingRegex compilationDouble freeCriticalRCE "in some scenarios"
GHSA-3p8q-wmhx-vm2w / pendingRegex compilationInteger overflow → heap buffer overflowCriticalRCE "in some scenarios"
GHSA-87fm-7w84-j2px / pendingString case conversionInteger overflow → heap buffer overflowHighRCE "in some scenarios"
GHSA-7whj-cfh7-xgm4 / pendingRegexp#to_sHeap buffer overflowHighRCE "in some scenarios"; info disclosure
GHSA-wpqw-5qxg-m68r / pendingCase-insensitive regex matchingOut-of-bounds readHighMemory corruption "in an attacker-controlled way"
GHSA-pvgc-g7gj-pv6h / pendingCase-insensitive backreference matchingOut-of-bounds readModerateNo PoC mentioned; may leak memory or crash

By our count, Ruby says proof-of-concept code shows code execution for five of the seven. None of it is public. Stephan Lipp of Ada Logics and Anthropic are credited with four of the seven.

How severe is CVE-2026-132825?

Who rates itRatingBasis
Ruby security team (GitHub advisory)CriticalPoCs show RCE "in some scenarios"
MITRE, the CVE assignerHigh, CVSS 3.1 score 7.4CVE record, November 19

GitLab's November 20 patch notes confirm the 7.4 is MITRE's. Third-party trackers that mirror the record, such as Strix, show a local, high-complexity vector (AV:L/AC:H), which explains the lower score. ByteMuni could not load NVD to confirm it. Veria Labs lists the access needed as "Network, no authentication."

How does Ruby2Shell reach a Rails or Sinatra app?

Veria Labs names the affected methods: upcase, swapcase, downcase(:fold) and casecmp?. Ruby's advisory says the bug occurs in "some single-byte encodings, such as ISO-8859-1 and Windows-1252." Developer Moritz Sanft lists the full set: ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15 and -16, and Windows-1250, -1252, -1254 and -1257. UTF-8 strings take a different code path and are not affected by this bug, Veria says.

Sanft traces the request path:

  1. An attacker sends a multipart/form-data POST with a _method part labeled charset=ISO-8859-1, filled with the German sharp s, ß.

  2. Rack, the web-server interface under Rails and Sinatra, honors that charset and tags the field's encoding.

  3. Rack's method-override middleware calls .upcase on the value.

  4. Uppercase ß is SS. Ruby sized the buffer one byte per character, so it writes one byte past the end on the heap.

This Ruby2Shell path runs before any controller or login check. Semgrep confirmed that the client's encoding reaches that call on Rails 8.1 and 7.2, Sinatra 4.2 and 3.2, and Rack 3.2 and 2.2. It did not build an exploit.

Ruby2Shell request flow: multipart _method field in ISO-8859-1 reaches Rack MethodOverride upcase and overflows one byte
The request path Moritz Sanft describes: a crafted form field reaches Rack's method override, where upcasing "ß" overflows the buffer by one byte.

The researchers disagree on what one byte buys an attacker:

  • Veria Labs says the bug is reachable without authentication in default Rails and classic Sinatra. Sanft reports that a collaborator showed pre-auth RCE on a plain rails new app.

  • watchTowr's Yordan Ganchev, quoted by SecurityWeek, says exploitation would need specific allocators, runtime settings and app conditions, plus an ASLR bypass. ASLR is the OS's randomized memory layout. He expects denial of service to be more common. watchTowr's FAQ calls the overwrite "a starting point."

On plain Rack, Veria says "not exposed by default." Semgrep is more precise: a Rack app is exposed if it mounts Rack::MethodOverride. Full-stack Rails and classic Sinatra (require 'sinatra') do by default. Rails with config.api_only = true and modular Sinatra::Base apps don't, unless method_override is on. Your own code that upcases legacy-encoded input can still be hit, Veria warns.

The regex flaws need a different condition. Four need the app to compile or match an attacker-controlled pattern, such as a search box that accepts regex. GHSA-pvgc needs only a crafted string matched against a case-insensitive backreference.

Who needs to act first on the Ruby patch

  • Internet-facing full-stack Rails and classic Sinatra apps on a Ruby vulnerable to Ruby2Shell, whether on a VPS, Docker, Kubernetes or a PaaS.

  • Self-hosted GitLab. GitLab shipped 19.6.1, 19.5.8 and 19.4.10 on November 20 with patched Ruby. GitLab.com and Dedicated are already patched.

  • Other bundled-Ruby products. SecurityWeek reports Chatwoot, Mastodon, OpenProject and the Discourse base image as patched. It lists GitHub Enterprise Server as affected without saying whether a fix exists. ByteMuni found no vendor advisories for these by November 20.

  • Apps that build regexes from user input.

  • Rails API-only and modular Sinatra services. Lower priority per Semgrep, but they still run vulnerable code.

How to check which Ruby is running

Check the Ruby your app actually runs, not just the one on your PATH:

# Ruby on the PATH
ruby -v

# Ruby the app's bundle uses (in the app directory)
bundle exec ruby -v

# Ruby inside a container image
docker run --rm your-app-image:tag ruby -v

# Ruby behind a running Puma, Unicorn or Sidekiq process
ps -eo pid,args | grep -E 'puma|unicorn|sidekiq'
sudo readlink /proc/<PID>/exe   # then run that binary with -v

# Distro packages (Debian/Ubuntu, then RHEL/Fedora)
dpkg -l | grep -E 'ruby|libruby'
rpm -qa | grep -i ruby

You need 4.0.10, 3.4.13, 3.3.14 or later in the same series. Check CI runners and build images too, because a green CI run on a different Ruby proves nothing about production.

Distro packages can backport fixes without changing the version number. Semgrep reports that Debian, Ubuntu and SUSE had not shipped a fix as of November 19. Debian's November 7 update, DSA-6614-1, ships 3.3.13, which is still affected.

How to fix CVE-2026-132825: affected vs fixed versions

Ruby branchAffectedFixed in
4.04.0.0 – 4.0.94.0.10
3.43.4.0 – 3.4.123.4.13
3.3 (security maintenance)3.3.13 and earlier3.3.14
3.2 and olderAllNo fix (end-of-life)
  1. Upgrade the interpreter. rbenv: update ruby-build, run rbenv install 3.4.13, and set .ruby-version. rvm: run rvm get stable, then rvm install 3.4.13. asdf: run asdf install ruby 3.4.13. Update any ruby line in the Gemfile.

  2. Run bundle install after switching, since version managers keep gems per Ruby.

  3. Rebuild containers on a fixed official tag, such as FROM ruby:3.4.13-slim, using docker build --pull. Reuse the rollout checks from our PHP2Shell Docker update guide.

  4. Restart Puma, Unicorn, Sidekiq and every long-running Ruby process. They keep the old interpreter in memory until they restart.

  5. Update bundled products, such as GitLab, through the vendor's own release.

There is no official workaround; Ruby's advisory says only that applications should upgrade. Semgrep says it tested Rails and Sinatra settings and front-of-stack middleware as stopgaps. Those cover only the method-override path, not your own case-conversion code or the regex flaws.

Exploitation status and timeline

No Ruby2Shell attacks had been reported as of November 19, and the CVE was not in CISA's Known Exploited Vulnerabilities catalog, according to watchTowr. ByteMuni could not load the KEV catalog to re-check on November 20. Veria Labs plans to publish its proof of concept "in a week, once people have had time to upgrade." By our count, that is around November 25–26. Orca Security expects the release to bring more exploitation attempts.

No one has published indicators of compromise. Since Ganchev expects crashes, my read is that unexplained segfaults in Puma or Unicorn workers since mid-November deserve a look. Their absence proves nothing.

  • October 23: Ruby 4.0.9, 3.4.12 and 3.3.13 fix three earlier regex bugs.

  • November 18: Ruby announces seven flaws and releases the fixes.

  • November 19: GitHub advisories go live and MITRE publishes CVE-2026-132825.

  • November 20: GitLab ships patched releases.

Heap overflow, double free and out-of-bounds read explained

A heap buffer overflow writes past the end of an allocated memory block, corrupting whatever sits next to it. An integer overflow often causes one: a size calculation wraps around and the buffer comes out too small. A double free returns one block to the allocator twice, which can let an attacker make two objects share memory. An out-of-bounds read reads past a block's end, leaking data or crashing the process. Ruby code is memory-safe, but the interpreter is written in C, where these bugs are possible.

My take on Ruby2Shell

My read is that the lasting lesson is inventory. Teams that patched Ruby in October did the right thing and are exposed again a month later. If you can answer "which Ruby runs in production?" with one command, you can handle the next bug in an hour. The same habit applies to the earlier CVE-2026-97229 Ruby patch check and to runtime bugs in other stacks, such as nginx2root.

The bottom line on the Ruby security update

Upgrade to 4.0.10, 3.4.13 or 3.3.14, rebuild your images and restart your workers before the proof of concept goes public. Start with internet-facing full-stack Rails and classic Sinatra. Whether Ruby2Shell turns out to be RCE or a crash in your setup, the fix is the same, and gem updates won't deliver it. On Ruby 3.2 or older, plan the move to 3.4 or 4.0 now.

Frequently asked questions

Does updating Rails or Rack fix Ruby2Shell?

No. The bug is in the Ruby interpreter's string case conversion, so you need Ruby 4.0.10, 3.4.13 or 3.3.14. Rails and gem updates leave the vulnerable interpreter in place.

I upgraded Ruby in October. Am I safe?

No. The October releases (4.0.9, 3.4.12 and 3.3.13) fixed earlier regex bugs and are still affected by all seven flaws announced on November 18.

Is my Rails API-only app exposed?

According to Semgrep's testing, Rails apps with config.api_only = true do not mount Rack::MethodOverride, which is the default path the researchers describe. The interpreter is still vulnerable, though, and your own code could call upcase on legacy-encoded input, so upgrade anyway.

Are UTF-8-only apps affected?

Veria Labs says UTF-8 strings take a different code path and are not affected by CVE-2026-132825. The other six flaws have their own conditions, mostly attacker-controlled regex patterns, so UTF-8 alone does not make an app safe from all seven.

Is Ruby2Shell being exploited?

No attacks had been reported as of November 19, 2026, according to watchTowr, which also listed it as not in CISA's KEV catalog. Veria Labs plans to publish a proof of concept about a week after disclosure.

What should I do if I'm stuck on Ruby 3.2?

Ruby 3.2 and earlier are end-of-life, and Ruby will not ship a fix for them. Plan a move to Ruby 3.4 or 4.0, and check whether your distro vendor offers its own backport.

Concepts in this article

Memory management
How a runtime allocates and frees memory, garbage collection, and how leaks happen.
Buffers
Fixed-size chunks of raw binary data in Node.js.
CVE
The public identifier system for disclosed security vulnerabilities.
Character encoding and Unicode
How text is stored as bytes (UTF-8, UTF-16) and why string length is not always the character count.
GitHub
A hosting platform for Git repositories, issues and CI.
GitLab
A DevOps platform for Git hosting and CI/CD.
Remote code execution (RCE)
A flaw that lets an attacker run their own code on a system over the network.
Stacks
Last-in, first-out storage, used for brackets, undo and depth-first search.

How we research, write and check articles

Written by

· Senior Software Engineer

Deepak Kumar is a Senior Software Engineer based in New Delhi. He maintains production systems with millions of readers, where a missed patch is an incident rather than a headline. He started ByteMuni to publish clear, source-checked guides for working developers.