Summary
An authorization bypass in Coolify's terminal WebSocket bootstrap routes allows authenticated users to access terminal sessions for resources beyond their permitted scope.
Under certain conditions, this can enable execution of commands on servers, applications, or databases that the user should not be able to control, significantly expanding the blast radius of any compromised account.
Affected context
This vulnerability arises in deployments of Coolify where terminal access is exposed via WebSocket routes to manage servers, applications, or databases.
It manifests when the terminal bootstrap routes are reachable within an authenticated session but are not consistently guarded by the same authorization middleware used elsewhere.
The issue primarily affects environments where multiple users or tenants share infrastructure and where role-based or resource-scoped permissions are expected to protect terminal functionality.
Exploit preconditions
- Attack surface: Coolify web interface and associated terminal WebSocket endpoints.
- Required access: An authenticated Coolify user account with any level of access to the application.
- Trigger point: Initiating or hijacking a terminal session through the vulnerable WebSocket bootstrap routes that lack proper authorization checks.
- Why exploitation is possible: The authorization middleware is not correctly enforced on specific terminal-related routes, allowing session context alone to open terminal access to resources outside the user's permitted scope.
Why this happens
The underlying bug class is an authorization control failure where access control checks are missing or inconsistently applied to sensitive endpoints.
In this case, terminal WebSocket bootstrap routes handling command execution on managed resources do not enforce the expected middleware that validates whether a user is permitted to interact with a specific server, application, or database.
This aligns with CWE-863: Incorrect Authorization, where a system verifies that a request is authenticated but does not ensure that the requester is authorized to perform the requested action on the targeted resource.
Potential impact
- An authenticated user may execute arbitrary commands on servers, applications, or databases they are not explicitly authorized to manage.
- Tenant isolation and project-level segregation can be undermined, enabling cross-tenant resource access.
- Attackers can pivot from a low-privileged account to broader infrastructure control.
- Configuration data, application code, and stored secrets may be read, modified, or deleted.
- Operational disruption through service downtime, data corruption, or destructive commands can occur.
General mitigation guidance
Effective mitigation focuses on applying consistent, centralized authorization controls around all sensitive terminal and management endpoints.
Recommended patterns include:
- Ensuring that every route enabling terminal or command execution is protected by a shared authorization middleware that enforces resource-level permissions.
- Designing route handlers so that resource identifiers (e.g., server, application, database IDs) are always resolved against the authenticated user's allowed scope before establishing terminal sessions.
- Adopting a default-deny approach: treat terminal functionality as highly privileged, requiring explicit checks and minimal roles to access.
- Implementing clear separation of duties between read-only management views and terminal/command capabilities, with distinct permission flags.
- Applying least privilege principles on underlying infrastructure so that terminal sessions have constrained access even if misrouted.
How teams detect issues like this
Detection typically involves a combination of code-level and behavioral analysis:
- Static analysis or manual code review focused on identifying sensitive WebSocket or API routes that bypass or duplicate authorization logic instead of using centralized middleware.
- Verification that route definitions for terminal and command execution paths reference standardized access-control mechanisms and resource-scoping helpers.
- Logging and monitoring of terminal session creation events, including user identity and targeted resource, to flag anomalies such as users opening sessions on unfamiliar or unauthorized projects.
- Periodic access control audits that reconcile configured permissions with observed actions, using automated security testing or policy-enforcement tools to validate that only expected roles can trigger terminal endpoints.

