Skip to content

+Threat Wire · Reference

ruby2shell: heap overflow in Ruby string case conversion

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.

Prioritize patchingCVE-2026-132825Checked Nov 19

What it means for your AI agents

Agent backends, MCP servers and webhook receivers are usually built on these runtimes and libraries. A flaw that runs code before authentication hands an attacker the agent's keys and tool access, not just the server.

  • Check the services behind your agents and MCP tools, including ones that only call outward.
  • Look for the affected component in dependencies too, not just the runtime you installed directly.
  • Until patched, treat output from an affected service as untrusted input to your agents.

Updates

  • Nov 19, 2026 : Discourse moved its Docker base image to Ruby 4.0.10 ; Docker installs fix the flaw by rebuilding.
  • Nov 19, 2026 : Ruby published GHSA-34m4-m9fh-gqp5 and released fixes in Ruby 3.3.14, 3.4.13 and 4.0.10 .

Details

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). MITRE assigned it CVE-2026-132825 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.

Risk

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.

Affected deployments

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.

Evidence and sources6 links

GitHub advisory GHSA-34m4-m9fh-gqp5

Ruby's advisory with affected and fixed versions, severity and credits.

GHSA-34m4-m9fh-gqp5

Ruby security advisory, November 18, 2026

Covers this flaw and six related flaws fixed in the same releases.

ruby-lang.org advisory

Ruby fix commit

Lists the ISO-8859 and Windows-125x encodings changed by the fix.

ruby/ruby@d582f8f

Discourse Docker update

Moves the Discourse base image to Ruby 4.0.10 and makes it the default, on November 19, 2026.

Update Ruby to 4.0.10

Bump default base image

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.

Veria Labs: ruby2shell

Check your exposure with an agent

Paste this into an AI agent that can see your infrastructure. It asks for a read-only check of what's affected, including the systems behind your agents, and a table you can act on. Copying it changes nothing.

Prompt
Assess whether the infrastructure you can access is affected by ruby2shell: heap overflow in Ruby string case conversion (CVE-2026-132825). Work read-only within your authorized access: do not run exploits, change configuration, restart services or install anything.

1. Confirm the affected and fixed versions from the vendor advisories and CVE records:
   - https://www.ruby-lang.org/en/news/2026/11/18/ruby-4-0-10-released/
   - https://www.ruby-lang.org/en/news/2026/11/18/ruby-3-4-13-released/
   - https://www.ruby-lang.org/en/news/2026/11/18/ruby-3-3-14-released/
   - https://github.com/discourse/discourse_docker/commit/59dacaecae5797991783ab357a86a573bb82a222
   - https://github.com/ruby/ruby/security/advisories/GHSA-34m4-m9fh-gqp5
   - https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/
   Cite each source and the date you read it. Say plainly what you could not verify.

2. Inventory the systems that could run the affected software, including the hosts, containers, MCP servers, tool runners and sandboxes behind any AI agents. For each, record the asset, environment, owner if known and the version actually running, from read-only evidence (package metadata, version commands, platform inventory).

3. Note which affected systems are reachable from the internet or from agents and tools, and which credentials (model-provider keys, tool tokens, service accounts) are stored on them.

4. Report one row per asset: asset, running version, affected (yes / no / unknown), reachable from, credentials at risk, evidence, and the next step. List anything you could not access as a gap rather than assuming it is safe.

More from the Threat Wire

Briefing source: Cloudflare Radar Zero Wire (Cloudforce One), last checked November 19, 2026. Refreshed here every 30 minutes.