Ruby2Shell (GHSA-34m4-m9fh-gqp5) is a one-byte heap buffer overflow in Ruby’s string case conversion that may let an attacker run code in a Ruby application that changes the case of text it receives. Stephan Lipp (Ada Logics) and Anthropic reported it, and Ruby fixed it in 4.0.10, 3.4.13 and 3.3.14 on November 18, 2026. Ruby rates it critical and says it is aware of proofs of concept that reach remote code execution in some scenarios. A CVE has been requested and is not assigned yet.
Key highlights
- What it is: an off-by-one heap write when Ruby changes the case of a string in a single-byte encoding such as ISO-8859-1 or Windows-1252.
- Severity: critical (Ruby). No CVSS score published.
- Affected: Ruby 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, 3.3.0 to 3.3.13 and every release from 2.4 to 3.2.
- Trigger: case conversion (
upcase,swapcase,capitalize,downcase(:fold),casecmp?) of attacker-supplied text in an affected encoding. UTF-8 strings are not affected. - Fix: Ruby 4.0.10, 3.4.13 or 3.3.14.
- Stopgap: none published.
- Exploitation: Ruby reports proofs of concept that reach code execution. It does not report exploitation in the wild.
The bug
For the German sharp s (ß), case conversion writes two bytes but the loop checked room for only one, so a string with enough of them writes one byte past the output buffer. The fix changes that check in 14 ISO-8859 and Windows-125x encoding files.
Who is exposed
A Ruby process is exposed when it runs an affected version and changes the case of text an attacker controls while that text is tagged with one of the affected single-byte encodings. Ruby 3.2 and older are end of life and get no fix, but they carry the same code back to Ruby 2.4.0.
Fix status
| Source | Status | Builds |
|---|---|---|
| Ruby 4.0 | Fixed | 4.0.10 |
| Ruby 3.4 | Fixed | 3.4.13 |
| Ruby 3.3 | Fixed | 3.3.14 |
| Ruby 2.4 to 3.2 | No fix planned | end of life |
Official Docker ruby image | Fixed | 4.0.10, 3.4.13, 3.3.14 tags, November 19 |
GitHub Actions ruby/setup-ruby | Fixed | v1.342.0 and @v1 install the fixed versions |
| Debian, Ubuntu, Alpine, RHEL | No advisory yet |
How to check
- Run
ruby -vin each image or host. For a container image:docker run --rm --entrypoint ruby <image> -v. - Search repositories for
FROM ruby:lines,ruby-version:in GitHub Actions workflows and.ruby-versionfiles with a version in the affected range. - Ask vendors of self-hosted software that ships its own Ruby which release includes the fix.
How Cycode helps
Three items on the Threat Intelligence dashboard query the Context Intelligence Graph:
- GitHub Actions setup-ruby: workflow steps that install an affected Ruby, including short versions such as
3.4whenruby/setup-rubyis pinned tov1.341.0or older. - Dockerfile base images: Dockerfiles on an affected tag of the official
rubyimage or a CircleCI or Bitnami Ruby image. Short tags such asruby:3.4are not listed. - Image runtimes: scanned container images with an affected Ruby interpreter, compiled in or installed from a distribution package. The count is the number of image repositories.
What to do
- Upgrade to Ruby
4.0.10,3.4.13or3.3.14and rebuild every image that bundles Ruby, including images built from short tags before November 19. - Move applications on Ruby 3.2 or older to a supported line.
- Update
ruby/setup-rubypins tov1.342.0or later. - Install the fixed release of any self-hosted product that ships its own Ruby once its vendor publishes one.
Sources
- Ruby security advisory, November 18, 2026
- GHSA-34m4-m9fh-gqp5
- Fix commit d582f8f
- Ruby 4.0.10, 3.4.13, 3.3.14 release notes
- ruby/setup-ruby v1.342.0