/

CVE-2026-59734

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Coolify Health Checks

CVE-2026-59734

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution within deployment containers

Severity:

HIGH RISK

(8.8)

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.469 contain an OS command injection flaw in the application deployment health check logic.

Authenticated users who can configure health check parameters may inject shell metacharacters into deployment commands, leading to arbitrary command execution inside deployment containers.

Affected context

This vulnerability affects Coolify deployments where users are allowed to configure application health checks for deployments.

The issue occurs in the generate_healthcheck_commands() function, which builds shell commands using the health_check_host, health_check_method, and health_check_path parameters.

When these values come from user-controlled configuration and are executed as shell commands inside deployment containers without strict sanitization or escaping, they may enable command injection.

Exploit preconditions

  • Attack surface: Application deployment and health check configuration in the Coolify UI or API
  • Required access: Authenticated access with permissions to create or modify application health check settings
  • Trigger point: Execution of the generated health check commands during or after application deployment
  • Why exploitation is possible: User-supplied values are directly interpolated into shell commands without proper escaping or argument separation, allowing shell metacharacters to alter command structure

Why this happens

The underlying bug class is OS command injection, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

In ApplicationDeploymentJob::generate_healthcheck_commands(), user-configurable fields such as health_check_host, health_check_method, and health_check_path are concatenated into shell command strings.

Because these values are not safely escaped, validated, or passed as discrete arguments to an execution API that avoids shell interpretation, the shell treats embedded special characters as control operators.

This design implicitly trusts configuration input and conflates data with command syntax, enabling attackers to inject additional commands or modify the command's behavior.

Potential impact

  • Execution of arbitrary commands inside deployment containers
  • Unauthorized access to application data or environment variables within the container
  • Lateral movement to other services reachable from the compromised container
  • Tampering with deployed applications, including configuration or filesystem modifications
  • Use of compromised containers as a pivot point for further attacks in the infrastructure

General mitigation guidance

Effective mitigation focuses on separating untrusted data from command logic and minimizing shell usage.

Common defensive patterns include:

  • Avoiding direct shell invocation where possible and using high-level libraries or APIs to perform health checks (e.g., HTTP clients) instead of shelling out
  • When commands are unavoidable, using process execution APIs that pass arguments as arrays instead of a single shell-parsed string
  • Strictly validating and constraining health check parameters to expected formats (e.g., whitelisting HTTP methods and validating host/path patterns)
  • Applying proper escaping and neutralization of shell metacharacters on any user-supplied input that might influence commands
  • Running deployment and health check processes with the least privileges necessary and isolating containers to limit blast radius

How teams detect issues like this

Detection typically combines code-level analysis with configuration review:

  • Static analysis rules that flag string concatenation or interpolation into shell execution functions within deployment or health check code paths
  • Code review checklists that highlight any use of shell commands built from request parameters or configuration fields
  • Runtime monitoring for anomalous command executions from deployment containers, such as unexpected utilities or outbound connections
  • Configuration audits to identify health check definitions containing suspicious shell metacharacters or patterns unlikely in normal URLs or hosts

Automated SAST or CI-integrated security scanners can help identify command construction patterns that mix untrusted input with shell syntax.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/commit/0ffcee7a4dcd24f92b5fab8c9c7be140b9532733
github.comgithub.com/coollabsio/coolify/pull/9007
github.comgithub.com/coollabsio/coolify/releases/tag/v4.0.0-beta.469
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-4fhp-xqqp-w7vv

Frequently asked

questions

It is remotely exploitable in the sense that an attacker with network access to the Coolify interface and valid credentials can configure malicious health checks, which are then executed in containers.

The attacker must be an authenticated user with permissions to create or modify application deployment health check settings; unauthenticated users typically cannot exploit this directly.

Replace shell-based health checks with direct library calls or structured APIs, and where commands are unavoidable, avoid passing concatenated strings to a shell; instead, use parameterized execution that treats all user input as data, not command syntax.

Establish secure coding guidelines that prohibit building shell commands from user-controlled input, enforce rigorous input validation, and integrate automated security testing and code review practices focused on identifying injection patterns in deployment and configuration handling code.

Find out what's already
exploitable in your codebase.