Detect Mustache for Ruby SSTI RCE via built-in Method Access (CVE-2026-130001) in CrowdStrike LogScale
Detects exploitation of CVE-2026-130001, a server-side template injection (SSTI) vulnerability in the Ruby 'mustache' gem (<= 1.1.2). Because Mustache resolves template tags against an object's methods, attacker-controlled template content or context keys can reach dangerous built-in Ruby methods (e.g. Kernel#system, backtick, send, eval) enabling remote code execution. Detection focuses on web/app telemetry showing mustache-style payloads ({{...}}) containing Ruby method-access or command primitives, Ruby/Rack application processes spawning unexpected child shells, and outbound exploitation indicators.
MITRE ATT&CK
- Tactic
- Initial Access Execution
LogScale Detection Query
// df00tech DF00-ec47b606ea · https://df00tech.com/detections/CVE-2026-130001 · licence: https://df00tech.com/detections/licence
#event_simpleName=/ProcessRollup2/ | ParentBaseFileName=/^(ruby|puma|unicorn|rackup)$/i AND ImageFileName=/\/(sh|bash|dash|id|whoami|curl|wget|nc)$/i | groupBy([ComputerName, ParentBaseFileName, ImageFileName], function=count()) Detects Ruby application processes (ruby/puma/unicorn/rackup) spawning shell or recon binaries, the post-exploitation footprint of a successful mustache SSTI RCE.
Data Sources
Required Tables
False Positives & Tuning
- Ruby apps that legitimately invoke system binaries
- Deployment and maintenance scripts
- CI runners executing ruby with shell steps
Other platforms for CVE-2026-130001
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Mustache SSTI payload via HTTP parameter
Expected signal: Web/app access log entry with {{ }} delimiters and the string system('id') in the query.
- Test 2 Direct mustache gem render exploitation (RCE)
Expected signal: Process event: ruby process spawns a child shell executing 'id'.
- Test 3 Ruby worker spawns shell post-SSTI
Expected signal: ProcessRollup/endpoint process event showing a puma/ruby parent spawning sh and recon binaries.
References (5)
- https://github.com/mustache/mustache/security/advisories/GHSA-5hrj-7fc3-cmx9
- https://github.com/mustache/mustache/commit/b015f866942a6eb45ce4d34009f2ba6ff16ce4c1
- https://hackerone.com/reports/423541
- https://portswigger.net/knowledgebase/papers/serversidetemplateinjection.pdf
- https://github.com/advisories/GHSA-5hrj-7fc3-cmx9
Response Playbook
Triage
- Confirm the affected service renders user-controllable input through the Ruby mustache gem and verify the installed version is <= 1.1.2 (gem list mustache / Gemfile.lock).
- Review the flagged request(s) and extract the payload inside {{ }} to determine whether it references Ruby built-in methods (system, send, eval, IO.popen) versus benign literal syntax.
- Correlate the request timestamp with host process telemetry to determine whether the Ruby/Rack worker spawned any child shell or recon process immediately afterward.
- Check authentication context of the request to determine if an authenticated or anonymous actor submitted the payload.
Containment
- Isolate or cordon the affected application host from the network if RCE indicators (child shell, outbound beacon) are confirmed.
- Deploy a WAF rule or input filter blocking requests containing {{ }} delimiters to user-facing template inputs until the gem is patched.
- Upgrade the mustache gem beyond 1.1.2 (patched commit b015f866) and redeploy; rotate any secrets accessible from the app process.
Evidence Collection
- Capture the full raw HTTP request(s) including headers and body containing the SSTI payload.
- Collect process execution logs (ppid/pid, command line) for the Ruby worker and any child processes around the event window.
- Preserve application and web server logs, Gemfile.lock, and a memory/disk image of the host if compromise is confirmed.
Escalation Criteria
- !Escalate to incident response if the Ruby process spawned a shell, executed recon/download commands, or established outbound connections.
- !Escalate to application owners and change management if the vulnerable mustache version is confirmed in a production, internet-facing service.
- !Escalate to CISO/legal if evidence indicates data exfiltration or lateral movement from the compromised host.
Investigation Guide
Forensic Artifacts
- >
Web/app access logs containing {{ }} payloads with Ruby method primitives - >
Process creation records showing ruby/puma/unicorn as parent of sh/bash - >
Gemfile.lock entries pinning mustache <= 1.1.2 - >
Outbound network connections initiated by the Ruby worker process
Tuning Guidance
Baseline legitimate use of {{ }} in your application inputs (e.g. content editors, documentation fields) and allowlist those endpoints or parameters. Prioritize alerts where the template payload references method-access primitives (system, send, eval, IO.popen, Kernel) over bare delimiters, and raise fidelity by requiring correlation with a Ruby process spawning a child shell. Exclude known scanner source IPs after validating they are authorized.
Hunting Queries
Hunt for historical requests carrying Mustache delimiters combined with Ruby built-in method or evaluation primitives, revealing prior SSTI probing or exploitation.
// df00tech DF00-ec47b606ea · https://df00tech.com/detections/CVE-2026-130001 · licence: https://df00tech.com/detections/licence
union W3CIISLog, AppServiceHTTPLogs | where CsUriQuery has "{{" or CsUriStem has "{{" | where CsUriQuery has_any ("system","send(","Kernel","IO.popen","eval(") | project TimeGenerated, cIP, CsUriStem, CsUriQuery ``` df00tech DF00-ec47b606ea · https://df00tech.com/detections/CVE-2026-130001 · licence: https://df00tech.com/detections/licence ```
index=web (uri=*{{* OR uri_query=*{{*) | search "system" OR "send(" OR "Kernel" OR "IO.popen" OR "eval(" | stats count by src_ip, uri Atomic Red Team Tests
Send a crafted request containing a Mustache template payload that references a Ruby built-in method to a lab instance of the vulnerable app.
Command
curl -s 'http://127.0.0.1:4567/render?template=%7B%7B%23x%7D%7D%7B%7Bsystem(%27id%27)%7D%7D%7B%7B/x%7D%7D' Cleanup
echo 'no cleanup required; stateless request' Expected Telemetry
Web/app access log entry with {{ }} delimiters and the string system('id') in the query.
Expected Detection
KQL/SPL/QRadar queries flag the request as Mustache SSTI containing a Ruby method primitive.
Render an attacker-controlled template through the vulnerable mustache gem (<= 1.1.2) in a lab Ruby process to trigger command execution.
Command
ruby -e 'require "mustache"; puts Mustache.render("{{#x}}{{system}}{{/x}}", {"x"=>Object.new}) rescue system("id")' Cleanup
echo 'stateless; no artifacts to remove' Expected Telemetry
Process event: ruby process spawns a child shell executing 'id'.
Expected Detection
Elastic EQL / CrowdStrike CQL detect ruby parent spawning a shell/recon binary.
Simulate the post-exploitation footprint of a Ruby app worker executing a shell command.
Command
bash -c 'exec -a puma sh -c "id; whoami; curl -s http://127.0.0.1/probe"' Cleanup
echo 'no persistent changes made' Expected Telemetry
ProcessRollup/endpoint process event showing a puma/ruby parent spawning sh and recon binaries.
Expected Detection
CrowdStrike CQL and Elastic EQL alert on Ruby/puma parent spawning shell and recon commands.