/

CVE-2026-34152

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) in Coolify SSH Deployments

CVE-2026-34152

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Command Execution on Managed Servers

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's deployment pipeline allows authenticated users to inject arbitrary shell commands into pre- and post-deployment scripts transported over SSH.

Because newline-preserving heredoc handling bypasses single-quote escaping, additional statements can execute on the remote server during deployment under certain configuration conditions.

Affected context

This vulnerability occurs in Coolify instances that use pre-deployment and post-deployment commands executed on remote servers via SSH.

The issue is present when user-controlled command strings are only single-quote escaped and then passed through a heredoc that preserves newlines, effectively re-opening the opportunity for shell parsing.

It primarily affects deployments where authenticated users can configure or modify these deployment hooks and where those hooks run with elevated privileges or broad system access.

Exploit preconditions

  • Attack surface: Coolify deployment configuration interface and any API or UI that allows editing pre-/post-deployment commands.
  • Required access: Authenticated access with permissions to define or modify deployment commands for a project or server.
  • Trigger point: Initiation of a deployment that causes Coolify to transmit the configured commands via SSH heredoc to the remote host.
  • Why exploitation is possible: The system relies on single-quote escaping but then wraps the commands in a newline-preserving heredoc, allowing crafted input to break out of the intended command context and inject additional shell statements.

Why this happens

The underlying bug is a classic command injection scenario where untrusted, user-supplied strings are incorporated into shell execution without robust, end-to-end validation and separation from the shell interpreter.

By escaping input with single quotes but subsequently sending it via a heredoc that maintains newline characters, the deployment mechanism allows the shell to interpret additional content as separate commands.

This maps directly to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where input is insufficiently sanitized or incorrectly encoded before being passed to a command processor.

Potential impact

  • An attacker may execute arbitrary shell commands on the managed remote server during deployment.
  • Malicious users could modify application files, configuration, or logs on the target host.
  • Attackers can pivot from the deployment environment to other services or data hosted on the same server.
  • Compromise of deployment integrity, allowing insertion of backdoors or tampered application artifacts.
  • Potential escalation of privileges on the remote server if deployment commands run with elevated rights.

General mitigation guidance

Mitigation generally focuses on removing direct shell interpolation of user-supplied deployment commands and enforcing strict separation between configuration data and command execution.

Common defensive patterns include:

  • Using parameterized command execution APIs that avoid shell parsing entirely where possible.
  • Restricting deployment configuration fields to vetted, templated actions instead of free-form shell scripts.
  • Applying rigorous input validation and encoding for any data that must be passed to the shell, ensuring special characters cannot alter command structure.
  • Running deployment hooks under least-privilege accounts and constrained environments (e.g., chroot, containers) to limit blast radius.
  • Implementing role-based access control so only trusted administrators can define or change pre-/post-deployment commands.

How teams detect issues like this

Detection typically combines configuration review with analysis of how commands are constructed and transmitted.

Useful approaches include:

  • Static analysis or linters that flag dynamic shell command construction involving user-controlled input.
  • Code review checklists that focus on SSH command assembly, heredoc usage, and any string concatenation feeding shell interpreters.
  • Logging and monitoring of deployment commands and outputs to identify anomalous or unexpected shell activity.
  • Security policies that forbid free-form shell execution in CI/CD or deployment pipelines, enforced via automated configuration scanners.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/commit/ad95d65aca064f49b38f73f88d61f842737d5463
github.comgithub.com/coollabsio/coolify/pull/9173
github.comgithub.com/coollabsio/coolify/releases/tag/v4.0.0-beta.471
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-5qp8-9gg7-4c86

Frequently asked

questions

Yes, but only through the Coolify interface or API by an authenticated user with access to deployment configuration; the actual command execution happens remotely on managed servers via SSH.

The attacker must be an authenticated user with sufficient permissions to define or modify pre-deployment or post-deployment commands for a project or target server.

The safest approach is to avoid passing user-supplied strings directly to a shell, instead using parameterized execution or a constrained set of predefined actions, and ensuring any required shell interaction applies strict, context-appropriate encoding and validation.

Organizations can prevent similar issues by standardizing secure command execution patterns, enforcing reviews for any shell usage in deployment code, limiting who can configure deployment hooks, and applying automated checks that flag dynamic shell command construction involving untrusted input.

Find out what's already
exploitable in your codebase.