Summary
A command injection vulnerability in Coolify's database import Livewire component allows user-controlled container and server parameters to reach shell commands without proper validation or locking.
When an authenticated user can supply a crafted database import container name, this flaw may enable arbitrary command execution on the underlying server.
Affected context
This vulnerability occurs in Coolify's project database import functionality, specifically within the Livewire component responsible for orchestrating import operations.
It is relevant in deployments where:
- Users can create or manage database import tasks
- Container names or server-related properties are derived from user-controllable input
- Shell commands are used to drive container or database operations without robust input validation
Under these conditions, crafted input can flow from the user interface to shell execution paths.
Exploit preconditions
- Attack surface: Web interface for project database import operations
- Required access: Authenticated access to a Coolify project with permission to perform database imports
- Trigger point: Initiation of a database import where the container name or related server properties are taken from user input
- Why exploitation is possible: The Livewire component passes client-controlled values directly into shell commands without enforcing strict validation, escaping, or structural checks, enabling command injection through specially crafted names.
Why this happens
The root cause aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
In this case, the application constructs shell commands using dynamic values like container name and server parameters obtained from the client.
Because these values are not sufficiently validated, escaped, or constrained to safe character sets and formats, the shell interprets portions of the input as additional commands or arguments.
Abstractly, the insecure pattern is direct concatenation or interpolation of untrusted input into command strings, treating user-controlled data as if it were trusted configuration.
Potential impact
- An authenticated user may execute arbitrary commands on the Coolify host server.
- Attackers could access or tamper with managed applications and databases.
- Compromise of sensitive data stored on the server or connected infrastructure.
- Lateral movement across other services or containers managed by Coolify.
- Disruption of service availability through destructive or resource-exhausting commands.
General mitigation guidance
Effective mitigation focuses on removing direct command construction with untrusted data and reducing the trust boundary around user-supplied parameters.
Common patterns include:
- Using high-level APIs, SDKs, or libraries for container and database management instead of raw shell commands.
- Strictly validating and normalizing input fields like container names and server identifiers to allowed formats and character sets.
- Employing parameterized command execution or safe wrappers that do not invoke a shell interpreter.
- Applying least-privilege policies to the processes performing imports, so that even if a flaw exists, resulting damage is limited.
- Designing workflows so that client-controlled identifiers are mapped to internal, server-side references rather than used directly in command lines.
How teams detect issues like this
Detection generally relies on identifying insecure command construction patterns and abnormal runtime behavior.
Useful approaches include:
- Static analysis rules that flag string concatenation or interpolation of user-derived data into shell command APIs.
- Code review practices that focus on Livewire components and backend services where user input drives operational commands.
- Logging and monitoring of command execution, looking for unexpected arguments, special characters, or commands originating from user-facing workflows.
- Policy-based enforcement in CI/CD to block deployments that use shell execution with untrusted variables without prior sanitization.

