Skip to navigation

Threat reportVulnerabilityTL-2026-6524

ruby2shell (CVE-2026-132825): One-Byte Heap Overflow in Ruby Case Conversion Could Allow RCE in Rails and Self-Hosted Apps

criticalMONITORING

CVE-2026-132825 is a one-byte heap-based buffer overflow in Ruby's string case conversion for single-byte legacy encodings (ISO-8859-x, Windows-125x): the German sharp s (0xDF) expands to 'SS' but only one output byte is reserved. Ruby 4.0.10, 3.4.13 and 3.3.14 (released 2026-11-18) fix it; the Ruby core team says non-public PoCs can trigger code execution in some scenarios, and no in-the-wild exploitation has been reported.

Key facts

IdentifiersTL-2026-6524, CVE-2026-132825
Also known asruby2shell, ruby2ßhell, GHSA-34m4-m9fh-gqp5
SeverityCRITICAL
CVSS7.4 (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)
First disclosed
Exploitation statusPublic proof-of-concept exploit for a linked CVE
EPSSCVE-2026-132825: 0.1% (8.9th percentile)
Affected productsRuby Ruby (MRI/CRuby); Ruby on Rails / Sinatra Default Rails and classic-style Sinatra applications; GitLab GitLab; GitHub GitHub Enterprise Server; Chatwoot Chatwoot; Mastodon Mastodon; OpenProject OpenProject; Discourse Discourse base image
Weaknesses (CWE)CWE-122, CWE-193
MalwareOne, Ruby
MITRE ATT&CK techniquesT1059 Command and Scripting Interpreter, T1059.004 Command and Scripting Interpreter, T1105 Ingress Tool Transfer, T1190 Exploit Public-Facing Application, T1203 Exploitation for Client Execution, T1499.004 Endpoint Denial of Service: Application or System Exploitation, T1587.004 Develop Capabilities: Exploits, T1588.005 Obtain Capabilities: Exploits, T1588.006 Obtain Capabilities: Vulnerabilities, T1595.002 Active Scanning
MotivationUNKNOWN
Target sectorstechnology, software, government administration, finance, health, education
Target regionsGlobal
Detection rules9 (1 shown free)
Sources10 cited sources

Detection coverage

As of 2026-11-20, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6524 across Splunk SPL, Microsoft KQL and Sigma, covering 23 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: ruby2shell: Ruby Worker Crash in String Case-Conversion Frames (CVE-2026-132825)

Detects a Ruby worker crash ('Segmentation fault' / [BUG] dump) whose backtrace contains the case-conversion methods reachable by the CVE-2026-132825 (ruby2shell) one-byte heap overflow: String#upcase, String#swapcase, String#downcase(:fold) and String#casecmp?. Per Veria Labs this is the primary post-factum indicator of a failed or probing exploit attempt against Rails/Sinatra or self-hosted Ruby apps (GitLab, Mastodon, Discourse, OpenProject, Chatwoot). Repeated crashes from one host warrant immediate triage and a Ruby upgrade to 3.3.14 / 3.4.13 / 4.0.10.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1499.004, T1190, T1203
  • Data sources: ruby_stderr, puma_logs, rails_production_log, container_logs
  • Severity: high
  • Confidence: high

Splunk SPL

index=app sourcetype IN ("ruby:stderr","puma:stderr","rails:production","docker:json","syslog") earliest=-24h ```CVE-2026-132825 ruby2shell: crash dump naming case-conversion frames```
| search "Segmentation fault" ("String#upcase" OR "String#swapcase" OR "String#downcase" OR "String#casecmp?" OR "rb_str_upcase" OR "rb_str_casemap" OR "rb_str_casecmp_p")
| stats count as crash_count min(_time) as first_seen max(_time) as last_seen values(sourcetype) as sourcetypes by host
| eval cve="CVE-2026-132825", technique="T1499.004"
| convert ctime(first_seen) ctime(last_seen)

Microsoft KQL

ContainerLogV2
| where TimeGenerated > ago(24h)
| where LogMessage has "Segmentation fault"
| where LogMessage has_any ("String#upcase","String#swapcase","String#downcase","String#casecmp?","rb_str_upcase","rb_str_casemap","rb_str_casecmp_p")
| summarize CrashCount=count(), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by Computer, PodName, ContainerName
| extend CVE="CVE-2026-132825"

Sigma

title: ruby2shell Ruby Crash In Case Conversion Frames CVE-2026-132825
id: 3b7f1c52-8d4e-4a6b-9c21-5e0a7d94b6a1
status: experimental
description: Detects Ruby segmentation-fault crash dumps containing String#upcase/swapcase/downcase/casecmp? frames, the post-factum indicator of CVE-2026-132825 (ruby2shell) exploitation attempts.
references:
    - https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/
    - https://nvd.nist.gov/vuln/detail/CVE-2026-132825
    - https://verialabs.com/ruby2shell/
    - https://orca.security/resources/blog/ruby2shell-ruby-heap-overflow-rce/
author: Threadlinqs Team
date: 2026/11/20
tags:
    - attack.impact
    - attack.t1499.004
    - attack.initial-access
    - attack.t1190
    - attack.execution
    - attack.t1203
    - cve.2026.132825
logsource:
    category: application
    product: ruby
detection:
    keywords_crash:
        - 'Segmentation fault'
    keywords_frame:
        - 'String#upcase'
        - 'String#swapcase'
        - 'String#downcase'
        - 'String#casecmp?'
        - 'rb_str_upcase'
        - 'rb_str_casemap'
    condition: keywords_crash and keywords_frame
falsepositives:
    - Unrelated native-extension crash that happens to be inside a case-conversion call
    - Memory-safety bugs from the six other GHSA flaws fixed in the same Ruby release (regexp compilation)
level: high

Known false positives:

  • Unrelated native-extension crashes whose backtrace happens to include a case-conversion frame
  • The other memory-safety flaws fixed in the same Ruby release (regexp compilation) can produce similar crashes
  • Developers reproducing the public ASAN crash in a lab

Tuning notes: Point the index/sourcetype list at wherever Ruby stderr and Rails/Puma logs land (Docker/K8s JSON, journald, file monitors). Alert on a single event for internet-facing apps; baseline and raise to a threshold only for dev/test. Pivot on host to the web access logs for the preceding multipart POST. Enrich with the Ruby version (fixed: 3.3.14, 3.4.13, 4.0.10); distro backports keep the old version string.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account)
  • ruby2shell: HTTP Request Declaring Legacy Single-Byte Charset (ISO-8859-x / Windows-125x) · unlock with TL Creds
  • ruby2shell: Ruby One-Liner Forcing Legacy Encoding and Case Conversion (PoC Reproduction) · unlock with TL Creds
  • ruby2shell: Endpoint Fetching Public CVE-2026-132825 Research/PoC Repository · unlock with TL Creds
  • ruby2shell: Kernel Segfault Logged for Ruby Runtime (libruby) · unlock with TL Creds
  • ruby2shell: Ruby Worker Writing Executable, Web Shell or Persistence File · unlock with TL Creds
  • ruby2shell: Reverse Shell Command Line from Ruby Process or Worker Child · unlock with TL Creds
  • ruby2shell: Ruby Application Server Spawning Shell or Downloader (Post-Exploitation) · unlock with TL Creds
  • ruby2shell: Ruby Worker Outbound Connection to Non-Standard Port (C2 / Reverse Shell) · unlock with TL Creds

Indicators of compromise

As of 2026-11-20, Threadlinqs Intelligence tracks 23 indicators of compromise for TL-2026-6524.

Sample indicators (3 of 23)

  • URL: hxxps://github[.]com/evenomn/CVE-2026-132825
  • File hash: b53eef3371fa5d3e3b74340edcd015f06d5d8853968d4e539a5264fce41ed9f1
  • File hash: 1537f7a6003c436546ecab6b48b6e7725a9af2328f45a8af7f42f41c5df90ab8

Defanged, TLP:CLEAR. Full set of 23 indicators: unlock with TL Creds.

23 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

CVE-2026-132825 (GHSA-34m4-m9fh-gqp5, nicknamed 'ruby2shell' / 'ruby2ßhell') is a heap-based buffer overflow (CWE-122, with an off-by-one component, CWE-193) in the Ruby interpreter's string case-conversion code. When a string in a single-byte encoding such as ISO-8859-1, ISO-8859-2 (and other ISO-8859 variants), Windows-1250, Windows-1252, Windows-1254 or Windows-1257 contains the German sharp s (byte 0xDF), upcasing expands it to the two characters 'SS'. The conversion loop checked for only one byte of room in the output buffer (sized at input length plus 20 bytes per Veria Labs), so a crafted string writes one byte ('S', or 's' for case-folding) past the end of a heap buffer, followed by a one-byte out-of-bounds read. UTF-8 strings take a different code path and are not affected. The reachable methods are String#upcase, String#swapcase, String#downcase(:fold) and String#casecmp?. The vulnerable code has existed since Ruby 2.4.0.

Affected versions: Ruby 4.0.0-4.0.9, 3.4.0-3.4.12, and 3.3.13 and earlier. Fixed in 4.0.10, 3.4.13 and 3.3.14, all released 2026-11-18; the fix (upstream commit d582f8f per Veria) ensures two bytes of output space are available when the sharp s is converted. Ruby 3.2 and earlier are end of life and receive no fix. Linux distributions may ship backported fixes without changing the Ruby version string. Because the bug is in the interpreter, `bundle update` does not remediate it, and there is no official workaround.

The Ruby advisory (Ruby 2026-11-18, 'multiple vulnerabilities in Regexp and String case conversion') states that changing the case of a crafted string may allow remote code execution and that the Ruby team is aware of PoCs for some scenarios; credits are Stephan Lipp (Ada Logics) and Anthropic. Veria Labs claims first demonstration of RCE and says Rails and classic-style Sinatra apps are reachable by unauthenticated requests in default configuration (plain Rack is not exposed by default); that claim is not independently confirmed by the other sources, and NVD's secondary CVSS 3.1 vector is local (AV:L/AC:H) with a base score of 7.4 HIGH, while the Ruby core team rated the issue critical. A public research write-up (evenomn/CVE-2026-132825, dated 2026-11-19) reports only a local ASAN crash reproduction on Ruby 3.4.12 and heap-metadata corruption on glibc 2.31, states a full weaponization chain was designed but not executed, and says no remote delivery path was verified. Veria plans to publish its PoC on or after 2026-11-25 if vendors have not shipped fixes, which is likely to accelerate exploitation attempts.

Self-hosted software named as exposed includes GitLab (19.6.0 and earlier, no fix listed by Veria), GitHub Enterprise Server (3.22.5 and earlier, no fix listed), Chatwoot (4.20.0 and earlier, no fix listed), Mastodon (fixed in 4.7.6, 4.6.12, 4.5.22, 4.4.29), OpenProject (fixed in 17.9.8, 17.8.3) and Discourse (base image fixed in 2.0.20261119-0203). GitLab's omnibus-gitlab bumped Ruby to 3.3.14 and 3.4.13 on 2026-11-18. The same Ruby release also fixes six further memory-safety flaws tracked only by GHSA IDs (no CVEs assigned yet): GHSA-87fm-7w84-j2px (integer overflow in case conversion, heap overflow), GHSA-7x2q-68qv-6p8x (double free in regexp compilation, critical), GHSA-3p8q-wmhx-vm2w (heap overflow in regexp compilation, critical), GHSA-7whj-cfh7-xgm4 (heap overflow in Regexp#to_s), GHSA-wpqw-5qxg-m68r (OOB read in case-insensitive matching) and GHSA-pvgc-g7gj-pv6h (OOB read in case-insensitive backreference matching). CISA SSVC (via NVD) records exploitation 'none', automatable 'no', technical impact 'total'. No threat actor, malware or network IOCs are attributed in any source. Defender-level indicators are limited to version inventory and post-factum worker crashes ('Segmentation fault at 0x0' inside String#upcase-family frames); multipart request parts declaring legacy charsets are inherently suspicious per Veria.

MITRE ATT&CK techniques by tactic:

Execution

T1059 Command and Scripting Interpreter; T1059.004 Command and Scripting Interpreter; T1203 Exploitation for Client Execution

Command and Control

T1105 Ingress Tool Transfer

Initial Access

T1190 Exploit Public-Facing Application

Impact

T1499.004 Endpoint Denial of Service: Application or System Exploitation

Resource Development

T1587.004 Develop Capabilities: Exploits; T1588.005 Obtain Capabilities: Exploits; T1588.006 Obtain Capabilities: Vulnerabilities

Reconnaissance

T1595.002 Active Scanning

Remediation

Patches

  • Ruby 4.0.10, 3.4.13, 3.3.14 (2026-11-18)
  • Mastodon 4.7.6 / 4.6.12 / 4.5.22 / 4.4.29
  • OpenProject 17.9.8 / 17.8.3
  • Discourse base image 2.0.20261119-0203
  • GitLab, GitHub Enterprise Server and Chatwoot: await vendor releases (no fix listed at time of writing)

Immediate actions

  • Upgrade the Ruby interpreter to 3.3.14, 3.4.13 or 4.0.10 (or a distro package carrying the backport); gem updates do not fix this
  • Prioritize internet-facing Rails and Sinatra apps and any Ruby service processing untrusted input
  • Inventory every Ruby runtime: OS packages, rbenv/rvm/asdf or tarball installs, Ruby bundled in self-hosted apps, and container images
  • Monitor Ruby worker crashes (SIGSEGV in String#upcase/swapcase/downcase(:fold)/casecmp? frames) and requests declaring legacy charsets

Workarounds

  • No official workaround; upgrading Ruby is the fix

Longer-term hardening

  • Migrate off EOL Ruby 3.2 and earlier to a supported branch
  • Rebuild container images on patched base images as vendors ship fixes
  • Normalize or reject non-UTF-8 request charsets at the edge where the application does not need them

Affected and fixed versions

  • Ruby — Ruby (MRI/CRuby)
    Vulnerable versions: 4.0.0-4.0.9; 3.4.0-3.4.12; 3.3.13 and earlier; 3.2 and earlier back to 2.4.0 (EOL, no fix)
    Fixed in: 4.0.10; 3.4.13; 3.3.14
  • Ruby on Rails / Sinatra — Default Rails and classic-style Sinatra applications
    Vulnerable versions: Any app running an affected Ruby
    Fixed in: Apps running Ruby 3.3.14, 3.4.13 or 4.0.10
  • GitLab — GitLab
    Vulnerable versions: 19.6.0 and earlier
  • GitHub — GitHub Enterprise Server
    Vulnerable versions: 3.22.5 and earlier
  • Chatwoot — Chatwoot
    Vulnerable versions: 4.20.0 and earlier
  • Mastodon — Mastodon
    Vulnerable versions: Releases prior to the fixed versions
    Fixed in: 4.7.6; 4.6.12; 4.5.22; 4.4.29
  • OpenProject — OpenProject
    Vulnerable versions: Releases prior to the fixed versions
    Fixed in: 17.9.8; 17.8.3
  • Discourse — Discourse base image
    Vulnerable versions: Images prior to 2.0.20261119-0203
    Fixed in: 2.0.20261119-0203

Timeline

Last updated · 4 updates · revalidated 4× · latest source

  • Ruby 4.0.9, 3.4.12 and 3.3.13 released with earlier Onigmo/Regexp compilation fixes tied to GitLab CVEs; these are the last vulnerable versions for CVE-2026-132825.
  • Reports reach the Ruby security team; a working RCE against a default Rails app with jemalloc is described as achieved the same day (per Durendal write-up, unverified).
  • RCE against a default Rails app with the glibc allocator reported (per Durendal, unverified); working exploit proofs reportedly sent to Ruby maintainers by 2026-11-07.
  • omnibus-gitlab commit bumps bundled Ruby to 3.3.14 and 3.4.13 (changelog: security).
  • Ruby 4.0.10, 3.4.13 and 3.3.14 released with the security advisory covering seven memory-safety flaws, including the case-conversion heap overflow (GHSA-34m4-m9fh-gqp5); credits Stephan Lipp (Ada Logics) and Anthropic.
  • watchTowr assesses the one-byte overwrite as only a starting point: production RCE likely requires a suitable non-glibc allocator, runtime and application preconditions and an ASLR bypass, so denial of service is the more likely outcome. It reports exploitation 'None reported' and CISA KEV 'Not listed'.
  • Cloudflare ships a WAF Emergency Release with default-Block managed rules for the Ruby heap overflow and integer overflow (compensating control only).
  • Independent analysis by Moritz Sanft describes how Rack case-changes a request field during form processing, reaching the flaw in new Rails apps (per The Hacker News).
  • Semgrep merges a host-detection toolkit (Linux shell and PowerShell scripts) that flags vulnerable running Ruby runtimes.
  • Orca Security and Veria Labs publish analyses naming Rails, Sinatra, GitLab, GitHub Enterprise Server, Mastodon, Discourse, OpenProject and Chatwoot as exposed; a public local crash-reproduction write-up appears on GitHub.
  • NVD publishes CVE-2026-132825 (status Received); Ubuntu publishes its tracker page with packages still 'Needs evaluation'.
  • SecurityWeek reports that the Ruby advisory cites PoCs showing RCE in some scenarios for five of the seven flaws in the release (not Ruby2Shell itself), and that Veria Labs will publish its Ruby2Shell PoC after major vendors patch.
  • Cloudflare publishes its ruby2shell analysis and WAF coverage; it expects scanning to begin soon after PoC release and reports no sign of compromise in its own systems.
  • Veria updates its downstream table: fixes now listed for GitLab (19.6.1/19.5.8/19.4.10) and Chatwoot (4.20.1) in addition to Mastodon, OpenProject and the Discourse base image; GitHub Enterprise Server 3.22.5 and earlier remains unfixed.
  • NVD record updated with a secondary CVSS 3.1 score of 7.4 HIGH (AV:L/AC:H) and CISA SSVC exploitation 'none'; Veria page updated.
  • Planned date (on or after) for Veria's public PoC release if vendors have not shipped fixes; expected to accelerate exploitation attempts.

Update history

Sources cited

Previous and next in vulnerability

Drafted by the Threadlinqs research pipeline from 10 sources; published ; last updated .

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats