/

CVE-2026-34035

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Coolify Logs

CVE-2026-34035

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution by Authenticated User

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 contained an OS command injection flaw where log drain secrets and environment values were interpolated directly into shell commands without proper encoding.

An authenticated user able to configure or control these values could inject additional commands, leading to arbitrary code execution on the host where Coolify runs.

Affected context

This vulnerability appears in Coolify deployments where:

  • Log drains or similar features construct shell commands using user-controlled secrets or environment values
  • Command strings are assembled through interpolation or concatenation without shell-safe encoding
  • The resulting commands are executed on the underlying host or container shell

It becomes most relevant in environments where authenticated users can configure log drains, secrets, or environment variables that are later used in shell-based integrations.

Exploit preconditions

  • Attack surface: Coolify management interface or API for configuring log drains and related environment values
  • Required access: Authenticated access with permissions to define or modify log drain secrets or environment variables
  • Trigger point: Execution of the log drain or any feature that invokes the constructed shell command
  • Why exploitation is possible: User-supplied values are interpolated into shell commands without robust quoting, escaping, or use of non-shell execution primitives, allowing crafted input to break out of the intended command context

Why this happens

The core issue stems from constructing shell commands by interpolating user-controlled data and then executing them through a shell interpreter.

This maps directly to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where special shell metacharacters are not neutralized before being passed to the shell.

Conceptually, the pattern is:

  • Take configuration values (secrets, environment variables) as trusted
  • Embed them directly into a command string
  • Execute that command via a shell, granting the attacker influence over the final command line

Because the shell treats certain characters as control operators, an attacker can append, chain, or replace commands beyond the intended operation.

Potential impact

  • Authenticated users may execute arbitrary commands on the Coolify host
  • Compromise of the Coolify instance, including its configuration and managed applications
  • Access to sensitive data such as other users' configurations, secrets, and environment variables
  • Lateral movement into other services or infrastructure reachable from the host
  • Disruption of services through deletion, modification, or shutdown of managed resources

General mitigation guidance

Effective mitigation focuses on eliminating direct shell exposure and reducing trust in configuration inputs:

  • Prefer API or library calls over shell commands for system interactions, avoiding sh/bash altogether where possible
  • When shell invocation is unavoidable, construct argument arrays and use exec-style APIs that bypass shell parsing
  • Apply strict validation and allowlists for configuration fields that may influence commands, restricting them to expected formats
  • Ensure secrets and environment values are never treated as free-form command fragments; apply conservative escaping and quoting when they must be passed to shell commands
  • Run Coolify and related processes under least-privileged accounts to constrain damage if a command is injected
  • Segregate management interfaces and limit which roles can configure log drains or other shell-influencing settings

How teams detect issues like this

Organizations can detect similar issues by:

  • Using static analysis rules that flag string interpolation or concatenation passed into generic command execution functions (e.g., wrappers around sh, bash, or platform-specific shells)
  • Reviewing code for patterns where secrets, environment variables, or configuration fields are embedded into command strings without central escaping utilities
  • Enforcing coding guidelines that prohibit direct shell invocation in favor of safer abstractions and build-time checks to prevent violations
  • Logging and monitoring command execution paths for anomalous or user-specific patterns that may indicate injection attempts
  • Including targeted security tests that provide crafted configuration values to log drain and integration features to observe whether they alter command behavior

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/commit/fcd574e1eb1c2f504c48e5be4a5cb6d69f8f1f55
github.comgithub.com/coollabsio/coolify/releases/tag/v4.0.0-beta.466
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-3xm2-hqg8-4m2p

Frequently asked

questions

Exploitation is limited to users who can authenticate to Coolify and control the relevant log drain or environment configuration, but within that scope it can lead to arbitrary command execution on the host.

It generally requires whatever level of access is needed to configure log drains or associated environment values; higher-privileged roles increase risk, but any role with those capabilities could potentially exploit the issue.

Replace shell-based execution paths with direct library or API calls, avoid interpolating user-controlled values into shell commands, and when execution is unavoidable, pass arguments as structured arrays without invoking a shell.

Adopt defensive coding standards that disallow ad-hoc shell command construction, perform security reviews of any feature that builds commands from configuration, and incorporate automated checks to detect command injection patterns before release.

Find out what's already
exploitable in your codebase.