Summary
Coolify versions prior to 4.0.0-beta.466 contain an OS command injection vulnerability in the Sentinel settings, where the sentinel_token value is embedded into shell commands without proper validation.
An authenticated user with access to Sentinel server settings can inject shell syntax into this token, leading to arbitrary command execution on the host when Sentinel is restarted.
Affected context
This vulnerability arises in Coolify deployments where Sentinel integration is enabled and administrators or privileged users can configure the sentinel_token setting.
The issue occurs when the application constructs shell commands that incorporate this token without sanitizing or constraining its content, and then executes them during Sentinel restart or management operations.
Risk is elevated in environments where Sentinel restarts are performed routinely or triggered through automated workflows, increasing the chances of a malicious token being executed.
Exploit preconditions
- Attack surface: Coolify web interface or API managing Sentinel settings
- Required access: Authenticated account with permission to configure server Sentinel settings, including sentinel_token
- Trigger point: A Sentinel restart or any operation that builds and executes shell commands containing the sentinel_token
- Why exploitation is possible: The application directly interpolates the sentinel_token into shell command strings without validation, escaping, or restriction, allowing attackers to inject additional shell syntax and arbitrary commands.
Why this happens
The underlying issue is a classic OS command injection (CWE-78) bug.
Application code builds shell commands using string concatenation or interpolation that includes the sentinel_token value, treating it as trusted input.
Because the token is not validated, escaped, or constrained to a safe format, an attacker can provide token values containing shell metacharacters (such as &&, ;, or backticks), which the shell interprets as separate commands.
This insecure pattern of passing untrusted data directly into command execution APIs leads to arbitrary command execution on the host system whenever the constructed command is run.
Potential impact
- An attacker may execute arbitrary commands on the host system running Coolify.
- An attacker could create, modify, or delete files on the server, including application data and configuration.
- An attacker may install additional malware or backdoors, enabling persistent access.
- An attacker could exfiltrate sensitive data from applications, databases, or environment variables.
- An attacker may pivot to other systems in the network using the compromised host as a launching point.
General mitigation guidance
Mitigation typically focuses on avoiding the direct use of untrusted input in shell commands and reducing the privileges of any command execution paths.
Recommended patterns include:
- Replacing shell-based command construction with parameterized, high-level APIs or libraries that accept structured arguments rather than raw command strings.
- Strictly validating and constraining configuration values such as tokens to a limited character set and expected format, rejecting or normalizing unsafe input.
- Escaping or quoting values that must be passed to commands, and avoiding shell interpretation when possible by using exec-style APIs.
- Running any helper processes (including Sentinel management routines) with least privilege and separated from core host administrative rights.
- Limiting who can modify Sentinel-related settings and enforcing strong authentication and authorization controls around such configuration pages.
How teams detect issues like this
Detection often relies on both code-focused and operational measures:
- Static analysis rules that flag string concatenation or interpolation involving user-configurable values being passed into shell execution functions (e.g.,
exec,system,spawn, or subprocess shells). - Code review practices that focus on configuration-driven command execution paths, looking for untrusted data included directly in command strings.
- Centralized logging of Sentinel management operations and command execution, combined with anomaly detection to identify unusual or suspicious command patterns.
- Security policies in CI/CD that disallow shell invocation for routine tasks when safer APIs are available, and require explicit justification for any remaining shell-based logic.
- Optional use of automated security testing tools (SAST/DAST) configured to identify OS command injection patterns in configuration-driven workflows.

