/

CVE-2026-84694

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Coolify SSH Deploy

CVE-2026-84694

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on Managed Server Hosts

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 contains an OS command injection vulnerability in Docker commands executed over SSH when environment variable key names are not properly escaped. An authenticated attacker who can control affected environment variable keys may execute arbitrary commands on a managed server host outside its containers.

Affected context

The vulnerability occurs in Coolify deployments that use managed servers and execute Docker-related commands over SSH. It becomes risky when an authenticated user can influence environment variable key names that are incorporated into shell commands without complete escaping or safe argument handling.

Exploit preconditions

  • Attack surface: SSH-based command execution on a Coolify-managed server
  • Required access: Authenticated access sufficient to create or modify deployment environment variables
  • Trigger point: Construction and execution of a Docker command containing an attacker-controlled environment variable key
  • Why exploitation is possible: Shell metacharacters in the key name may be interpreted as command syntax rather than treated as data

Why this happens

The underlying bug is failure to treat environment variable key names as untrusted data when constructing shell commands. If user-controlled values are concatenated into a command without robust argument handling or context-aware escaping, shell metacharacters can alter command interpretation. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.

Potential impact

  • An attacker may execute arbitrary commands on the managed server host
  • The attacker could access host files, credentials, or deployment data permitted to the command context
  • Running services and deployment workloads may be modified or disrupted
  • The server could be used for lateral movement or further compromise
  • Container isolation may be bypassed where host-level command execution is available

General mitigation guidance

Mitigation generally focuses on preventing user-controlled strings from becoming shell syntax.

Common defensive patterns include:

  • Passing command arguments through structured process-execution APIs instead of shell-evaluated strings
  • Applying strict allowlists for environment variable key names and rejecting invalid characters
  • Separating command construction from data serialization and using safe argument encoding
  • Reducing the privileges of the SSH account and deployment automation
  • Limiting access to managed-server configuration and deployment controls
  • Avoiding unnecessary host-level capabilities and isolating deployment workers where practical

How teams detect issues like this

Detection approaches may include:

  • Static analysis searches for shell command construction involving environment variable names or other user-controlled fields
  • Code review checks for string concatenation, interpolation, or shell wrappers around Docker and SSH commands
  • Runtime monitoring for unexpected child processes, shell metacharacters, or commands launched by deployment identities
  • Policy enforcement requiring structured process APIs, input allowlists, and least-privilege service accounts
  • Automated security review tools that flag command execution paths receiving externally controlled input

Sources

SourceLink
github.comgithub.com/coollabsio/coolify
github.comgithub.com/coollabsio/coolify/blob/v4.1.2/app/Policies/ApplicationPolicy.php
github.comgithub.com/coollabsio/coolify/blob/v4.1.2/app/Support/ValidationPatterns.php
github.comgithub.com/coollabsio/coolify/commit/b50839d4515b115b7ded5db609471440249995da
github.comgithub.com/coollabsio/coolify/releases/tag/v4.2.0
vulncheck.comvulncheck.com/advisories/coolify-before-4.2.0-remote-code-execution-via-environment-variable-key

Frequently asked

questions

It may be exploitable through Coolify's authenticated deployment or environment-variable management interfaces when those actions result in commands being sent to a managed server over SSH.

The attacker generally needs authenticated access with permission to influence environment variable key names or a related deployment configuration. The exact scope depends on the deployment's authorization model.

Avoid shell interpretation by using structured process-execution interfaces, strict key-name validation, and safe argument handling. Host commands should not be assembled by concatenating untrusted strings.

Treat configuration fields as untrusted input, enforce allowlists for names, review every SSH and Docker command boundary, and run deployment automation with only the privileges it requires.

Find out what's already
exploitable in your codebase.