Summary
A flaw in Dozzle's agent-backed shell endpoints allows users who are supposed to be restricted by label filters (for example, label=env=dev) to bypass those restrictions by directly targeting container IDs.
Under these conditions, an attacker can obtain an interactive root shell inside out-of-scope containers on the same agent host, such as env=prod, leading to full compromise of those containers.
Affected context
This vulnerability affects deployments of Dozzle that:
- Use the agent-backed shell feature to provide interactive shells into containers, and
- Rely on label-based filters (e.g.,
label=env=dev) to constrain which containers a given user can access.
In such environments, users are expected to operate only on containers matching assigned labels, but the shell endpoints accept explicit container IDs and fail to consistently enforce those label-based access restrictions.
The vulnerability manifests on the agent host where both in-scope and out-of-scope containers (e.g., dev and prod) are running and accessible via the same Dozzle agent.
Exploit preconditions
- Attack surface: Dozzle's agent-backed shell HTTP/WebSocket endpoints exposed through the Dozzle UI or API.
- Required access: Ability to authenticate or otherwise reach Dozzle with permissions intended to be limited by label filters (e.g., a tenant or user who should only see
env=devcontainers). - Trigger point: Issuing a shell request that directly targets a container by its ID or reference, instead of selecting it through the filtered label-based interface.
- Why exploitation is possible: The backend shell endpoint authorizes access based on container identity without consistently re-applying label filters or scope checks. As a result, any container accessible to the agent on the host can be targeted by ID, bypassing the intended label-based restrictions described by CWE-284 (Improper Access Control) and CWE-863 (Incorrect Authorization).
Why this happens
The underlying issue is an authorization gap in how Dozzle enforces container access policies for shell sessions.
While the UI or higher-level logic applies label filters to restrict which containers a user should see and interact with, the agent-backed shell endpoint does not consistently enforce those same constraints when a container is referenced directly by ID.
This separation between "what is visible" and "what is actually authorized" leads to a classic Improper Access Control pattern (CWE-284), compounded by Incorrect Authorization (CWE-863), where the system assumes label filtering is sufficient but fails to verify that a requested container is truly within the user's permitted scope before granting shell access.
Potential impact
- Attackers may obtain an interactive root shell in out-of-scope containers, including production or other sensitive workloads.
- Compromise of confidential data, configuration files, and secrets stored within affected containers.
- Ability to install backdoors, modify application code, or alter runtime environment in targeted containers.
- Lateral movement within the container host network or to other services reachable from compromised containers.
- Escalation from a low-privileged, dev-only account to effective administrative control over multiple environments.
General mitigation guidance
Effective mitigation focuses on enforcing consistent, least-privilege authorization at the point where shell sessions are created:
- Ensure that every shell endpoint on the agent revalidates the user's permissions against the target container, including label-based scope checks, before starting a session.
- Treat label filters as an authorization boundary, not just a UI filter, and centralize access decisions in a single, auditable authorization layer that all endpoints must use.
- Design shell features around explicit role- and attribute-based access control (RBAC/ABAC), where access is determined by policy that considers user identity, container attributes, and environment sensitivity.
- Reduce the privilege of shells provided by automation tools whenever possible (e.g., non-root users, constrained capabilities, and restricted namespaces) to limit blast radius if authorization controls fail.
- Isolate highly sensitive containers (such as production workloads) onto separate agent hosts or networks, so that a compromise in one scoped environment does not automatically expose critical containers.
How teams detect issues like this
Organizations can look for this class of issue and its exploitation using a combination of review and monitoring:
- Code and config review: Examine Dozzle's shell-related handlers to confirm that authorization checks are applied to the target container, not just the UI listing, and that label-based restrictions are enforced server-side.
- Static analysis patterns: Flag endpoints that accept container IDs and start shell sessions without passing through a centralized authorization function or policy engine.
- Access logging and audit trails: Enable detailed logging for shell session creation, capturing user identity, requested container ID, and applied filters. Alert on shell access to containers from users whose expected scope does not include those containers.
- Policy enforcement: Use admission controls, RBAC policies, and host-based monitoring to detect and restrict interactive shells in sensitive environments, regardless of which management tool initiates them.
- Automated security testing tools and CI-integrated checks can also be configured to highlight any path where user-scoped filters are applied only at the presentation layer but not at the enforcement layer.

