Summary
Dokploy contains a missing authorization vulnerability in its Docker container terminal endpoint. Although requests are authenticated, an authenticated member may be able to target containers outside their permitted organization or service scope and obtain a root shell on a self-hosted instance.
Affected context
The issue occurs in self-hosted Dokploy deployments where the local /docker-container-terminal branch processes an attacker-controlled containerId. Authentication is performed, but authorization may not verify that the requested container belongs to the caller's role, organization, or accessible service before the identifier is passed to Docker execution functionality.
Exploit preconditions
- Attack surface: The Docker container terminal endpoint and its WebSocket request flow
- Required access: A valid authenticated Dokploy member account
- Trigger point: Processing a caller-controlled container identifier
- Authorization gap: The endpoint authenticates the request without enforcing container-level, service-level, organization-level, or role-based access checks
- Why exploitation is possible: The selected container can reach Docker execution functionality without a sufficiently restrictive authorization decision
Why this happens
The underlying bug is a failure to enforce authorization after authentication. The endpoint validates that a caller is signed in, but does not reliably determine whether that caller is permitted to access the requested container. This maps to CWE-862, Missing Authorization, because an attacker-controlled resource reference reaches a privileged operation without an effective permission check tied to the caller and the resource.
Potential impact
- An authenticated member may obtain unauthorized shell access to containers
- An attacker could execute commands with the privileges available to the container
- Application secrets, data, and deployment credentials may be exposed
- Container workloads could be modified, disrupted, or used for lateral movement
- A compromised privileged container could increase the impact across the host or platform
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the point where a
container identifier is resolved and used.
Defensive patterns include:
- Apply deny-by-default authorization checks to every terminal request
- Resolve the container through a server-side relationship to the caller's permitted organization, project, service, and role
- Avoid trusting client-supplied resource identifiers without ownership and scope validation
- Recheck authorization immediately before privileged Docker operations
- Use least-privilege container, service-account, and host permissions
- Separate terminal access from general membership permissions and record authorization decisions for audit
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis that identifies privileged operations using client-controlled identifiers
- Code review checks confirming authorization occurs after authentication and before resource access
- Tests covering cross-organization, cross-service, and cross-role resource access
- Policy enforcement requiring server-side ownership or scope checks for Docker and infrastructure actions
- Audit monitoring for terminal sessions involving resources outside the caller's normal access scope
- Automated security review tools that flag missing authorization checks on sensitive endpoints

