Summary
An authenticated command injection vulnerability in Coolify's CA Certificate management feature allows arbitrary command execution on managed servers.
When any logged-in user abuses this flaw, they can run commands as the configured SSH user, which often has elevated privileges, risking full server and container compromise.
Affected context
This vulnerability appears in Coolify deployments that use the CA Certificate management feature to interact with managed servers over SSH.
It becomes relevant when the SSH user configured for Coolify has high privileges, such as root or membership in the docker group, and user input from the certificate management interface is passed into shell commands without robust sanitization or escaping.
Any environment where multiple authenticated users can access server management functions is exposed to elevated risk, particularly in multi-tenant or shared administration setups.
Exploit preconditions
- Attack surface: Coolify web interface, specifically the CA Certificate management functionality.
- Required access: Valid authenticated account on the Coolify instance; no special role is required if certificate management is accessible to standard users.
- Trigger point: Submission of crafted certificate-related data or fields that are interpolated directly into shell commands executed via SSH on the managed host.
- Why exploitation is possible: User-controlled values are concatenated or injected into command lines without strict validation, escaping, or use of safe command execution APIs, enabling the attacker to break out of the intended command structure.
Why this happens
The core issue maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS Command Injection).
Coolify's CA Certificate management logic likely builds shell commands by interpolating user-supplied data into command strings, then executing them over SSH.
Without rigorous neutralization of metacharacters or the use of parameterized, non-shell-based execution mechanisms, the application treats untrusted input as part of the command, allowing attackers to append additional commands or alter execution flow.
Potential impact
- An attacker may execute arbitrary commands as the configured SSH user on the managed server.
- They could gain full control over the host operating system when the SSH user is root.
- The attacker may manage, modify, or destroy Docker containers when the SSH user is in the docker group.
- They could exfiltrate sensitive data, credentials, or configuration files from the managed server.
- The attacker can install backdoors, pivot to other systems, or use the compromised server for further attacks.
General mitigation guidance
Mitigation generally involves removing unsafe shell command construction patterns and tightening the trust boundary around user input.
Common defensive approaches include:
- Avoiding direct shell invocation for certificate or server management tasks; prefer well-tested libraries and APIs that do not expose command-line concatenation.
- If shell commands are unavoidable, using strict whitelisting and fixed command templates where user input is limited to validated, strongly typed parameters.
- Employing robust input validation that rejects or safely encodes metacharacters, control operators, and other shell-sensitive syntax.
- Running SSH users and server-side processes with least privilege, avoiding root or docker group membership unless absolutely necessary.
- Isolating management functions so that only trusted administrative roles can trigger commands that touch server configuration or certificates.
How teams detect issues like this
Detection often combines code-centric and operational techniques:
- Static analysis rules and linters that flag dynamic shell command construction, particularly uses of
exec,system, or direct command strings containing interpolated variables. - Security-focused code review practices that look for places where user input flows into command execution layers or SSH calls without validation.
- Runtime monitoring and logging on managed servers to detect anomalous commands originating from Coolify, including unexpected utilities, network tools, or privilege escalation attempts.
- Policy-based controls in CI/CD pipelines that require approval for changes to server management or certificate handling code, and automated scans targeting command injection patterns.

