Summary
An authenticated command injection vulnerability in Coolify's GetLogs Livewire component allows low-privilege team members to influence shell commands used to retrieve container logs.
By controlling a Livewire public property that is interpolated into docker log commands without sanitization, an attacker can execute arbitrary commands as root on managed servers when log retrieval functionality is invoked.
Affected context
This vulnerability appears in Coolify instances that expose the GetLogs Livewire component to authenticated users with team membership, including the lowest privilege member role.
It is relevant when the application issues shell commands (such as docker logs and docker service logs) on managed servers and directly interpolates user-controlled data into those command strings.
The risk arises specifically when the $container Livewire public property can be modified over the wire protocol and is subsequently used without validation or escaping in command construction, under a context where those commands execute with root-level privileges.
Exploit preconditions
- Attack surface: Web interface and Livewire wire protocol used by Coolify to manage logs on connected servers.
- Required access: Authenticated access as a team member, including the lowest privilege role, with the ability to invoke the GetLogs component.
- Trigger point: Any operation that causes the GetLogs Livewire component to run shell commands (e.g., viewing container or service logs) while
$containerholds attacker-controlled content. - Why exploitation is possible: The
$containerpublic property is not locked and is therefore modifiable by the client via Livewire; its value is interpolated directly into shell command strings without sanitization, validation, or proper escaping, enabling injection of additional shell syntax and arbitrary command execution.
Why this happens
The underlying bug class maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Application logic constructs shell commands by concatenating or interpolating a Livewire public property ($container) directly into command strings (docker logs, docker service logs), assuming it is safe.
Because this property is both client-controllable through the Livewire wire protocol and not constrained or locked, input containing shell metacharacters or additional command sequences is treated as part of the command itself.
This pattern—building commands from untrusted input without normalization, whitelisting, parameterization, or escaping—creates an injection channel where the OS command interpreter executes unintended operations under the same privileges as the service.
Potential impact
- Attackers may execute arbitrary commands as root on managed servers.
- Attackers could access or modify sensitive data and configuration files on those servers.
- Attackers can install backdoors, miners, or other persistent malware on managed infrastructure.
- Attackers could disrupt running applications and databases, causing downtime or data loss.
- Attackers may pivot from managed servers to other network assets, depending on connectivity and trust relationships.
General mitigation guidance
Effective mitigation focuses on removing direct interpolation of untrusted data into shell commands and constraining the trust boundary around management operations.
Common defensive patterns include:
- Avoiding shell command construction from user-controlled values; use higher-level APIs or SDKs (e.g., Docker client libraries) that accept structured parameters instead of raw command lines.
- Enforcing strict validation on identifiers such as container names by whitelisting allowed character sets and rejecting any content with shell metacharacters or unexpected syntax.
- Treating Livewire public properties as untrusted inputs and applying locking or equivalent mechanisms to prevent arbitrary client-side modification where appropriate.
- Running management agents and command execution components with least-privilege accounts rather than root, limiting damage if a command path is abused.
- Centralizing command execution logic behind a well-reviewed abstraction layer that applies canonical sanitization rules and prohibits direct command-line concatenation.
How teams detect issues like this
Organizations can identify similar command injection issues through:
- Static analysis rules that flag string concatenation or interpolation into command execution APIs (e.g.,
exec,shell_exec, process spawning calls) where data originates from HTTP requests, WebSocket messages, or Livewire properties. - Code review practices that focus on any layer which interacts with OS commands, looking for dynamic command construction and verifying that only validated, constrained inputs are used.
- Security policies requiring parameterized execution via APIs or libraries for infrastructure management tasks instead of constructing shell commands manually.
- Automated application security testing (DAST) that sends payloads containing shell metacharacters through log-related or management interfaces and monitors for anomalous behavior on target servers.

