Summary
Coolify improperly interpolates user-controlled persistent volume names into shell commands executed on managed servers without escaping or validation.
An authenticated member can inject shell metacharacters into volume names and trigger command execution as root when volume operations run, making deployments and server management workflows risky.
Affected context
This vulnerability occurs in Coolify's server and application management workflows where persistent volumes are created, modified, or removed via the web interface.
Deployments are affected when:
- Volume names are taken from user input
- These names are embedded directly into shell commands on managed servers
- The commands are executed with elevated privileges, often as root
It is most relevant in multi-user environments where members have access to configure storage or deployment settings.
Exploit preconditions
- Attack surface: Coolify web interface and API endpoints that manage persistent volumes
- Required access: Authenticated member access with permission to create or manage volumes
- Trigger point: Execution of server-side shell commands that include the volume name (e.g., volume create/delete/attach operations)
- Why exploitation is possible: User-controlled volume names are concatenated into shell command strings without quoting or validation, allowing shell metacharacters and command sequences to be executed with root privileges on the managed server.
Why this happens
The underlying issue is a classic command injection pattern where untrusted input is directly embedded in shell command lines.
Instead of treating the volume name as data and safely passing it as a parameter, Coolify constructs commands using string interpolation, leaving the shell to interpret special characters such as ;, &&, |, or $().
This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where failure to escape or validate input allows attackers to alter the intended command and execute arbitrary operations.
Potential impact
- An attacker may execute arbitrary commands as root on managed servers.
- An attacker could install malware or backdoors on affected infrastructure.
- An attacker may read, modify, or delete application and database data hosted on those servers.
- An attacker could disrupt deployments and system availability by corrupting volumes or system files.
- An attacker may pivot to other services or networks reachable from the compromised server.
General mitigation guidance
Effective mitigation focuses on treating user input as data, not part of a command line.
Common defensive patterns include:
- Avoiding shell-based command construction and using OS APIs or libraries that accept structured arguments.
- When shell commands are unavoidable, strictly validating volume names against an allow-list of safe characters and formats.
- Properly quoting and escaping arguments so that the shell interprets them only as literals, not control characters.
- Running server-side operations with least-privilege accounts and minimizing root-level execution.
- Segregating management interfaces and limiting which roles can define or modify volume-related settings.
How teams detect issues like this
Organizations can identify similar vulnerabilities by:
- Using static analysis rules to flag string concatenation or interpolation when building shell commands with user-supplied values.
- Reviewing code for calls to
exec,system, or shell wrappers that accept unvalidated parameters from HTTP requests or configuration fields. - Implementing secure coding guidelines that prohibit direct shell invocation for routine management tasks and require parameterized execution.
- Employing automated security testing (e.g., dynamic analysis or fuzzing) to send crafted volume names and detect unexpected command behavior on test systems.

