Vulnerability DatabaseCVE-2026-132825

CVE-2026-132825: 
Ruby vulnerability analysis and mitigation

Overview

CVE-2026-132825 (community name: "ruby2shell") is a heap-based buffer overflow vulnerability in Ruby's string case conversion functionality. When converting the case of a string encoded in certain single-byte encodings such as ISO-8859-1 or Windows-1252, Ruby can write one byte past the end of a heap-allocated output buffer. The vulnerability affects Ruby before 3.3.14, Ruby 3.4.0–3.4.12, and Ruby 4.0.0–4.0.9. It was disclosed on November 18–19, 2026, with patches released simultaneously. The CVSS v3.1 base score is 7.4 (High) (Github Advisory, Ruby Advisory).

Technical details

The root cause is classified as CWE-122 (Heap-based Buffer Overflow) and CWE-193 (Off-by-One Error). The vulnerable loop in case_map() across 14 single-byte encoding files (e.g., enc/iso_8859_1.c) checks only for one byte of output room (to < to_end) before processing the German sharp-s character (ß, 0xDF), which expands to two bytes ("SS" under upcase). When the final loop iteration enters with exactly one byte of buffer space remaining, the second byte of the expansion is written one byte past the end of the mapping_buffer allocated by rb_str_casemap(). The allocation geometry is R = N + 44 bytes for an N-byte input, and the one-byte overflow lands on the adjacent glibc chunk's size field LSB only when the request size satisfies R ≡ 8 (mod 16) — requiring a carefully crafted mixed input (e.g., 20 × 0xDF + 7 × 'a' + 1 × 0xDF). The fix changes the loop guard to to_end - to > 1 (commit d582f8f13d70). A related advisory (GHSA-87fm-7w84-j2px) covers a separate integer overflow in the same code path for strings whose case-converted result exceeds 4 GiB (Ruby Advisory, PoC Repo).

Impact

Successful exploitation can result in high confidentiality, integrity, and availability impact. The one-byte heap metadata corruption can be leveraged to manipulate glibc chunk size fields, potentially enabling heap exploitation primitives that lead to arbitrary code execution. The Ruby project's own advisory states awareness of PoCs that prove the flaw can trigger RCE in some scenarios, particularly in web frameworks like Rails and Sinatra where attacker-controlled strings (e.g., multipart Content-Type charset fields or _method override parameters) may be passed through case conversion operations. Ruby ≤ 3.2 (including macOS system Ruby 2.6.10) is EOL and will not receive a patch, leaving those deployments permanently exposed (Ruby Advisory, Github Advisory).

Exploitability

Public PoC code is available on GitHub demonstrating ASAN crashes and glibc chunk-header corruption on stock glibc 2.31, though no complete end-to-end RCE chain has been publicly demonstrated as of disclosure (PoC Repo). The EPSS score is approximately 1.976% (81st percentile), indicating elevated exploitation probability relative to most CVEs (Github Advisory). The NVD SSVC assessment lists exploitation as "none" at time of publication, and there is no confirmed in-the-wild exploitation or CISA KEV catalog listing as of the report date. Veria Labs announced a public PoC release window approximately one week after disclosure (~November 26, 2026). The attack vector is local (AV:L) with high complexity (AC:H), as exploiting the heap primitive on glibc requires precise allocation geometry and ASLR bypass or disabled ASLR (PoC Repo, oss-security).

Exploitation steps

  1. Identify target: Locate a Ruby application (version < 3.3.14, 3.4.0–3.4.12, or 4.0.0–4.0.9) that passes attacker-controlled strings through case conversion (String#upcase, #downcase, #swapcase, or #capitalize) with ISO-8859-x or Windows-125x encoding. In web contexts, Rails/Rack multipart Content-Type charset fields or _method override parameters are candidate vectors.
  2. Craft the trigger payload: Construct an ISO-8859-1 encoded string with the geometry ("\xDF" * 20 + "a" * 7 + "\xDF").force_encoding("ISO-8859-1"). This produces a malloc request of R=72 bytes (≡ 8 mod 16), ensuring the one-byte overflow lands on the adjacent glibc chunk's size field LSB rather than alignment slack.
  3. Trigger case conversion: Submit the crafted string to the vulnerable code path (e.g., via an HTTP request with a crafted multipart body or _method field). The upcase call expands the trailing ß to "SS", writing 0x53 one byte past the allocated buffer onto the next chunk's size field.
  4. Observe heap corruption: On glibc 2.31 without safe-linking, the next chunk's size field LSB is overwritten with 0x53, changing its size class and setting the IS_MMAPPED bit — a controllable heap metadata corruption primitive.
  5. Escalate to RCE (research-stage): With ASLR disabled or bypassed, use the heap primitive to place a fake heap-String RVALUE pointing to __free_hook, overwrite __free_hook with system, and trigger GC to free a heap string whose buffer begins with a shell command. This chain has been partially verified (victim-array smash confirmed) but full end-to-end execution has not been publicly demonstrated (PoC Repo, Ruby Advisory).

Indicators of compromise

  • Process: Ruby worker processes crashing with Segmentation fault at 0x0 inside String#upcase-family frames (rb_str_upcase, rb_str_casemap); ASAN-instrumented builds reporting heap-buffer-overflow WRITE of size 1 at enc/iso_8859_1.c or enc/windows_1252.c.
  • Network: HTTP requests containing multipart bodies with Content-Type charset values set to ISO-8859-1 or Windows-1252 combined with field values containing repeated 0xDF bytes (ß); unusual _method override fields in POST requests containing high-byte characters.
  • Logs: Repeated Ruby process crashes or restarts in application server logs (Puma, Unicorn, Passenger) without clear application-level errors; ArgumentError: negative string size or input string invalid errors in Ruby logs (may indicate related GHSA-87fm-7w84-j2px probing).
  • File System: Unexpected files or scripts written to the application directory following Ruby process crashes; new cron jobs or scheduled tasks created under the Ruby application service account.
  • Memory/Heap: Malloc tracer output showing chunk size field changes from expected values to values with 0x53 or 0x73 LSB (e.g., 0x501 → 0x553) adjacent to 72-byte allocations from rb_str_casemap (PoC Repo).

Mitigation and workarounds

Upgrade Ruby to the patched versions: 3.3.14, 3.4.13, or 4.0.10, which fix the vulnerable loop guard in case_map() (commit d582f8f13d70). Ruby ≤ 3.2 is EOL and will not receive an upstream patch — deployments on these versions should migrate to a supported branch or isolate the affected systems. As a temporary workaround, apply WAF rules to block or alert on multipart requests with ISO-8859-x or Windows-125x charset declarations containing high-byte characters; Cloudflare deployed emergency WAF rules, and CrowdSec published virtual patching rules for this purpose. Rebuild and redeploy container images based on patched Ruby versions. Vendor patches are also available from Red Hat (RHSA-2026:102714 and related), SUSE (SUSE-SU-2026:5413-1), AWS (AL2023/AL2027 advisories), and GitLab (patch release 19.6.1) (Github Advisory, Ruby Advisory).

Community reactions

The Ruby project credited Stephan Lipp (Ada Logics) and Anthropic for reporting the vulnerability, and stated awareness of PoCs proving RCE is possible in some scenarios (Ruby Advisory). The vulnerability was dubbed "ruby2shell" by the community and received significant media coverage from The Hacker News, SecurityWeek, Imperva, Orca Security, and Heise, with many outlets noting the RCE potential for Rails and GitLab deployments. Cloudflare deployed emergency WAF rules and published a blog post on protection measures, while CrowdSec released virtual patching rules. Independent researcher commentary (Sekurak) expressed skepticism about stable RCE, rating DoS as more likely given the non-trivial heap geometry required — consistent with the PoC repository's own findings that pure ß-run triggers are absorbed by glibc alignment slack. GitLab shipped an emergency patch release (19.6.1) and AWS, Red Hat, and SUSE all issued security advisories within days of disclosure (oss-security, PoC Repo).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

ruby3.1: 3.1.7-1~deb12u2

Fixed

sid

ruby3.3

Affected

trixie

ruby3.3: 3.3.14-0+deb13u1

Fixed

Ubuntu

Fixed

bionic (esm-apps)

jruby

Unknown

bionic (esm-infra)

ruby2.5: 2.5.1-1ubuntu1.16+esm9

Fixed

devel

ruby3.3

Unknown

focal (esm-apps)

jruby

Unknown

focal (esm-infra)

ruby2.7: 2.7.0-5ubuntu1.18+esm6

Fixed

jammy

ruby3.0: 3.0.2-7ubuntu2.14

Fixed

noble

ruby3.2: 3.2.3-1ubuntu0.24.04.9

Fixed

noble (esm-apps)

jruby

Unknown

RHEL / CentOS

Fixed

OpenShift

Not Affected

RHEL 8

:appstream:ruby:2.5:8100020261120150259:489197e6/rubygem-bundler-0:2.5-8100020261120150259.489197e6.src

Fixed

RHEL 9

:appstream:ruby-0:3.0.7-171.el9_9.src

Fixed

RHEL 10

ruby-0:3.3.14-17.el10_3.src

Fixed

Source: This report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-7c6x-34q5-4g2jHIGH7.5
  • Ruby logoRuby
  • websocket-driver
NoYesNov 26, 2026
GHSA-548x-44fh-cxv4MEDIUM6.1
  • Ruby logoRuby
  • dandruff
NoYesNov 26, 2026
GHSA-477m-5qf8-pjv6MEDIUM5.9
  • Ruby logoRuby
  • faye-websocket
NoYesNov 26, 2026
GHSA-qwvx-w3vv-2r28LOWN/A
  • Ruby logoRuby
  • jwe
NoYesNov 26, 2026
GHSA-9hgp-rr8g-x7cqHIGHN/A
  • Ruby logoRuby
  • jwe
NoYesNov 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management