Summary
Coolify's server management interface exposes Livewire methods that interpolate a browser-supplied container ID directly into shell commands executed over SSH.
Any authenticated team member who can access these controls may execute arbitrary OS commands on managed servers by manipulating this parameter.
Affected context
This vulnerability appears in Coolify installations where:
- The Server\Resources Livewire component is deployed
- Users can invoke
startUnmanaged,stopUnmanaged, orrestartUnmanagedactions - The application issues shell commands over SSH to managed servers using user-controlled identifiers
The risk is heightened in multi-user environments where team members share access to the same Coolify instance and managed infrastructure.
Exploit preconditions
- Attack surface: Web-based server management UI backed by a Livewire component.
- Required access: Authenticated team membership with permission to manage unmanaged containers or servers.
- Trigger point: Invocation of
startUnmanaged,stopUnmanaged, orrestartUnmanagedwhere the container ID parameter is provided by the browser. - Why exploitation is possible: The container ID parameter is accepted as-is, not sanitized or escaped, and is directly interpolated into shell commands executed via SSH, allowing crafted values to break out of the intended command context.
Why this happens
The root cause is direct insertion of untrusted user-controlled input into shell commands without robust validation, escaping, or use of safer APIs.
This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where parameters received from the client are concatenated into command strings and executed by the operating system.
Rather than treating the container ID as data passed through a constrained interface (such as a parameterized API or library call), the design relies on string-based command construction, making it vulnerable to command injection.
Potential impact
- Execution of arbitrary OS commands on managed servers via the Coolify control plane
- Complete compromise of affected servers, including data exfiltration or modification
- Deployment of unauthorized software or backdoors on managed infrastructure
- Disruption of hosted applications and databases through stopping, altering, or destroying services
- Lateral movement across environments managed by the same Coolify instance
General mitigation guidance
Effective mitigation focuses on eliminating direct command-string construction with untrusted data and constraining what actions can be performed on remote servers.
Useful patterns include:
- Replacing raw shell command concatenation with high-level libraries or APIs that accept arguments as separate parameters rather than as a single string
- Implementing strict server-side validation of identifiers (e.g., restricting container IDs to a vetted set, or matching against known records in the database)
- Applying rigorous escaping of any dynamic values that must be used in shell contexts, using language-appropriate escaping utilities
- Introducing a permission model that limits which users can perform server-control operations, aligned with the principle of least privilege
- Isolating the execution environment for server commands, for example through dedicated service accounts with minimal privileges, so that a compromise of the command path yields reduced impact
How teams detect issues like this
Detection can leverage both code-centric and operational approaches:
- Static analysis rules that flag concatenation of user-controlled values into shell commands, particularly around Livewire components or server-control logic
- Code review checklists that require reviewers to inspect any SSH or command-execution paths for proper input handling and the use of safe APIs
- Application-level logging that records server-control invocations, including which user initiated actions and what parameters were passed, to support anomaly detection
- Security testing (including automated dynamic analysis) that attempts to inject shell metacharacters into parameters used for server or container management operations
Teams may also configure policy enforcement in CI to prevent merging of changes that introduce new direct command execution paths with untrusted inputs.

