Dozzle Cross-Site WebSocket Hijacking (CSWSH) Vulnerability
Dozzle is vulnerable to Cross-Site WebSocket Hijacking (CSWSH) due to a permissive CheckOrigin configuration and the use of SameSite=Lax for JWT cookies, allowing attackers on the same site to gain shell access to containers even with authentication enabled, tracked as CVE-2026-44985.
Dozzle, a real-time log viewer for Docker containers, is susceptible to a Cross-Site WebSocket Hijacking (CSWSH) vulnerability. The vulnerability exists due to the CheckOrigin function in the WebSocket upgrader being overridden to always return true, effectively disabling cross-origin protection. Combined with the use of SameSite=Lax for the JWT cookie, an attacker hosting a malicious page on the same site (e.g., a sibling subdomain or another service on localhost) can exploit this to gain unauthorized access. This allows the attacker to establish a WebSocket connection to the /exec or /attach endpoints using the victim’s valid JWT cookie, granting them interactive shell access to any container the victim is authorized to access. This vulnerability, tracked as CVE-2026-44985, affects Dozzle versions up to and including 10.5.1. Even deployments with authentication properly configured are vulnerable.
Attack Chain
- The attacker hosts a malicious page on a domain that shares the same site as the vulnerable Dozzle instance (e.g.,
attacker.example.comif Dozzle is ondozzle.example.com). - A victim who is authenticated to Dozzle visits the attacker’s page in their browser.
- The attacker’s webpage executes JavaScript that initiates a WebSocket connection to the Dozzle server, specifically targeting the
/api/hosts/{host}/containers/{id}/execendpoint. - The victim’s browser automatically includes the JWT cookie in the WebSocket request because the attacker’s page is on the same site and the cookie’s
SameSiteattribute is set toLax. - Dozzle’s WebSocket upgrader bypasses the origin check because the
CheckOriginfunction is configured to always returntrue. - The Dozzle server validates the JWT cookie, authenticating the WebSocket connection as the victim.
- The attacker now has an interactive shell session within the victim’s authorized containers.
- The attacker can then execute arbitrary commands within the container, potentially leading to sensitive information disclosure or further exploitation.
Impact
Successful exploitation of this CSWSH vulnerability allows an attacker to execute arbitrary commands within Docker containers that the victim has access to. This can lead to the compromise of sensitive data, such as secrets, environment variables, and files stored within the containers. Furthermore, an attacker can potentially pivot to other services accessible from the container’s network, potentially escalating the attack. If the Docker socket is mounted with write permissions, the attacker might even be able to escape the container and compromise the host system.
Recommendation
- Upgrade Dozzle to a version greater than 10.5.1 to remediate CVE-2026-44985.
- Deploy the Sigma rule
Detect Dozzle CSWSH Attempt via Origin Headerto identify potential exploitation attempts by monitoring WebSocket connections with mismatched Origin headers, and tune it for your environment. - Apply the suggested fix by removing the custom
CheckOriginoverride in Dozzle’s source code, reverting to the default gorilla/websocket behavior, which rejects cross-origin requests.
Detection coverage 2
Detect Dozzle CSWSH Attempt via Origin Header
mediumDetects potential Dozzle CSWSH exploitation by monitoring WebSocket connections with a non-empty Origin header from a different origin than the Dozzle server.
Detect Dozzle Shell Access via /exec Endpoint
lowDetects access to the /exec endpoint, which can be used to gain shell access to containers.
Detection queries are available on the platform. Get full rules →