Subscribe
0%
Illustration for: Ruby2Shell (CVE-2026-132825): a one-byte Ruby overflow reaches stock Rails apps. Upgrade to 3.3.14, 3.4.13 or 4.0.10

Ruby2Shell (CVE-2026-132825): a one-byte Ruby overflow reaches stock Rails apps. Upgrade to 3.3.14, 3.4.13 or 4.0.10

Ruby's November 18 security releases fix a heap overflow in string case conversion that researchers say can be reached without logging in on default Rails and classic Sinatra apps. Upgrading Rails or Rack does not help — only a patched Ruby does — and a public proof of concept is promised for around November 25.

Listen to this article0:00 / 6:45

Ruby's maintainers shipped Ruby 3.3.14, 3.4.13 and 4.0.10 on November 18 to fix seven memory-safety bugs. The one getting the attention is "Ruby2Shell" (GHSA-34m4-m9fh-gqp5, tracked as CVE-2026-132825). It is a one-byte heap overflow in string case conversion. Researchers at Veria Labs, who named it, say it can be reached without authentication in default Rails and classic-style Sinatra apps, according to Orca Security, Aikido and Equixly.

This matters because the fix sits in the interpreter, not in your gems. Orca and Cyber Kendra both stress that upgrading Rails, Rack or Sinatra does nothing. Every Ruby runtime you deploy has to be replaced: host packages, rbenv/rvm installs, container base images, and the Ruby bundled inside products like GitLab.

What the bug is

Orca and Cyber Kendra describe it like this. When Ruby upcases the German sharp s (ß, byte 0xDF) in a legacy single-byte encoding, the result is two characters, "SS". The code only reserved room for one. A string with enough ß characters writes one byte past the end of a heap buffer. Cyber Kendra, citing Veria, says the buffer gets 20 spare bytes, so 21 ß characters cause the overflow.

  • Encodings: ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15 and -16, plus Windows-1250, -1252, -1254 and -1257. Equixly and Cyber Kendra cite the upstream fix commit for this list. UTF-8 strings take a different code path and are not affected.
  • Methods: upcase, swapcase, downcase(:fold) and casecmp?, along with their bang and Symbol variants (per Cyber Kendra).
  • Age: the bug dates back to Ruby 2.4.0, according to Aikido and Equixly.

Veria has not published the Rails code path, Equixly notes. ComputingForGeeks' own analysis points to Rack's MethodOverride middleware, on by default in full (non-API) Rails apps, which uppercases the _method form field, and a multipart request can declare a legacy charset for that field. It confirmed only that the middleware is present by default, so treat this as plausible, not confirmed.

Affected and fixed versions

Branch Vulnerable Fixed (Nov 18)
Ruby 4.0 4.0.0 – 4.0.9 4.0.10
Ruby 3.4 3.4.0 – 3.4.12 3.4.13
Ruby 3.3 3.3.13 and earlier 3.3.14
Ruby 3.2 and older (to 2.4.0) all none (end of life)

Aikido, Orca and Cyber Kendra agree on these versions. The releases fix six other bugs too; Orca says Ruby knows of code-execution proofs of concept for five of the seven.

How serious, how soon

  • Exploitation: none reported in the wild as of November 19–20, according to Orca, Aikido and ComputingForGeeks. ComputingForGeeks notes the CVE was not in CISA's Known Exploited Vulnerabilities catalog.
  • Public exploit: Veria plans to publish a working exploit against stock Rails around November 25, or later if major vendors haven't shipped fixes (ComputingForGeeks, Equixly). Cyber Kendra also reports a separate account from researcher group Durendal, which describes working pre-auth exploits against a fresh rails new app. TechMeasured could not read that account.
  • Severity labels disagree. Ruby and Veria call it critical. Cyber Kendra says the MITRE record scores it 7.4 (High) with a local attack vector, which clashes with the network attacks researchers describe. ComputingForGeeks says Amazon rates it 8.1. NVD had not scored it.
  • Credit: Aikido, Equixly and Cyber Kendra say the Ruby advisory credits Stephan Lipp (Ada Logics) and Anthropic. Cyber Kendra adds that Durendal says it found the same bug using OpenAI's Codex and that OpenAI reported it on November 5.

Self-hosted apps that bundle Ruby

Veria's list (as of November 19) flagged six products whose latest releases bundled a vulnerable Ruby. ComputingForGeeks checked again on November 19–20:

Product Status per ComputingForGeeks
GitLab 19.6.0 (Omnibus, Ruby 3.3.13) Vulnerable; Ruby bump merged, no patch release yet
GitHub Enterprise Server 3.22.5 (Ruby 4.0.9) No fix announced
Mastodon 4.7.6 Docker images fixed
OpenProject 17.9.8 (Ruby 4.0.10) fixed, Nov 19
Discourse (discourse_docker) Fixed after ./launcher rebuild app
Chatwoot 4.20.0 (Ruby 3.4.4) No fix announced

For anything still unpatched, Aikido and Equixly recommend putting the server behind a VPN or IP allowlist until the vendor ships a fix.

What to do

  1. Find every Ruby you run. Start with ruby -v on hosts and in each container (docker run --rm --entrypoint ruby your-app:latest -v). For GitLab Omnibus, check sudo /opt/gitlab/embedded/bin/ruby --version. To confirm what a running server actually uses, Equixly suggests readlink -f /proc/<PID>/exe.
  2. Upgrade to 3.3.14, 3.4.13 or 4.0.10, then restart Puma, Unicorn and Sidekiq. Old processes keep the vulnerable code loaded.
  3. Rebuild images. ComputingForGeeks says the official Docker ruby images were rebuilt on November 19 (ruby:4.0.10, ruby:3.4.13, ruby:3.3.14 and the floating tags), and Alpine already ships 3.4.13. Ubuntu, Debian and RHEL fixes were still pending when it checked. Orca warns that distro packages may be patched without changing the version number.
  4. On Ruby 3.2 or older, there is no fix. Move to a supported branch.
  5. Don't count on workarounds. Ruby lists none. Equixly floated an edge WAF rule that matches runs of encoded ß bytes, but it hasn't tested it. ComputingForGeeks says removing MethodOverride closes one path but fixes nothing.

Watch for Veria's exploit around November 25. After that, any internet-facing Rails app still on an old Ruby becomes much easier to attack.

Sources

  1. Orca Security — ruby2ßhell: One-Byte Heap Overflow in Ruby Could Allow Remote Code Execution in Rails orca.security
  2. Aikido — Ruby2Shell: Ruby RCE, affected versions and fix aikido.dev
  3. Cyber Kendra — Ruby2Shell Flaw in Ruby Exposes Default Rails Apps to Unauthenticated Code Execution cyberkendra.com
  4. ComputingForGeeks — Ruby2Shell CVE-2026-132825: Check and Patch Ruby, Rails, GitLab computingforgeeks.com
  5. Equixly — Ruby2Shell: Pre-auth heap overflow in Ruby 3.3, 3.4, and 4.0 equixly.com

#Ruby#Rails#Sinatra#Ruby2Shell#CVE-2026-132825#GHSA-34m4-m9fh-gqp5#GitLab#Mastodon#heap overflow#patch