Summary
Coolify's terminal WebSocket bootstrap routes previously authenticated users but did not verify whether they were authorized to access specific terminals.
Under these conditions, a low-privileged team member could open terminal sessions and execute commands on team servers they should not control.
Affected context
This vulnerability arises in Coolify deployments where multiple team members share access to the same Coolify instance and terminals are exposed through WebSocket-based routes.
The affected context is the terminal bootstrap endpoints, which verified that a user was logged in but did not enforce per-terminal or per-server authorization.
Environments with shared or delegated access, such as teams managing many servers or applications, are particularly exposed if role boundaries are expected to limit who can run commands on which servers.
Exploit preconditions
- Attack surface: Coolify terminal WebSocket endpoints exposed via the web interface or API
- Required access: Valid but low-privileged Coolify account within a team
- Trigger point: Initiating a WebSocket connection to terminal bootstrap routes and attaching to terminals not intended for the user
- Why exploitation is possible: The server only checked that the user was authenticated, not whether they were authorized for the target terminal session, creating a privilege escalation path
Why this happens
The core issue is an authorization control weakness where access control checks stop at authentication.
The terminal WebSocket bootstrap logic confirms that a user is logged in but does not perform fine-grained checks to ensure that the user is permitted to create or attach to a given terminal session.
This pattern maps to CWE-285: Improper Authorization and is closely related to CWE-862: Missing Authorization, where business logic assumes that authenticated users are inherently allowed to access sensitive functionality without additional verification of role, ownership, or resource-level permissions.
Potential impact
- A low-privileged team member could execute arbitrary shell commands on servers managed by Coolify.
- Attackers could modify, delete, or exfiltrate application data and configuration from affected servers.
- Compromised servers could be used as a pivot point for broader network intrusion or lateral movement.
- Service downtime, data corruption, or deployment pipeline sabotage could occur through misuse of terminal access.
General mitigation guidance
Mitigation generally focuses on enforcing resource-level authorization for all interactive and high-impact operations.
Recommended defensive patterns include:
- Applying consistent role-based or attribute-based access checks on terminal endpoints, ensuring that only permitted users can start or attach to sessions for a given server.
- Treating authenticated identity and authorization as separate steps, explicitly checking ownership or team permissions for each terminal action.
- Centralizing authorization logic so that new routes (such as WebSocket handlers) inherit the same access policies as REST endpoints.
- Minimizing the privileges available to default or low-level roles and limiting which users can gain interactive shell access to production servers.
- Logging and monitoring all terminal session creation and command activity to support detection and incident response.
How teams detect issues like this
Detection strategies can center on both code-level and operational indicators:
- Static and code review: Look for WebSocket or terminal-related routes that validate authentication but lack explicit authorization checks tied to resource identifiers (server, project, or team).
- Access control policies: Enforce patterns where every sensitive route requires permission checks based on user role and resource ownership; deviations should be flagged in reviews.
- Automated analysis: Configure linters or security scanners to flag endpoints that expose shell, deployment, or administrative functionality without a corresponding authorization check.
- Runtime monitoring: Analyze audit logs for unexpected terminal sessions initiated by low-privileged users, unusual access patterns across projects, or commands executed from atypical accounts.

