CVE-2026-27955: Coolify Command Injection via Docker Compose Configuration
Coolify, a self-hosted platform for managing servers and applications, contains a command injection vulnerability in versions before 4.0.0-beta.464. When administrators configure custom Docker build or start commands through the web interface, their input is passed unsafely to a bash shell without proper escaping. An attacker with admin-level access can inject shell metacharacters—specifically unescaped single quotes—to break out of the intended sandboxed context and execute arbitrary commands directly on the host server, rather than within a Docker container where they belong. This grants them the ability to read files, modify configurations, or compromise the underlying infrastructure.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 6.6 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:L
- Weaknesses (CWE)
- CWE-78
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-30 / 2026-06-30
NVD description (verbatim)
Coolify is an open-source and self-hostable tool for managing servers, applications, and databases. Prior to 4.0.0-beta.464, the executeInDocker() helper wraps commands in bash -c '{$command}' without escaping single quotes. User-controlled docker_compose_custom_build_command and docker_compose_custom_start_command fields are interpolated directly, allowing a single quote to break out of the bash -c argument and execute commands on the managed server host (outside the intended Docker container context). This vulnerability is fixed in 4.0.0-beta.464.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability resides in the executeInDocker() helper function, which constructs bash commands using the pattern bash -c '{$command}'. User-supplied values from docker_compose_custom_build_command and docker_compose_custom_start_command parameters are interpolated directly into this string without quote escaping. Because single quotes in bash mark literal string boundaries, an attacker can close the intended quoted argument with a single quote, inject a semicolon or pipe operator, and append arbitrary shell syntax. The bash shell then interprets the injected code in the host execution context, not within the Docker environment. Proper remediation requires either parameterized command construction (avoiding shell interpretation) or comprehensive escaping of all shell metacharacters before interpolation.
Business impact
For organizations using Coolify to manage multi-tenant or multi-application infrastructure, this vulnerability means that any administrator account compromise—or intentionally malicious admin—can escape container isolation and gain host-level command execution. This breaks the security boundary that containerization is supposed to provide. An attacker could exfiltrate data across all hosted applications, modify infrastructure configurations, install persistence mechanisms, or disrupt service availability. The blast radius extends beyond a single application to the entire managed infrastructure. Organizations relying on role-based separation between application and infrastructure tiers lose that protection.
Affected systems
Coolify versions prior to 4.0.0-beta.464 are affected. The vulnerability requires authenticated access at the administrator level to exploit, since the vulnerable fields (custom build and start commands) are typically available only to admins who configure the Docker Compose orchestration. Self-hosted instances are the primary deployment model for Coolify, meaning affected users operate their own infrastructure and bear the full impact of compromise.
Exploitability
Exploitation requires valid administrator credentials; there is no unauthenticated or low-privilege attack path. However, once an attacker has admin access—whether through credential theft, insider threat, or social engineering—the vulnerability is trivial to exploit: a simple payload like ' || malicious_command # ' injected into a build or start command field will execute immediately during the next container operation. The attack is reliable and requires no special conditions (CVSS AC:L reflects this low barrier). Detection by the target organization may be delayed if command execution logs are not actively monitored.
Remediation
Upgrade to Coolify version 4.0.0-beta.464 or later. This release patches the executeInDocker() function to properly escape single quotes and other shell metacharacters before interpolating user input into bash commands. Organizations should prioritize this patch for instances accessible to untrusted administrators or shared infrastructure environments. After patching, verify that custom Docker Compose commands continue to function as expected, as the escaping may alter how special characters in legitimate commands are interpreted.
Patch guidance
Apply the upgrade to version 4.0.0-beta.464 as soon as practical. The patch is focused on the command execution pathway and carries minimal risk of regression. Before deployment to production, test any custom Docker build or start commands you have configured to ensure they still behave correctly after the escaping changes. Consider this a critical update for instances with multiple administrators or shared access models. Coolify's self-hosted architecture means patches must be manually deployed; there is no automatic or server-side remediation.
Detection guidance
Monitor Coolify's application logs for admin users creating or modifying custom Docker Compose commands with suspicious content (unmatched quotes, semicolons, pipes, or command substitution syntax). Endpoint Detection and Response (EDR) tools on the host server can detect unexpected child processes spawned from the Coolify container runtime or the Coolify application process itself—a sign that command injection succeeded. In container environments, watch for host-level syscalls initiated from the Coolify process tree. Review audit logs of who modified Docker Compose settings and when. Forensic indicators include: shell syntax in the custom_build_command or custom_start_command fields, unexpected process parents, and outbound connections from the Coolify process.
Why prioritize this
This is a medium-severity issue due to its authentication requirement (PR:H in CVSS), but it directly enables host compromise in environments that explicitly trust admins to configure containers. The risk is concentrated in organizations with: (1) multiple administrators, (2) admins from different teams with separate responsibilities, (3) any risk of admin credential compromise, or (4) shared Coolify instances serving multiple customers or business units. For single-admin, air-gapped, or tightly controlled Coolify deployments, the risk is lower but still present if that admin account is ever compromised. The scope impact (S:C) reflects that host-level code execution affects infrastructure beyond the application.
Risk score, explained
CVSS 6.6 (MEDIUM) reflects: network-accessible attack surface (AV:N), no complex conditions to exploit (AC:L), requirement for high-privilege credentials to trigger (PR:H), no user interaction needed (UI:N), and scope change from container isolation to host execution (S:C). The integrity, confidentiality, and availability impacts are all rated LOW rather than HIGH because the vulnerability is bounded by the administrator's legitimate permissions to manage infrastructure—the attack does not grant new logical capabilities, only escapes the technical control that was supposed to confine execution. Organizations with strict admin identity verification and short-lived credentials may experience lower practical risk than the base score suggests.
Frequently asked questions
Do I need admin credentials to exploit this?
Yes. The vulnerable configuration fields (docker_compose_custom_build_command and docker_compose_custom_start_command) are admin-level settings. An attacker must have authenticated admin access to Coolify to inject the malicious command. This is why CVSS rates it PR:H (high privilege required).
What happens if I upgrade to 4.0.0-beta.464? Will my custom Docker commands still work?
The patch adds proper escaping to single quotes and shell metacharacters. Legitimate custom commands should continue to work, but if your commands rely on unescaped special characters, you may need to adjust them slightly. Test in a non-production environment first.
Can this vulnerability be exploited without modifying Docker Compose settings?
No. The attack vector requires the attacker to first modify the custom build or start command fields. If those fields are read-only or not accessible to an attacker's credentials, the vulnerability cannot be triggered.
If Coolify is only used by a single trusted administrator, is this a concern?
The risk is lower but not zero. If that single admin account is ever compromised through phishing, password reuse, or supply-chain attack, an attacker gains immediate host access. For added defense-in-depth, upgrade anyway, implement network segmentation, and monitor the host for suspicious process execution.
This analysis is based on CVE-2026-27955 as published and the vendor's advisory for version 4.0.0-beta.464. CVSS scoring reflects the NIST standard and is subject to organizational context; your risk may differ based on deployment model, access controls, and compensating security measures. No exploit code or weaponized proof-of-concept is provided. Always verify patch availability and compatibility with your Coolify version through the official Coolify project channels before applying updates. This is a factual, technical summary intended for security professionals and should not be substituted for vendor advisories or your own security assessment. Source: NVD (public-domain), retrieved 2026-08-09. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2026-10279MEDIUMOS Command Injection in wezterm-mcp 0.1.0
- CVE-2026-10544MEDIUMDevolutions Server PAM Command Injection Vulnerability
- CVE-2026-10805MEDIUMNetworkManager Local Privilege Escalation via Malformed MUD URL
- CVE-2026-11341MEDIUMD-Link DWR-M920 Command Injection Vulnerability – Patch & Detection Guide
- CVE-2026-11408MEDIUMOS Command Injection in vertex-app Log Viewer Endpoint
- CVE-2026-12814MEDIUMComfast CF-WR631AX V3 Command Injection Vulnerability
- CVE-2026-12815MEDIUMOS Command Injection in Coolify 4.0.0 Image Name Handler
- CVE-2026-13560MEDIUMEdimax EW-7478APC Command Injection Vulnerability