/

CVE-2025-64419

Severity:

CRITICAL RISK

(9.6)

Command Injection in Coolify

CVE-2025-64419

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-77

Impact:

Remote Code Execution as root on the Coolify host

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Coolify versions prior to 4.0.0-beta.445 contain a command injection flaw where parameters from docker-compose.yaml are passed unsanitized into shell commands.

If a user creates an application from a malicious repository using the "docker compose" build pack, an attacker can execute arbitrary commands on the Coolify instance with root privileges.

Affected context

This vulnerability manifests in Coolify deployments that:

  • Allow users to create applications using the "docker compose" build pack
  • Consume docker-compose.yaml content from external repositories (e.g., Git)
  • Construct shell or CLI commands directly from values in docker-compose.yaml without robust sanitization or escaping

The risk is most pronounced when users connect repositories they do not fully control or trust, since repository owners can influence docker-compose parameters that Coolify uses in commands.

Exploit preconditions

  • Attack surface: Coolify's application creation and deployment workflow using the "docker compose" build pack.
  • Required access: Ability to control or influence the repository from which a victim user creates an application (e.g., owning the repo, or convincing the victim to use an attacker-controlled repo).
  • Trigger point: The moment Coolify parses docker-compose.yaml and constructs shell commands that include unsanitized parameters.
  • Why exploitation is possible: User-controlled values from docker-compose.yaml are interpolated into shell commands without proper validation, escaping, or use of safer, argument-based process execution APIs, enabling attackers to inject additional shell syntax.

Why this happens

The underlying issue aligns with CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').

Coolify's code path for handling docker-compose-based applications takes parameters from docker-compose.yaml and embeds them directly into shell commands.

Because these values are treated as part of a command string instead of distinct arguments, shell metacharacters (such as separators, redirection, or subcommands) can alter the intended command structure.

This pattern converts configuration data into executable shell logic without neutralizing special characters, allowing attacker-controlled configuration to break out of its expected role and execute arbitrary commands.

Potential impact

  • Execution of arbitrary commands on the Coolify host as root.
  • Complete compromise of the Coolify instance, including stored credentials and configuration.
  • Lateral movement to other services, containers, or networks managed by the affected server.
  • Modification or destruction of hosted applications and databases.
  • Installation of persistent backdoors, cryptominers, or additional malware.

General mitigation guidance

Effective mitigation centers on treating all configuration-sourced values as untrusted and strictly separating data from commands:

  • Use APIs that pass arguments as arrays (e.g., exec with argument vectors) instead of building shell command strings from concatenated text.
  • Apply rigorous validation to docker-compose parameters, enforcing strict allowlists for expected values, formats, and character sets.
  • Neutralize or reject values containing shell metacharacters or other control characters that are not necessary for legitimate operation.
  • Encapsulate command execution within restricted contexts (e.g., non-root users, constrained containers, or sandboxes) to limit impact if a flaw occurs.
  • Minimize the privileges of the Coolify process and associated service accounts, following least-privilege principles.

These patterns reduce the risk that future changes to docker-compose handling reintroduce command injection vectors.

How teams detect issues like this

Organizations can detect and monitor for similar issues and potential exploitation using a combination of code-level and operational approaches:

  • Static analysis: Configure SAST tools or custom rules to flag string-based command construction, especially where user-controlled or configuration-derived values are concatenated into shell commands.
  • Code review patterns: During review, treat any use of shell execution APIs as high-risk; look specifically for direct inclusion of values from docker-compose.yaml or other external configuration files.
  • Security policies: Establish guidelines that prohibit shell command construction from untrusted input and encourage the use of parameterized process execution.
  • Runtime monitoring: Use host and container monitoring to detect unusual command patterns, unexpected child processes spawned by Coolify, or commands executing from deployment workflows.
  • CI/CD checks: Integrate automated code scanning and policy enforcement into the development pipeline to catch new command injection patterns before deployment.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/commit/f86ccfaa9af572a5487da8ea46b0a125a4854cf6
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-234r-xrrg-m8f3

Frequently asked

questions

Exploitability depends on who controls the repositories used by Coolify. If users routinely deploy applications from third-party or untrusted repositories using the "docker compose" build pack, attackers can potentially exploit this flaw remotely by crafting malicious docker-compose.yaml files.

An attacker needs the ability to provide or influence the repository from which a victim user creates an application in Coolify. They do not need shell access to the server; the exploitation occurs when Coolify processes the attacker-controlled docker-compose.yaml.

The most robust fix is to eliminate shell string construction from untrusted data entirely, using safe process execution APIs with explicit argument lists and strict validation/allowlisting of configuration values before they are passed to any command.

Adopt a defensive design approach where all external configuration is treated as untrusted, enforce coding standards that prohibit command construction from raw input, and integrate static analysis plus security-focused code review to catch command injection patterns early in the development lifecycle.

Find out what's already
exploitable in your codebase.