Background
Dozzle is a small, open-source web app for watching Docker container logs in real time. It usually runs as a container itself, reads logs from the Docker socket (Swarm and Kubernetes are also supported), and shows them in a browser with search and live CPU and memory stats. It does not store logs. It is designed for live viewing.
Dozzle can be protected with a login, and permissions can be limited by role. It also has an optional cloud integration. A user with the cloud role links the local Dozzle instance to a Dozzle Cloud account. After linking, the instance can stream logs and related information to that account. The link is established through a callback, a URL on the local instance that the cloud service sends the browser back to once the user approves the connection.
Terms used below:
- Session cookie is the small piece of data the browser sends automatically with each request to prove the user is logged in.
SameSite=Laxis a cookie setting. The browser withholds the cookie on most cross-site requests, but still sends it when the user is navigated to the site by clicking a link or following a redirect (a “top-level GET”).- Role is a permission label. Here, only users with the
cloudrole may manage the integration.
Summary
A cross-site navigation can link the instance to an attacker-controlled cloud account using the victim’s existing browser session. The callback accepts an account-linking decision through a GET request, without proving that the signed-in user initiated that link.
Linking changes instance-wide configuration, including where logs and related information are sent. In this attack, the cloud token identifies the attacker’s account, while the victim’s cookie authorizes the local configuration change. Both inputs can be valid yet originate from different parties. Binding the callback to the user’s intended linking flow is therefore a separate requirement from checking that the user is signed in and has permission to manage the integration.
How the Vulnerability Works
Cross-site request forgery (CSRF) is an attack where a malicious website makes the victim’s own browser send a request to another site where the victim is logged in. The browser attaches the victim’s cookies automatically, so the target site believes the victim chose to make the request. The defense is to make state-changing requests prove that they came from the site’s own pages, usually with a secret per-session token or by refusing to change state on a plain GET.
Dozzle’s callback GET /api/cloud/callback?token=... has three properties that combine badly:
- It changes configuration, because it links the instance to whichever cloud account the token belongs to.
- It does not check that the user started this linking flow. There is no CSRF token and no state value tied to the user’s session.
- It requires the user to be logged in with the
cloudrole, but theSameSite=Laxcookie is sent on a top-level GET, so a cross-site link satisfies that check.
The attack is therefore short. The attacker creates their own Dozzle Cloud account and obtains a link token for it. They put a link or an automatic redirect on a page they control that points at the victim’s Dozzle instance:
https://dozzle.example.internal/api/cloud/callback?token=<attacker's token>When a signed-in Dozzle user who holds the cloud role (the default for users defined in users.yml) opens that page, their browser requests the URL with their real session cookie. Dozzle sees an authorized user and an apparently valid token, and links the instance to the attacker’s account. The two halves of the request come from different people: the token is the attacker’s, and the authority is the victim’s. After that, cloud-side log streaming, stats and notifications are directed to the attacker’s account. The advisory notes that this streaming uses instance-wide container labels rather than the per-user label filters Dozzle enforces elsewhere, so it can expose all of the instance’s container logs.
An earlier fix made sure anonymous users could not reach this endpoint. That stops a direct request, and does nothing against a request made through a logged-in victim’s browser. The attacker does not need to steal the session cookie at any point. This is CSRF (CWE-352).
Prerequisites
A logged-in victim with the cloud role visits an attacker-controlled page that triggers a top-level navigation. The attacker supplies a cloud-link token. The victim’s browser supplies its own session cookie.
The affected cookie uses SameSite=Lax, which permits credentials on this kind of cross-site GET navigation. The attacker does not need to steal the victim’s session token. The cloud-role check still applies, so a user who lacks permission to link the instance cannot substitute for the privileged victim.
Attack Path
- STARTAttacker prepares a token for their cloud account
- STEP 01Lure a cloud-role user into top-level GET navigation
SameSite=Lax allows the victim’s session cookie on this navigation.
- STEP 02Accept /api/cloud/callback with the supplied token
MITIGATION Validate session-bound linking state and CSRF protection
- STEP 03Persist the attacker-selected cloud integration
MITIGATION Require an intentional account-link confirmation
- STEP 04Redirect instance-wide cloud streaming
Root Cause
The state-changing endpoint is GET /api/cloud/callback. It accepts the supplied token without a CSRF token or origin validation.
The callback exchanges its token query parameter at the configured cloud endpoint and stores cloud settings through SetCloudConfig. Those settings include the linked account prefix and enabled log streaming. The route checks the user’s authentication and cloud role, but does not bind the callback to a linking flow that the user intentionally started.
A SameSite=Lax cookie still accompanies a top-level GET navigation from another site. The attacker can therefore direct the victim’s browser to a callback containing an attacker-supplied token, and the browser contributes the victim’s authorization. The earlier authentication-only fix blocks anonymous direct requests but does not establish user intent for this authenticated state change.
Validation
The v11.2.0 lab included two users with different permissions and a mock cloud service. Direct anonymous access returned HTTP 401 and the restricted-role account returned HTTP 403. An initially unlinked instance then accepted a session-cookie-bearing callback request and persisted an attacker-selected prefix with linked: true and streamLogs: true.
The automated reproduction sent the cookie-bearing GET with curl. It modeled a request that a browser can send during a top-level navigation, without a CSRF token. No browser automation or production cloud service was used in this test.
| Request | Expected security decision | Recorded result |
|---|---|---|
| Anonymous callback | Reject | HTTP 401 |
| Callback from a user without cloud permission | Reject | HTTP 403 |
| Cookie-bearing callback without linking-intent proof | Reject the state change | Cloud configuration changed |
Impact
The test confirmed unauthorized replacement of the instance’s cloud configuration. Cloud streaming uses instance-wide container labels and does not apply the visitor’s per-user label restrictions. Linking the instance can therefore expose logs beyond those visible in the victim’s own log view.
The report describes exposure of container logs and statistics through that integration. Actual contents and downstream exposure depend on the deployment. The reproduction used a mock cloud endpoint rather than the production cloud service.
Remediation
Fixed in merged PR #5330. The published advisory lists no patched version. The first release that contains the change is v11.3.0. The fix requires a one-time state value on the cloud-link callback, tying the completed link to the user who initiated it.
The link buttons first call POST /api/cloud/link to obtain state bound to the current user. Cloud returns that value with the callback. Before contacting Cloud, the callback checks that the state is live, unused and owned by the same user. Invalid state returns HTTP 403. State expires after ten minutes, and consuming it prevents replay.
The cloud service must also preserve the state through the linking flow. The PR identifies amir20/doligence#714 as the corresponding cloud change and notes that it must be deployed first. This closes the gap left by authentication alone, which allowed a cookie-bearing navigation to change the integration without proving that the user started the link.