Analytics Story: Ruby2Shell - CVE-2026-132825

Description

This analytic story covers Ruby2Shell, a one-byte heap overflow in Ruby string case conversion tracked as CVE-2026-132825 and GHSA-34m4-m9fh-gqp5, and process activity that may follow code execution in an affected Ruby web application.

Why it matters

CVE-2026-132825 is a one-byte heap overflow in Ruby string case conversion for legacy single-byte encodings. Converting repeated sharp S characters can expand the output past the allocated buffer.

Rails and classic-style Sinatra can reach the affected operation while handling untrusted requests. Other Ruby applications depend on how they convert input. UTF-8 follows a different path. Successful exploitation may execute code inside the Ruby worker or start a child process, but a matching request does not establish either outcome.

HTTP Large POST and Oversized Multipart Header Activity identifies traffic patterns that may accompany heap manipulation, including repeated large bodies or long multipart headers. Ruby Repeated Legacy Sharp S Bytes in POST Body provides a narrower signal for the case-conversion input when bounded, plaintext body capture is available. Review the Ruby version, framework, request handling, client, and nearby worker failures before assigning this CVE.

Web or Application Server Spawning a Shell, Windows Suspicious Child Process Spawned From WebServer, and Linux Auditd Shell from Web or Application Directory cover child execution after a web-worker compromise.

Child execution is a strong investigative pivot, not a required result of the overflow. Upgrade Ruby to 3.3.14, 3.4.13, or 4.0.10, and update applications that bundle an affected runtime.

Web Anomaly Followed by Server Process Execution

 1| tstats `security_content_summariesonly`
 2    min(_time) as firstTime
 3    max(_time) as lastTime
 4from datamodel=Risk.All_Risk where
 5
 6All_Risk.risk_object_type="system"
 7
 8source IN (
 9    "*PHP Serialized Object in POST Body*",
10    "*PHP SOAP DTD Entity Reference in Attribute*",
11    "*PHP SOAP Malformed Array Dimensions*",
12    "*HTTP Large POST and Oversized Multipart Header Activity*",
13    "*Ruby Repeated Legacy Sharp S Bytes in POST Body*",
14    "*PostScript or EPS Upload with Image or PDF Extension*",
15    "*Large HTTP POST Request Resulting in Server Error*",
16    "*Zeek HTTP Malformed Base64 Padding*",
17    "*Windows Suspicious Child Process Spawned From WebServer*",
18    "*Web or Application Server Spawning a Shell*",
19    "*Linux Auditd Shell from Web or Application Directory*",
20    "*Inline PHP Code Execution*"
21)
22
23by All_Risk.normalized_risk_object source _time span=1s
24
25| `drop_dm_object_name(All_Risk)`
26
27| where isnotnull(normalized_risk_object)
28
29| lookup asset_lookup_by_str asset as normalized_risk_object OUTPUT ip as asset_ip
30
31| eval normalized_risk_object=coalesce(asset_ip,normalized_risk_object)
32
33| fields - asset_ip
34
35| eval web_request=if(in(source,
36      "ESCU - PHP Serialized Object in POST Body - Rule",
37      "ESCU - PHP SOAP DTD Entity Reference in Attribute - Rule",
38      "ESCU - PHP SOAP Malformed Array Dimensions - Rule",
39      "ESCU - HTTP Large POST and Oversized Multipart Header Activity - Rule",
40      "ESCU - Ruby Repeated Legacy Sharp S Bytes in POST Body - Rule",
41      "ESCU - Large HTTP POST Request Resulting in Server Error - Rule",
42      "ESCU - Zeek HTTP Malformed Base64 Padding - Rule",
43      "ESCU - PostScript or EPS Upload with Image or PDF Extension - Rule"),1,0),
44       web_time=if(web_request=1,firstTime,null()),
45       web_source=if(web_request=1,source,null())
46
47| sort 0 normalized_risk_object firstTime -web_request
48
49| streamstats max(web_time) as preceding_web_time
50              last(web_source) as web_analytic
51              by normalized_risk_object
52
53| where web_request=0
54    AND isnotnull(preceding_web_time)
55    AND firstTime>=preceding_web_time
56    AND firstTime-preceding_web_time<=900
57
58| eval endpoint_analytic=source,
59       time_delta_seconds=firstTime-preceding_web_time,
60       risk_object=normalized_risk_object,
61       lastTime=firstTime,
62       firstTime=preceding_web_time
63
64| fields risk_object web_analytic endpoint_analytic time_delta_seconds firstTime lastTime
65
66| `security_content_ctime(firstTime)`
67| `security_content_ctime(lastTime)`
68| `web_anomaly_followed_by_server_process_execution_filter`

Detections

Name ▲▼ Technique ▲▼ Type ▲▼
HTTP Large POST and Oversized Multipart Header Activity Exploit Public-Facing Application Anomaly
Ruby Repeated Legacy Sharp S Bytes in POST Body Exploit Public-Facing Application Anomaly
Web or Application Server Spawning a Shell External Remote Services, Exploit Public-Facing Application TTP
Windows Suspicious Child Process Spawned From WebServer Web Shell Anomaly
Linux Auditd Shell from Web or Application Directory Unix Shell Anomaly

Data Sources

Name ▲▼ Platform ▲▼ Sourcetype ▲▼ Source ▲▼
Bro http Web bro:http:json bro:http:json
Zeek HTTP Request Headers Web zeek:http_request_header:json http_request_headers.log
Zeek HTTP POST Body Web zeek:http_post_body:json http_post_body.log
Sysmon for Linux EventID 1 Linux icon Linux sysmon:linux Syslog:Linux-Sysmon/Operational
Sysmon EventID 1 Windows icon Windows XmlWinEventLog XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
Windows Event Log Security 4688 Windows icon Windows XmlWinEventLog XmlWinEventLog:Security
CrowdStrike ProcessRollup2 Other crowdstrike:events:sensor crowdstrike
Linux Auditd Execve Linux icon Linux auditd auditd
Linux Auditd Syscall Linux icon Linux auditd auditd
Linux Auditd Cwd Linux icon Linux auditd auditd

References


Source: GitHub | Version: 1