Ruby2Shell (GHSA-34m4-m9fh-gqp5, CVE-2026-132825): Patch Ruby Now

Rescana advisory card: Ruby fixes seven regular expression and case conversion flaws, including Ruby2Shell (GHSA-34m4-m9fh-gqp5, CVE-2026-132825). Patch now.

Status: On November 18, 2026, the Ruby project released Ruby 4.0.10, 3.4.13 and 3.3.14 to fix seven vulnerabilities in its regular expression engine and in string case conversion. Ruby says it is "aware of PoCs that prove some of them can be used to trigger remote code execution" and that it "strongly recommend[s] upgrading". The flaw that Veria Labs calls Ruby2Shell, GHSA-34m4-m9fh-gqp5, carries a Critical severity in its GitHub Security Advisory (GHSA). The GHSA gives no score. MITRE, the CVE Numbering Authority (CNA), scores its CVE record 7.4 (High) under CVSS 3.1 with a local attack vector; the section on severity below explains the gap. Affected are Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Ruby 3.2 and earlier are end of life and will not receive these fixes. Ruby2Shell now has a CVE record, CVE-2026-132825, which is not in CISA's Known Exploited Vulnerabilities (KEV) catalog (catalogVersion 2026.11.18, checked 13:30 EST on November 19, 2026). The other six advisories have no CVE yet, and none of the seven is listed in that catalog. Nothing in the sources we checked reports exploitation in the wild, but public research on the attack path and a public crash reproduction are now out, so treat the Ruby2Shell flaw as one to patch now. The fixed releases are published and downloadable from ruby-lang.org, so this is a patch-now advisory. We last checked all sources at 13:30 EST on November 19, 2026.

Executive Summary

Ruby's advisory covers seven GitHub Security Advisories (GHSAs). Two concern string case conversion and five concern regular expressions. Ruby says PoCs prove remote code execution is possible "in some scenarios" for most of them. It has not published those PoCs.

Two groups matter most for typical web applications:

  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) is a one-byte heap buffer overflow when Ruby changes the case of a string in some single-byte encodings, such as ISO-8859-1 and Windows-1252. Veria Labs, the security firm that published the Ruby2Shell write-up, says it is "Reachable without authentication in the default configuration of common Ruby web frameworks and self-hosted software," naming Rails and classic-style Sinatra. It says UTF-8 strings are not affected and that the bug has been present since Ruby 2.4.0.
  • The regular expression flaws: four of the five need an application that compiles or matches patterns built from attacker-controlled strings, according to Ruby. That is a narrower condition, but it is the same kind of bug that, in October, GitLab found could be used for remote code execution on its own servers.

Veria Labs says it will publish a proof of concept in a week, "once people have had time to upgrade," and Astra Security, another security vendor, says a public PoC is planned about a week after disclosure. That week is no longer a safe margin. On November 19, the researcher who says he found the bug published a write-up describing how a default Rails application reaches it before authentication, and, according to Astra Security, independent researchers have published a verified crash reproduction. We link neither. Upgrade, rebuild and restart now.

Who should act first (Rescana guidance). Teams running internet-facing Rails or classic-style Sinatra applications, teams running self-hosted products that ship their own Ruby, and anyone still on Ruby 3.2 or older, which Ruby will not fix.

Technical Information

The seven advisories. Severity and weakness as shown on each GHSA page, which lists no CVSS score.

GHSA Issue (Ruby's title) GHSA severity CWE Condition stated by Ruby
GHSA-34m4-m9fh-gqp5 Heap buffer overflow in case conversion of strings Critical CWE-193 Changing the case of a crafted string
GHSA-7x2q-68qv-6p8x Double free in regular expression compilation Critical CWE-415 Compiling attacker-controlled patterns
GHSA-3p8q-wmhx-vm2w Heap buffer overflow in regular expression compilation Critical CWE-190 Compiling attacker-controlled patterns
GHSA-87fm-7w84-j2px Integer overflow in case conversion of strings High CWE-190 Case conversion whose result exceeds 4 GiB
GHSA-wpqw-5qxg-m68r Out-of-bounds read in case-insensitive regular expression matching High CWE-125 Patterns built from attacker-controlled strings
GHSA-7whj-cfh7-xgm4 Heap buffer overflow in Regexp#to_s High CWE-787 Compiling attacker-controlled patterns
GHSA-pvgc-g7gj-pv6h Out-of-bounds read in case-insensitive backreference matching Moderate CWE-125 Matching a crafted string; memory disclosure or crash

How Ruby2Shell works, as published. The GHSA says: "When changing the case of a string in some single-byte encodings, such as ISO-8859-1 and Windows-1252, Ruby could write one byte past the end of the output buffer." The fix, commit ruby/ruby@d582f8f, explains why: the case mapping functions of ISO-8859-x and Windows-125x "map the sharp s (0xDF) to two bytes but checked for only one byte of room in the output buffer." Veria Labs adds that the loop is reached by upcase, swapcase, downcase(:fold) and casecmp?, that the attacker controls the buffer size through the input length, and that "UTF-8 strings take a different code path and are not affected."

Why Rails and Sinatra matter. Veria Labs lists Rails and classic-style Sinatra as affected on an affected Ruby "in their default configuration," and says "Other frameworks and plain Rack" are "Not exposed by default," although "application code that upcases strings received in a legacy encoding may also be vulnerable." Veria Labs does not publish the request path. Moritz Sanft, a researcher who says in his write-up that he found the bug and that OpenAI sent the reports to the Ruby security team, has since published it for Rails: Rack's method override middleware, part of the default Rails stack, upcases the _method field of a form POST, and a multipart part can declare a legacy charset such as ISO-8859-1, so the overflow can run before any application code. We do not link that write-up. The practical reading (Rescana guidance): if you run Rails or classic Sinatra on an affected Ruby, assume you are exposed and upgrade, rather than trying to prove your request handling avoids legacy encodings.

Severity: the sources disagree. The GHSA rates GHSA-34m4-m9fh-gqp5 Critical without a score. Veria Labs lists the access needed as "Network, no authentication" for Ruby2Shell. By contrast, the CVE record that MITRE published for CVE-2026-132825 scores it CVSS 3.1 7.4 (High) with a local attack vector, CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, and classifies it as CWE-122. NVD lists the record as received, with no NVD assessment yet. Ubuntu's tracker gives it a Medium priority. Ubuntu's priority is its own triage ranking for its packages, not a CVSS score. The real disagreement is the attack vector, and it comes from where the bug sits. The overflow is in a library routine that runs only when a program converts the case of a string held in a single-byte encoding, so a score for Ruby itself cannot assume that a network request reaches it; MITRE's local vector is consistent with that; MITRE has published no rationale. Whether an attacker can reach it over the network depends on the application: if a framework or your own code tags request data as ISO-8859-1 or Windows-125x and then upcases, case-folds or compares it case-insensitively, the HTTP request is the delivery path. Veria Labs says that is the case for Rails and classic Sinatra in their default configuration, and the researcher's write-up describes the Rails path through the _method field; neither Ruby nor MITRE has changed its rating. Rescana does not adopt any of these ratings. For planning (Rescana guidance), treat internet-facing Rails and classic-style Sinatra applications on an affected Ruby as reachable until Ruby or NVD says otherwise, and rank batch jobs and internal tools that only process trusted input lower.

The CVE ID. Ruby's advisory says CVE identifiers "have been requested for these vulnerabilities but have not been assigned yet," and the GHSA record still listed no CVE ID when we checked at 13:30 EST. MITRE has since published CVE-2026-132825, at 01:34 EST on November 19. Its description matches GHSA-34m4-m9fh-gqp5 and it references that GHSA and Ruby's advisory. The CVE Program added further references to the record at 12:51 EST on November 19; MITRE's score and description did not change. GitHub's global advisory database also lists the same CVE under a separate, unreviewed entry, GHSA-8452-w857-wpmw (High, 7.4), so a scanner that reads that database may show that ID instead. We found no CVE yet for the other six GHSAs. A scanner that matches only on CVE IDs cannot flag the six GHSAs without a CVE, and gem scanners such as bundler-audit check gems rather than the interpreter, so a clean scan says nothing about those six. Track those by Ruby version until CVEs appear.

The regular expression flaws in context. On October 23, Ruby released 4.0.9, 3.4.12 and 3.3.13 to fix earlier Onigmo bugs that GitLab "found could be used for remote code execution on GitLab servers," where GitLab compiles user-supplied patterns such as those in CI configuration. Ruby said then that those bugs are reached when an application builds a regex from an attacker's string with Regexp.new, Regexp.union, Regexp.compile or interpolation such as /#{input}/. It also said Regexp.timeout "does not protect against these bugs" and that limiting pattern length does not reliably protect either. Ruby has not repeated that guidance for the November flaws, but the November regexp advisories describe the same precondition. The October precedent is worth noting: the GitLab flaw fixed in that release, CVE-2026-97229, was added to CISA's KEV catalog on October 29, six days after Ruby's October 23 release. FIRST's Exploit Prediction Scoring System (EPSS) gave CVE-2026-132825 an early score of 0.00174 (7th percentile) on November 19; treat that as an early figure that can move quickly once public research exists. Our October Ruby and GitLab regexp advisory covers that round.

Timeline (EST).

  • October 23, 2026: Ruby releases 4.0.9, 3.4.12 and 3.3.13 with the regexp fixes linked to GitLab's CVEs.
  • November 18, 2026, 17:18 EST: Commit d582f8f, the Ruby2Shell fix, is committed.
  • November 18, 2026, 18:35 EST: The v4.0.10 release is published on GitHub, listing all seven GHSAs.
  • November 18, 2026, 19:00 EST: Ruby publishes its security advisory; the 4.0.10, 3.4.13 and 3.3.14 release announcements are dated the same day.
  • November 18, 2026, 19:13 EST: GHSA-34m4-m9fh-gqp5 is published.
  • November 19, 2026, 01:34 EST: MITRE publishes CVE-2026-132825.
  • November 19, 2026: A researcher publishes a write-up describing the default Rails pre-authentication path; CrowdSec publishes a virtual-patch WAF rule for it.
  • November 19, 2026, 05:30 EST: Mastodon publishes releases 4.7.6 and 4.6.12 to update the Ruby in its Docker images.
  • November 19, 2026, 12:51 EST: The CVE Program adds references to CVE-2026-132825.
  • November 19, 2026, 13:30 EST: Veria Labs' latest update to its Ruby2Shell page when we checked, which lists Mastodon, OpenProject and the Discourse base image as fixed.

Affected Product Versions

Ruby series Affected Fixed in Support status (ruby-lang.org)
Ruby 4.0 4.0.0 through 4.0.9 4.0.10 Normal maintenance
Ruby 3.4 3.4.0 through 3.4.12 3.4.13 Normal maintenance
Ruby 3.3 3.3.13 and earlier 3.3.14 Legacy maintenance, end of life expected March 31, 2027
Ruby 3.2 and older Affected (CVE record: all versions before 3.3.14; Veria Labs: back to 2.4.0 for Ruby2Shell) No fix from Ruby End of life

Ruby's advisory and release pages cover CRuby, the ruby/ruby interpreter. They do not mention the 4.1 preview or alternative Ruby implementations. If you run Ruby from a Linux distribution, the fix will come from your distribution, possibly as a backport that keeps an older version number. Ubuntu's tracker shows its Ruby packages as "Needs evaluation" and the Debian tracker had no package status yet when we checked. Ubuntu also lists ruby3.2, ruby3.0 and older ruby2.x packages as needing evaluation, branches Ruby itself no longer fixes, so for those only your distribution's own fix counts.

How to Find Your Exposure

The steps below are Rescana guidance unless a source is named. The goal is a list of every Ruby process you run, its real interpreter version, and who can restart it.

1. Read the version from the runtime, not the host. On each server and in each container, run ruby -v as the application user, in the application directory, so version managers resolve the same interpreter the app uses. To see what the running app actually uses, log RUBY_DESCRIPTION at boot; a separate ruby -e command starts a new process and only shows what a fresh process would get. On distribution packages, a backported fix can still report the old upstream version, so confirm the package as in step 4. Compare against the table above.

2. Check version managers and pinned versions. On hosts using rbenv or RVM, list every installed interpreter (rbenv versions, rvm list), because one host can carry several. In repositories, search for .ruby-version files, the ruby line in Gemfile, and the RUBY VERSION section of Gemfile.lock. These tell you what each app expects and where a bump is needed.

3. Check container images. List image tags and base images in your registries, Dockerfiles and Kubernetes manifests. An image tag such as ruby:3.4 floats, so resolve the digest and run ruby -v inside it. The Docker official ruby image build definitions already list 3.3.14, 3.4.13 and 4.0.10, but that is a build definition, not proof a tag you pull has been rebuilt; docker buildx imagetools inspect ruby:3.4 shows the digest a tag points to now. A running pod keeps its old image until you rebuild and redeploy. Official images compile Ruby from source, so an SBOM scan (for example Syft or Trivy) may not list the interpreter; check ruby -v in the image as well.

4. Check OS packages. Use dpkg -l 'ruby*' on Debian and Ubuntu or rpm -qa 'ruby*' on RPM based systems, then check your distribution's tracker for CVE-2026-132825 and the GHSA IDs. To confirm a backport, read the package changelog: apt changelog libruby3.3 | grep -E 'CVE-2026-132825|GHSA-' on Debian and Ubuntu (use your libruby package name), or rpm -q --changelog ruby-libs | grep CVE-2026-132825 on RHEL and its rebuilds, where dnf module list ruby shows the Ruby stream you run. On Alpine, apk info -v ruby ruby-libs gives the installed version to compare with the Alpine tracker. A backported fix may not change the version ruby -v prints.

5. Find bundled interpreters. Self-hosted products can ship their own Ruby outside the system path, so the system ruby -v says nothing about them. Search for every ruby executable on hosts and appliances you manage, and ask each vendor which Ruby its current release bundles.

6. Confirm the process, not the file. Puma, Unicorn, Passenger and Sidekiq workers are long-lived. After an upgrade, a running process still uses the old interpreter until restarted. Debian and Ubuntu packages and the Docker official images load Ruby from a shared libruby library (the official image build configures Ruby with --enable-shared), so check loaded libraries, not just the executable: grep -l 'libruby.*(deleted)' /proc/[0-9]*/maps, run as root, lists processes still mapped to a replaced library, and needrestart (Debian and Ubuntu) or dnf needs-restarting (RHEL) reports the same. A /proc/<pid>/exe link marked (deleted) covers statically linked builds.

7. Rank by reachability. Put internet-facing Rails and classic Sinatra apps first, per Veria Labs. Next, any app that builds regular expressions from user input; search code for Regexp.new, Regexp.union, Regexp.compile and #{ inside regex literals. Then any code that calls force_encoding or encode with ISO-8859 or Windows-125x encodings before upcase, swapcase, downcase(:fold) or casecmp?. A search that finds nothing is not proof: a string can also get a single-byte encoding from a charset in an email or request header, from Encoding.default_external or Encoding.default_internal (including RUBYOPT=-E), or from IO#set_encoding on files and imports.

Workaround and Mitigation

Upgrade is the fix. Ruby's recommended action is to upgrade to 4.0.10, 3.4.13 or 3.3.14. Ruby's advisory, the GHSA and Veria Labs publish no workaround for Ruby2Shell.

How to roll it out (Rescana guidance).

  1. Bump the patch release within your series. 4.0.x to 4.0.10, 3.4.x to 3.4.13, 3.3.x to 3.3.14. Patch releases within a series are the lowest-risk change; run your test suite, then deploy.
  2. Rebuild images, then redeploy. Rebuild on a fixed base image, update the .ruby-version and Gemfile pins, and redeploy every service that uses the image, including background workers and cron jobs.
  3. Restart every Ruby process and verify the RUBY_DESCRIPTION the running app logs at boot, as in steps 1 and 6.
  4. Plan off Ruby 3.2 and older now. Ruby will not fix them. If a distribution supports your package, follow its advisory; otherwise move to 3.3.14 or later.
  5. Self-hosted products: install the vendor's fixed release when it ships; do not swap the interpreter inside a vendor package yourself unless the vendor documents it.

If you cannot upgrade today (Rescana guidance, not a fix). These reduce exposure; they do not remove the bug. Restrict internet access to affected Rails and classic-style Sinatra apps where you can, for example behind a VPN or allowlist; Astra Security suggests the same. Stop compiling regular expressions from untrusted input; Ruby gave that advice for the October regexp bugs, and the November regexp advisories describe the same condition. Watch for repeated worker crashes or segfaults in Ruby processes, which may indicate memory corruption attempts. Do not count on Regexp.timeout as protection; Ruby said in October that it does not protect against those regexp bugs. CrowdSec has published a virtual-patch WAF rule for the Rails _method path (crowdsecurity/vpatch-CVE-2026-132825), which blocks a POST whose _method field holds 21 or more 0xDF bytes. It does not cover other fields your own code upcases, a multipart part with no Content-Disposition header, or the related integer overflow (GHSA-87fm-7w84-j2px), so treat it as a stopgap, not a fix.

Indicators of Compromise

Ruby, Veria Labs and Astra Security publish no indicators of compromise or network signatures, and no source we checked reports attacks using these flaws. Useful signals in the meantime (Rescana guidance): segmentation faults or unexpected worker restarts in Puma, Unicorn, Passenger or Sidekiq logs, and containers exiting with code 139 (SIGSEGV, 128+11: on a segmentation fault Ruby's crash handler prints its [BUG] report and then re-raises the signal) or 134 (SIGABRT, 128+6: glibc aborts on a detected double free, and Ruby's internal [BUG] checks end in an abort); Ruby crash reports, which start with a [BUG] line on the process error output, mentioning case conversion or regexp functions; and unexpected child processes, such as shells or download tools, spawned by Ruby application users. In containers, check the restart count of each pod and the logs of the previous container, because a crashed worker may be replaced before anyone reads its error output. A host detector for the seven bugs was merged on November 19 into Semgrep's public detection-scripts repository (pull request 16); we have not tested it, so review any script before you run it. We will update this advisory if Ruby or the researchers publish indicators of compromise.

Third-Party Risk (TPRM) Angle

Ruby can run at your suppliers where you cannot see it: SaaS products built on Rails, and self-hosted products that bundle their own Ruby, such as code hosting, community forums, customer support desks and project management tools. Veria Labs says several popular self-hosted products have bundled an affected Ruby. Since our first check, Mastodon has released 4.7.6 and 4.6.12 to update the Ruby in its Docker images, and Veria Labs lists OpenProject 17.9.8 and Discourse's base image 2.0.20261119-0203 as fixed. We attribute the OpenProject and Discourse status to Veria Labs only. Veria Labs still lists GitLab, GitHub Enterprise Server and Chatwoot as bundling an affected Ruby in their latest releases. Check your vendor for its fixed version rather than assume one.

The suppliers to ask first (Rescana guidance):

  • SaaS providers built on Rails or Sinatra that handle your data or logins.
  • Vendors whose self-hosted products you run, where the bundled Ruby only changes when the vendor ships a release.
  • Managed service providers and development agencies that build or host Ruby applications for you.

Send these four questions (Rescana guidance):

  1. For each service that handles our data, which Ruby does the running process report (RUBY_DESCRIPTION), and what image digest or distribution package version is behind it?
  2. On what date were all web, worker and scheduled-job processes restarted on Ruby 4.0.10, 3.4.13 or 3.3.14, or on a distribution package whose changelog names the fix?
  3. For products you ship that bundle Ruby, which release carries the fix, when, and can you provide an SBOM showing the bundled Ruby version?
  4. Do you run Ruby 3.2 or older anywhere in those services, and who supplies fixes for all seven GHSAs, not only the one with a CVE?

Ask for evidence, not reassurance: the RUBY_DESCRIPTION reported by the running process after the restart, the package changelog entry where a distribution backport is used, and the deploy date. With the default-Rails attack path already public, set a short follow-up date and record each answer.

What to do internally: inventory every Ruby runtime and its real version today, upgrade and restart internet-facing Rails and classic-style Sinatra apps first, rebuild container images, move off Ruby 3.2 and older, and chase vendors for bundled-Ruby fixes now. We will update this advisory as CVE IDs and vendor fixes are published.

Need help working out which suppliers run Ruby applications that handle your data? Our team can help you prioritize them and track their answers. Talk to an expert

Sources

Talk to an expert

Talk to Rescana about this advisory — or about how we help TPRM teams keep reviews moving.