Blog

Ruby2Shell (CVE-2026-132825): How a One-Byte Ruby Overflow Became a Critical RCE Risk

Sachin Kode, Head of Security, ArmorCode
Head of Security
Ruby2Shell (CVE-2026-132825): How a One-Byte Ruby Overflow Became a Critical RCE Risk

What is Ruby2Shell?

Ruby2Shell is a critical one-byte heap buffer overflow in how Ruby changes the case of strings in legacy single-byte encodings, such as ISO-8859-1 and Windows-1252. Ruby’s maintainers rate it Critical and say they know of proof-of-concept exploits that trigger remote code execution (RCE) in some scenarios. Veria Labs, which named the flaw, reports that an unauthenticated attacker can reach it over the network in Rails and classic-style Sinatra applications in their default configuration.

On November 18, 2026, Ruby released 4.0.10, 3.4.13 and 3.3.14, which fix Ruby2Shell and six other memory-safety flaws in the regular expression engine and in string case conversion. Ruby credits Stephan Lipp (Ada Logics) and Anthropic with the report.

The flaw is in the Ruby interpreter, not in a gem, so updating application dependencies does not help. Ruby is also bundled inside many products without an inventory entry of its own, so finding every runtime matters as much as patching it.

How Ruby2Shell works

When Ruby upcases a string in these encodings, the German sharp s (ß) becomes two letters, butRuby’s output-buffer check did not account for the second one. A crafted string can therefore write one byte past the end of a heap buffer. The written byte is fixed rather than chosen by the attacker, yet researchers report code execution anyway.

The flaw is reached through case-changing methods such as upcase and swapcase. UTF-8 strings take a different code path and are not affected.

Which Ruby versions are affected by Ruby2Shell

An application is exposed if it runs an affected Ruby and changes the case of untrusted strings in ISO-8859 or Windows-125x encodings. Veria Labs reports that default Rails and classic-style Sinatra reach the flaw, and that plain Rack does not. Self-hosted products that bundle Ruby, including GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot, were still affected in their latest releases on November 19, 2026.

Ruby seriesAffectedFixed in
4.04.0.0 to 4.0.94.0.10
3.43.4.0 to 3.4.123.4.13
3.33.3.13 and earlier3.3.14
3.2 and olderEnd of life, no fixNone

Researchers say the vulnerable code dates to Ruby 2.4.0. Fixed builds in distribution packages and bundled products may differ from upstream, so check your vendor’s advisory before patching.

Is Ruby2Shell exploitable? What is proven so far

  • Real applications may be exposed. Ruby’s maintainers know of RCE proofs of concept for five of the seven flaws fixed in this release, including this one.
  • Exploitation is not trivial. Turning a one-byte overflow into code execution typically takes heap grooming and per-target tailoring, and failed attempts crash the process. The Rails code path has not been disclosed. Some analysts argue the practical risk is lower than the headlines suggest.
  • No reported exploitation yet. As of November 19, 2026, no attacks have been reported. Veria Labs plans to publish its own proof of concept about a week after disclosure, so treat the quiet period as short.

Why version checks miss Ruby2Shell exposure

  • The runtime is often invisible. Ruby comes from OS packages, version managers, container base images and bundled products. A product’s version is not the version of the Ruby inside it.
  • Distribution packages can hide a fix. Linux distributions may ship the fix as a patched package without changing the Ruby version number.
  • Dependency scanners miss it. The flaw is in the interpreter, not in a library.

Map findings by CVE-2026-132825, and use Ruby version, bundled-product status and internet exposure as secondary filters for prioritization.

How to find Ruby2Shell exposure with ArmorCode

Query by CVE with Anya

Start with Anya, ArmorCode’s AI security champion, where you can ask targeted questions such as:

  • Am I impacted by CVE-2026-132825?
  • Show me all applications, services, and workloads exposed to CVE-2026-132825.
  • Am I vulnerable to the Ruby2Shell vulnerability (CVE-2026-132825)?

Triage in the Findings view

  • Apply this filter on the Findings page to get the same results using AQL: cve IN (‘CVE-2026-132825’) AND status NOT IN (‘MITIGATED’)

How to fix Ruby2Shell: upgrade Ruby and restart

Ruby lists no workaround. The fix is to upgrade the interpreter.

  1. Inventory every Ruby runtime, including OS packages, version managers, container images and Ruby bundled in self-hosted products. Start with internet-facing Rails and Sinatra applications.
  2. Upgrade and restart. Move to Ruby 3.3.14, 3.4.13 or 4.0.10. Rebuild container images, update Dockerfiles and .ruby-version files, and restart every Ruby process. A Puma phased restart does not apply a runtime upgrade.
  3. Leave end-of-life Ruby. Ruby 3.2 and older will not receive a fix. Move to a supported series.
  4. Handle self-hosted products separately. Install the vendor’s fixed release when it ships. Until then, make the server private, for example behind a VPN or an IP allowlist.
  5. Watch for signs of attempts. found no published indicators of compromise. Likely signals, inferred from the bug type, are repeated Ruby worker crashes and Ruby processes spawning shells. These are leads, not proof.

  • What it is: Ruby2Shell (CVE-2026-132825) is a critical one-byte heap overflow in Ruby’s string case conversion. Ruby’s maintainers know of proofs of concept that trigger remote code execution (RCE) in some scenarios.
  • Who is affected: Ruby 3.3.13 and earlier, 3.4.0 to 3.4.12, and 4.0.0 to 4.0.9, including default Rails and classic-style Sinatra apps and self-hosted products that bundle Ruby.
  • How to fix it: Upgrade to Ruby 3.3.14, 3.4.13 or 4.0.10 and restart every Ruby process. Ruby 3.2 and older get no fix.
  • How to find your exposure: Search by CVE ID in ArmorCode with Anya or the “Ruby2Shell Nov 2026” view. Bundled runtimes and backported packages make version-only queries unreliable.

References