/

CVE-2026-34058

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Coolify Server Control

CVE-2026-34058

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code 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 server management interface exposes Livewire methods that interpolate a browser-supplied container ID directly into shell commands executed over SSH.

Any authenticated team member who can access these controls may execute arbitrary OS commands on managed servers by manipulating this parameter.

Affected context

This vulnerability appears in Coolify installations where:

  • The Server\Resources Livewire component is deployed
  • Users can invoke startUnmanaged, stopUnmanaged, or restartUnmanaged actions
  • The application issues shell commands over SSH to managed servers using user-controlled identifiers

The risk is heightened in multi-user environments where team members share access to the same Coolify instance and managed infrastructure.

Exploit preconditions

  • Attack surface: Web-based server management UI backed by a Livewire component.
  • Required access: Authenticated team membership with permission to manage unmanaged containers or servers.
  • Trigger point: Invocation of startUnmanaged, stopUnmanaged, or restartUnmanaged where the container ID parameter is provided by the browser.
  • Why exploitation is possible: The container ID parameter is accepted as-is, not sanitized or escaped, and is directly interpolated into shell commands executed via SSH, allowing crafted values to break out of the intended command context.

Why this happens

The root cause is direct insertion of untrusted user-controlled input into shell commands without robust validation, escaping, or use of safer APIs.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where parameters received from the client are concatenated into command strings and executed by the operating system.

Rather than treating the container ID as data passed through a constrained interface (such as a parameterized API or library call), the design relies on string-based command construction, making it vulnerable to command injection.

Potential impact

  • Execution of arbitrary OS commands on managed servers via the Coolify control plane
  • Complete compromise of affected servers, including data exfiltration or modification
  • Deployment of unauthorized software or backdoors on managed infrastructure
  • Disruption of hosted applications and databases through stopping, altering, or destroying services
  • Lateral movement across environments managed by the same Coolify instance

General mitigation guidance

Effective mitigation focuses on eliminating direct command-string construction with untrusted data and constraining what actions can be performed on remote servers.

Useful patterns include:

  • Replacing raw shell command concatenation with high-level libraries or APIs that accept arguments as separate parameters rather than as a single string
  • Implementing strict server-side validation of identifiers (e.g., restricting container IDs to a vetted set, or matching against known records in the database)
  • Applying rigorous escaping of any dynamic values that must be used in shell contexts, using language-appropriate escaping utilities
  • Introducing a permission model that limits which users can perform server-control operations, aligned with the principle of least privilege
  • Isolating the execution environment for server commands, for example through dedicated service accounts with minimal privileges, so that a compromise of the command path yields reduced impact

How teams detect issues like this

Detection can leverage both code-centric and operational approaches:

  • Static analysis rules that flag concatenation of user-controlled values into shell commands, particularly around Livewire components or server-control logic
  • Code review checklists that require reviewers to inspect any SSH or command-execution paths for proper input handling and the use of safe APIs
  • Application-level logging that records server-control invocations, including which user initiated actions and what parameters were passed, to support anomaly detection
  • Security testing (including automated dynamic analysis) that attempts to inject shell metacharacters into parameters used for server or container management operations

Teams may also configure policy enforcement in CI to prevent merging of changes that introduce new direct command execution paths with untrusted inputs.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/commit/944a038349216f00b390e905c121355adc8b23c1
github.comgithub.com/coollabsio/coolify/pull/9172
github.comgithub.com/coollabsio/coolify/releases/tag/v4.0.0-beta.471
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-rh5x-qx77-fq9v

Frequently asked

questions

It can be exploited remotely if the Coolify management interface is accessible over the network. However, an attacker must first obtain authenticated access as a team member with permission to invoke the affected actions.

The attacker needs valid credentials and sufficient privileges within Coolify to call the startUnmanaged, stopUnmanaged, or restartUnmanaged methods. No direct shell or SSH access to the server is required; the application facilitates the command execution.

The safest approach is to stop building shell commands from raw strings containing user input. Instead, use APIs or libraries that pass arguments as separate parameters, strictly validate identifiers against known entities, and restrict the set of permissible operations on remote servers.

Adopt a policy that treats all client-supplied data as untrusted, enforce central input validation, and prohibit direct shell command construction in code review. Complement this with static analysis rules targeting command execution calls and training developers to prefer parameterized, high-level abstractions for remote management tasks.

Find out what's already
exploitable in your codebase.