Skip to navigation

Threat reportVulnerabilityTL-2026-6441

Ruby2Shell: Ruby Case-Conversion Heap Overflow Enables Unauthenticated RCE on Rails and Sinatra Applications (GHSA-34m4-m9fh-gqp5)

criticalTRACKING

Veria Labs disclosed Ruby2Shell (GHSA-34m4-m9fh-gqp5), a one-byte heap overflow in Ruby's string case conversion for certain legacy single-byte encodings that is reachable without authentication in default Rails and classic-style Sinatra configurations. Fixed in Ruby 3.3.14, 3.4.13 and 4.0.10; Ruby 3.2 and older (back to 2.4.0) are affected and end-of-life.

Key facts

IdentifiersTL-2026-6441
Also known asRuby2Shell, GHSA-34m4-m9fh-gqp5
SeverityCRITICAL
First disclosed
Affected productsRuby Ruby (CRuby); GitLab GitLab (bundles Ruby 3.3.13); GitHub GitHub Enterprise Server (bundles Ruby 4.0.9); Mastodon Mastodon (bundles Ruby 4.0.9); OpenProject OpenProject (bundles Ruby 4.0.9); Discourse Discourse (bundles Ruby 3.4.7); Chatwoot Chatwoot (bundles Ruby 3.4.4)
Weaknesses (CWE)CWE-122, CWE-787, CWE-193
MalwareRuby
MITRE ATT&CK techniquesT1059 Command and Scripting Interpreter, T1059.004 Unix Shell, T1190 Exploit Public-Facing Application, T1499.004 Application or System Exploitation, T1588.006 Vulnerabilities, T1595.002 Vulnerability Scanning
MotivationUNKNOWN
Target sectorstechnology, software-development, government administration, finance, health
Target regionsGlobal
Detection rules9 (1 shown free)
Sources7 cited sources

Detection coverage

As of 2026-11-19, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6441 across Splunk SPL, Microsoft KQL and Sigma, covering 12 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 (GHSA-34m4-m9fh-gqp5) - 21+ Encoded 0xDF Sharp-S Bytes in Web Request - Exploitation

Detects web requests carrying 21 or more percent-encoded 0xDF bytes (sharp s in ISO-8859-1/Windows-1252). Per the Ruby advisory and Veria Labs, 21 sharp-s characters is the trigger condition for the one-byte heap overflow in Ruby legacy-encoding upcase/swapcase/downcase(:fold)/casecmp? (Ruby2Shell, GHSA-34m4-m9fh-gqp5, TL-2026-6441): the output buffer is input length + 20 bytes and each sharp s expands to 'SS'. Rails and classic-style Sinatra are exposed unauthenticated by default. No public PoC or in-the-wild exploitation exists yet (PoC expected about 2026-11-26), so the pattern is derived from the documented trigger condition and must be re-validated once a PoC is published.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1190, T1595.002
  • Data sources: index=web sourcetype=access_combined, index=web sourcetype=nginx:plus:access, index=web sourcetype=apache:access, CommonSecurityLog, webserver logsource
  • Severity: high
  • Confidence: high

Splunk SPL

index=web (sourcetype=access_combined OR sourcetype=nginx:plus:access OR sourcetype=apache:access) earliest=-24h
```Ruby2Shell GHSA-34m4-m9fh-gqp5: 21+ percent-encoded 0xDF (sharp s) bytes in one request overflow Ruby legacy-encoding case conversion by one byte```
| rex field=_raw max_match=0 "(?i)(?<sharp_s>%DF)"
| eval sharp_s_count=mvcount(sharp_s)
| where sharp_s_count>=21
| rex field=_raw "(?<http_method>GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS) (?<request_path>[^ ?]+)"
| eval client=coalesce(src, src_ip, clientip)
| stats count AS requests max(sharp_s_count) AS max_sharp_s_per_request dc(sharp_s_count) AS distinct_sharp_s_counts earliest(_time) AS first_seen latest(_time) AS last_seen values(http_method) AS methods values(request_path) AS paths by client, host
| convert ctime(first_seen) ctime(last_seen)
| sort - requests

Microsoft KQL

CommonSecurityLog
| where TimeGenerated > ago(24h)
| where isnotempty(RequestURL)
// Ruby2Shell GHSA-34m4-m9fh-gqp5 trigger: 21+ encoded 0xDF (sharp s) bytes
| extend SharpSCount = array_length(extract_all(@"(?i)(%DF)", RequestURL))
| where SharpSCount >= 21
| summarize Requests = count(), MaxSharpS = max(SharpSCount), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Targets = make_set(DestinationHostName, 10), SampleUrls = make_set(substring(RequestURL, 0, 200), 5) by SourceIP, DeviceVendor
| project FirstSeen, LastSeen, SourceIP, DeviceVendor, Requests, MaxSharpS, Targets, SampleUrls
| order by Requests desc

Sigma

title: Ruby2Shell GHSA-34m4-m9fh-gqp5 - 21 or More 0xDF Sharp S Bytes in Web Request
id: 7c1e4a52-3b9d-4f0e-a6d1-2e8b5c90f411
status: experimental
description: Detects HTTP requests carrying 21 or more percent-encoded 0xDF bytes (sharp s in ISO-8859-1 and Windows-1252), the documented trigger condition for the one-byte heap overflow in Ruby legacy-encoding case conversion (Ruby2Shell, GHSA-34m4-m9fh-gqp5, TL-2026-6441).
references:
    - https://verialabs.com/ruby2shell/
    - https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/
    - https://github.com/advisories/GHSA-34m4-m9fh-gqp5
author: Threadlinqs Team
date: 2026/11/19
tags:
    - attack.initial-access
    - attack.t1190
    - attack.reconnaissance
    - attack.t1595.002
logsource:
    category: webserver
detection:
    selection_query:
        cs-uri-query|re: '(?i)(?:%DF.*?){21,}'
    selection_uri:
        c-uri|re: '(?i)(?:%DF.*?){21,}'
    condition: 1 of selection_*
fields:
    - c-ip
    - cs-method
    - cs-uri-stem
    - cs-uri-query
falsepositives:
    - Binary data placed in the query string by a broken legacy client
    - Security scanners replaying high-byte fuzzing corpora
level: high

Known false positives:

  • Legacy ISO-8859-1 clients submitting very long German-language text through GET query strings
  • Authorized vulnerability scanners or WAF test suites replaying high-byte fuzzing payloads

Tuning notes: Limit to Rails and Sinatra frontends by host or vhost. Log request bodies or WAF payload inspection where available, since POST bodies are not visible in access logs. Also review requests using charset=iso-8859-x or windows-125x in the Content-Type header. UTF-8 sharp s (%C3%9F) does not reach the vulnerable code path and is intentionally not matched. Allowlist authorized scanner source IPs. Re-validate the pattern once the Veria Labs PoC (expected around 2026-11-26) is public. Companion rules KQL-001 (allocation-size probing) and SIG-001 (double-encoded and raw-escaped variants) cover tuning and evasion.

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)
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Allocation-Size Probing with Repeated Sharp-S Requests (Sentinel) - Exploitation · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Secret and Credential File Access by Ruby Application Server Children (Sentinel) - Post-Exploitation · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Ruby Application Server Outbound Connection to Public IP on Non-Standard Port (Sentinel) - C2 · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - 21+ Double-Encoded or Raw-Escaped 0xDF Bytes in Web Request (Sigma) - Exploitation · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Persistence Commands Spawned by Ruby Application Server (Sigma) - Post-Exploitation · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Ruby Inline Interpreter Reverse Shell or Downloader (Sigma) - C2 · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Ruby Application Server Memory-Corruption Crash - Exploitation Fallout · unlock with TL Creds
  • Ruby2Shell (GHSA-34m4-m9fh-gqp5) - Ruby Application Server Spawning Shell or Download/Reverse-Shell Tooling - Post-Exploitation / C2 · unlock with TL Creds

Indicators of compromise

As of 2026-11-19, Threadlinqs Intelligence tracks 12 indicators of compromise for TL-2026-6441.

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

Technical analysis

No CVE assigned yet, no in-the-wild exploitation reported, and a PoC is planned about one week after disclosure.

Ruby2Shell is a one-byte heap out-of-bounds write in Ruby's String case conversion. Most single-byte legacy encodings (several ISO-8859 and Windows-125x encodings) have no uppercase form of the German sharp s (ß). Upcasing it writes two bytes ('SS'), but the conversion loop only verifies room for one byte. The output buffer is sized as input length plus 20 bytes, so an input containing 21 instances of ß overflows the buffer by one byte. The written byte is 'S' (0x53) when upcasing or 's' (0x73) when case-folding. The attacker controls the allocation size through input length, and copying the result out afterwards reads one byte out of bounds. According to Veria Labs, the flaw has existed since Ruby 2.4.0. Strings in UTF-8 take a different code path and are not affected.

Affected functions per Veria Labs are upcase, swapcase, downcase(:fold) and casecmp?. Ruby on Rails and classic-style Sinatra are exposed in their default configurations, which is why Veria Labs describes the bug as unauthenticated remote code execution; plain Rack and other frameworks are not exposed by default. Any application code that changes the case of untrusted strings in a legacy encoding may also be vulnerable. The Ruby core team published the fix as part of a seven-vulnerability advisory on 2026-11-18 (Regexp and String case conversion): this item is GHSA-34m4-m9fh-gqp5, credited to Stephan Lipp (Ada Logics) and Anthropic, upstream commit d582f8f in ruby/ruby. A second, separate case-conversion flaw, GHSA-87fm-7w84-j2px (integer overflow leading to heap overflow, credited to baba__yaga via HackerOne), was fixed in the same release; the other five advisories cover Regexp compilation, matching and Regexp#to_s (GHSA-7x2q-68qv-6p8x, GHSA-wpqw-5qxg-m68r, GHSA-3p8q-wmhx-vm2w, GHSA-7whj-cfh7-xgm4, GHSA-pvgc-g7gj-pv6h).

Affected Ruby releases are 4.0.0-4.0.9, 3.4.0-3.4.12, 3.3.0-3.3.13, and all end-of-life releases through 3.2 back to 2.4.0, which will not be patched. Veria Labs lists these bundled products as affected at their latest listed versions: GitLab 19.6.0 (Ruby 3.3.13), GitHub Enterprise Server 3.22.5 (Ruby 4.0.9), Mastodon 4.7.5 (Ruby 4.0.9), OpenProject 17.9.7 (Ruby 4.0.9), Discourse 2026.10.1 (Ruby 3.4.7) and Chatwoot 4.20.0 (Ruby 3.4.4). No workarounds are published; the only remediation is upgrading Ruby or installing the vendor's fixed release.

No CVE or CVSS score has been assigned, no in-the-wild exploitation has been reported, and no IOCs, malware names or attribution exist in the sources. Veria Labs states a proof of concept will be released about one week after the disclosure, after which opportunistic exploitation of internet-facing Rails and Sinatra applications should be anticipated. The Ruby advisory notes the team is aware of PoCs for some of the seven vulnerabilities. Because exploit details are not public, exploit-chain specifics beyond the primitive described above (heap layout, gadget selection, payload) are not documented in the sources and are intentionally not speculated on here.

MITRE ATT&CK techniques by tactic:

Execution

T1059 Command and Scripting Interpreter; T1059.004 Unix Shell

Initial Access

T1190 Exploit Public-Facing Application

Impact

T1499.004 Application or System Exploitation

Resource Development

T1588.006 Vulnerabilities

Reconnaissance

T1595.002 Vulnerability Scanning

Remediation

Patches

  • Ruby 3.3.14
  • Ruby 3.4.13
  • Ruby 4.0.10
  • Upstream fix: ruby/ruby commit d582f8f

Immediate actions

  • Upgrade directly managed Ruby to 3.3.14, 3.4.13 or 4.0.10
  • Prioritize internet-facing Rails and classic-style Sinatra deployments, then internal services and packaged products
  • Install the vendor's fixed release for bundled products (GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse, Chatwoot); an OS package update may not replace the embedded runtime
  • Verify the Ruby version actually used by the running service, not just the version installed on the host

Longer-term hardening

  • Migrate end-of-life Ruby 3.2 and older deployments to a supported patched branch
  • Inventory bundled Ruby runtimes in third-party self-hosted software
  • Review application code that changes the case of untrusted strings in legacy single-byte encodings

Affected and fixed versions

  • Ruby — Ruby (CRuby)
    Vulnerable versions: 4.0.0-4.0.9; 3.4.0-3.4.12; 3.3.0-3.3.13; 3.2 and older back to 2.4.0 (EOL)
    Fixed in: 4.0.10; 3.4.13; 3.3.14
  • GitLab — GitLab (bundles Ruby 3.3.13)
    Vulnerable versions: 19.6.0
  • GitHub — GitHub Enterprise Server (bundles Ruby 4.0.9)
    Vulnerable versions: 3.22.5
  • Mastodon — Mastodon (bundles Ruby 4.0.9)
    Vulnerable versions: 4.7.5
  • OpenProject — OpenProject (bundles Ruby 4.0.9)
    Vulnerable versions: 17.9.7
  • Discourse — Discourse (bundles Ruby 3.4.7)
    Vulnerable versions: 2026.10.1
  • Chatwoot — Chatwoot (bundles Ruby 3.4.4)
    Vulnerable versions: 4.20.0

Timeline

  • Ruby 2.4.0 released; per Veria Labs the vulnerable case-conversion behavior has existed since this release.
  • Ruby 4.0.9, 3.4.12 and 3.3.13 released with Regexp security fixes (last affected releases of each supported branch).
  • Ruby core team publishes advisory for seven Regexp/String case-conversion vulnerabilities, including GHSA-34m4-m9fh-gqp5, and releases Ruby 4.0.10, 3.4.13 and 3.3.14.
  • GBHackers reports Ruby2Shell as critical unauthenticated RCE; no active exploitation reported and no CVE assigned.
  • Veria Labs publishes the Ruby2Shell write-up, naming Rails and classic-style Sinatra as exposed by default and listing affected bundled products.
  • Veria Labs plans to release a proof of concept about one week after disclosure (approximate date); mass scanning and exploitation attempts are anticipated afterwards.

Sources cited

Drafted by the Threadlinqs research pipeline from 7 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