Summary
Dokploy WebSocket handlers verify organization membership but do not consistently enforce access controls for individual servers and services. An authenticated organization member may therefore obtain root terminal access or read logs and statistics for resources outside their authorized scope.
Affected context
The issue occurs in Dokploy WebSocket handlers that provide terminal, container log, and container statistics functionality. It becomes risky when organization membership is treated as sufficient authorization without also checking service-level permissions, allowed server identifiers, or the specific services a user may access.
Exploit preconditions
- Attack surface: Dokploy WebSocket endpoints for terminals, container logs, and container statistics
- Required access: An authenticated account belonging to the relevant organization
- Trigger point: Establishing or using a WebSocket session for a restricted server or service
- Why exploitation is possible: The handlers validate organization membership but do not consistently enforce resource-level authorization checks such as service access, permitted server identifiers, or permitted services
Why this happens
The underlying flaw is an authorization design gap in which a coarse organization-level check is performed without enforcing authorization for the specific resource requested. This behavior maps to CWE-862: Missing Authorization, because authenticated users can reach privileged functionality without a complete check that they are permitted to access the targeted server or service.
Potential impact
- An organization member may obtain terminal access to a restricted container or server
- An attacker may execute commands with the privileges available to the terminal session
- Sensitive container logs may be disclosed
- Operational statistics for restricted services may be exposed
- Compromised services or servers could be used for lateral movement within the deployment environment
General mitigation guidance
Mitigation generally focuses on enforcing authorization at every WebSocket entry point and for every requested resource.
Common defensive patterns include:
- Applying centralized, deny-by-default authorization checks to terminal, logs, and statistics handlers
- Verifying both organization membership and server-, service-, and action-level permissions
- Deriving allowed server and service identifiers from the authenticated session rather than trusting client-supplied resource references
- Rechecking authorization when a session changes scope or accesses a new resource
- Running terminal processes with the least privileges appropriate to their operational role
- Limiting sensitive data returned through logs and metrics to resources explicitly authorized for the user
How teams detect issues like this
Organizations can look for missing resource-level authorization through:
- Static analysis and code review rules that identify WebSocket handlers lacking centralized permission checks
- Review signals where organization membership is checked without validation of server, service, or action scope
- Authorization tests covering cross-server and cross-service access attempts for every WebSocket operation
- Policy enforcement requiring deny-by-default authorization middleware for privileged real-time endpoints
- Audit logging and alerting for terminal sessions or log and statistics requests involving resources outside a user's assigned scope
- Automated security review tools that correlate authentication checks with downstream resource authorization

