A one-byte heap overflow when Ruby changes the case of strings in some single-byte encodings, such as ISO-8859-1 and Windows-1252, may let an attacker run code.
Dernière révision
Mises à jour
Discourse moved its Docker base image to Ruby 4.0.10 (s'ouvre dans un nouvel onglet); Docker installs fix the flaw by rebuilding.
Ruby published GHSA-34m4-m9fh-gqp5 (s'ouvre dans un nouvel onglet) and released fixes in Ruby 3.3.14, 3.4.13 and 4.0.10 (s'ouvre dans un nouvel onglet).
Vue d'ensemble
Détails
When Ruby upcases the German sharp s (ß) in some single-byte encodings, it writes two bytes, SS, but checks for room for only one. The Ruby fix commit changes 14 ISO-8859 and Windows-125x encodings, including ISO-8859-1 and Windows-1252. Veria Labs reports that upcase, swapcase, downcase(:fold) and casecmp? reach the bug. It says a string with 21 sharp s characters overflows the output buffer by one byte. UTF-8 strings take a different code path and are not affected, according to Veria Labs.
Ruby rates the flaw critical and published it as GHSA-34m4-m9fh-gqp5 on November 19, 2026 (UTC). A CVE has been requested and was not assigned on November 19, 2026. Ruby credits Stephan Lipp (Ada Logics) and Anthropic for reporting it.
Veria Labs reports that Rails and classic-style Sinatra reach the bug in their default configuration, and that other frameworks and plain Rack are not exposed by default. Application code that changes the case of strings received in a legacy encoding may also be affected. As of November 19, 2026, Veria Labs says it will publish a proof of concept in a week. No source reviewed on November 19, 2026 reports exploitation in the wild. Neither Ruby nor Veria Labs lists a workaround or mitigation other than upgrading Ruby.
The same Ruby releases fix six other memory safety flaws in the regular expression engine and string case conversion, several of which Ruby also says may allow code execution.
Risque
The Ruby team is aware of proofs of concept achieving code execution in some scenarios. Veria Labs reports that default Rails and classic Sinatra apps reach the overflow without authentication.
Déploiements affectés
Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Veria Labs reports the bug has been present since Ruby 2.4.0. Ruby says that Ruby 3.2 and earlier have reached end of life and will not receive the fix.
As of November 19, 2026 at 08:30 UTC, Veria Labs lists these self-hosted products as bundling an affected Ruby in their latest release: GitLab 19.6.0 (Ruby 3.3.13), GitHub Enterprise Server 3.22.5 (4.0.9), Mastodon 4.7.5 (4.0.9), OpenProject 17.9.7 (4.0.9), Discourse 2026.10.1 and Chatwoot 4.20.0 (3.4.4). Veria Labs gives Ruby 3.4.7 for Discourse, but the Discourse Docker image used Ruby 4.0.9 before Discourse moved it to the fixed 4.0.10 on November 19, 2026. For products installed from source, the Ruby version is the one the operator installed.
Action recommandée
Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10 and restart Ruby processes. For self-hosted products that bundle Ruby, install the vendor's update; several had none on November 19, 2026.
Find every Ruby runtime you run, including container images and self-hosted software that bundles Ruby, and record the version of each running process. For distribution packages, check the full package version against the distribution's advisory, since a backported fix may keep the old version number.
Upgrade Ruby to 3.3.14, 3.4.13 or 4.0.10. Move applications on Ruby 3.2 or earlier to a supported series, because those releases will not be fixed.
Rebuild Discourse Docker installs from the latest discourse_docker, which moved the base image to Ruby 4.0.10 on November 19, 2026.
Install the vendor release that updates Ruby for GitLab, GitHub Enterprise Server, Mastodon, OpenProject and Chatwoot once it is out; none was available on November 19, 2026, so follow each vendor's security advisories.
Restart application servers and background workers, then verify that each running process reports a fixed Ruby version.
Utilisez cette invite avec un agent capable d'inspecter votre infrastructure.
Assess whether the Ruby applications and self-hosted software I am authorized to inspect are affected by GHSA-34m4-m9fh-gqp5, a heap buffer overflow in Ruby string case conversion. Use the GitHub advisory GHSA-34m4-m9fh-gqp5 and the ruby-lang.org security advisory of November 18, 2026 as authoritative sources for affected and fixed versions. For each host, container image or application, collect the Ruby version of the running process (not only the one on the PATH), the framework and version (for example Rails or Sinatra), and for bundled software such as GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse or Chatwoot, the product version and its bundled Ruby version. Report each as affected, fixed or unknown, with the evidence, and list anything you could not access. Work read-only: do not change configuration, restart services or send exploit input. Find more information and resources at https://radar.cloudflare.com/zero-wire/ruby2shell
Evidence and sources
GitHub advisory GHSA-34m4-m9fh-gqp5
Ruby's advisory with affected and fixed versions, severity and credits.
Ruby security advisory, November 18, 2026
Covers this flaw and six related flaws fixed in the same releases.
Ruby fix commit
Lists the ISO-8859 and Windows-125x encodings changed by the fix.
Discourse Docker update
Moves the Discourse base image to Ruby 4.0.10 and makes it the default, on November 19, 2026.
Veria Labs: ruby2shell
Root cause, affected frameworks and a table of self-hosted software, which Veria Labs updated on November 19, 2026 at 08:30 UTC.