Summary
Dokploy's WebSocket handlers authenticate users but do not enforce the role and permission checks applied to other application procedures. As a result, any authenticated member may access interactive terminals or log streams for unauthorized containers, potentially reaching the host through privileged container access.
Affected context
The issue occurs in Dokploy deployments where WebSocket endpoints provide in-app terminals or container log streams. These handlers may validate the user's session while omitting authorization checks that determine whether the user is permitted to access the selected container. Risk is especially significant when a reachable container has access to the Docker socket or other host-sensitive resources.
Exploit preconditions
- Attack surface: WebSocket endpoints used for interactive terminals and log streaming
- Required access: A valid authenticated Dokploy account, including a member-level account
- Trigger point: Opening a terminal or log-streaming session for a container identifier
- Why exploitation is possible: Session authentication establishes identity, but the handler does not consistently consult the application's role and permission model
- Environmental factor: Impact is heightened when an accessible container has elevated privileges, host mounts, or access to the Docker socket
Why this happens
The underlying defect is an authorization gap between authentication and resource access control. The WebSocket handlers verify that a request belongs to an authenticated session but do not verify whether that identity is authorized to operate on the requested container.
This maps primarily to CWE-862: Missing Authorization, with related concerns involving CWE-639: Authorization Bypass Through User-Controlled Key when container references are accepted without effective ownership checks, and CWE-269: Improper Privilege Management where low-privilege users can reach privileged runtime capabilities.
Potential impact
- An authenticated member may access containers outside their authorized tenant or project
- An attacker could obtain interactive command execution within a container
- A reachable Docker socket could enable container breakout or host-level control
- Tenant boundaries and application confidentiality may be compromised
- Attackers could modify deployments, tamper with data, or disrupt hosted workloads
General mitigation guidance
Mitigation generally focuses on making authorization checks mandatory for every WebSocket operation and resource reference.
Common defensive patterns include:
- Applying the same centralized role, permission, tenant, and resource-ownership checks used by tRPC procedures
- Authorizing the requested container and operation before creating a terminal or log-stream session
- Deriving resource scope from trusted server-side context rather than relying on client-provided identifiers
- Using deny-by-default policies for interactive shells, logs, and administrative operations
- Reducing container privileges and avoiding Docker socket exposure where operationally possible
- Separating tenant workloads and limiting the permissions of service accounts and runtime components
- Revalidating authorization for long-lived WebSocket sessions and sensitive actions
How teams detect issues like this
High-level detection can combine source review, automated analysis, and runtime monitoring:
- Search for WebSocket handlers that authenticate sessions but do not invoke centralized authorization or policy checks
- Review every client-supplied project, application, container, or tenant identifier for server-side ownership validation
- Flag terminal, execution, log-streaming, and administrative endpoints that lack deny-by-default permission enforcement
- Use static analysis or automated code review tools to identify authentication-only guards around privileged operations
- Monitor WebSocket activity for members accessing resources outside their assigned projects or tenants
- Audit container and host telemetry for unexpected shell sessions, Docker API requests, or cross-tenant access patterns

