Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-22605

CVE-2025-22605: Coollabs Coolify RCE Vulnerability

CVE-2025-22605 is a remote code execution vulnerability in Coollabs Coolify allowing authenticated users to execute arbitrary code on the local container. This post covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2025-22605 Overview

CVE-2025-22605 is a command injection vulnerability [CWE-78] affecting Coolify, an open-source and self-hostable platform for managing servers, applications, and databases. The flaw exists in the execution of commands on remote servers and allows an authenticated user to execute arbitrary code within the local Coolify container. Successful exploitation grants access to data, private keys, and tokens belonging to other users and teams on the same instance. The vulnerability affects versions from 4.0.0-beta.18 through 4.0.0-beta.252. Centrally hosted Coolify instances with open registration or multiple tenants face heightened risk, since any authenticated user can extract secrets from every connected server. Version 4.0.0-beta.253 addresses the issue.

Critical Impact

Authenticated attackers can inject commands into the Coolify container, exfiltrate SSH private keys and API tokens for all managed servers, and deploy malicious container images to remote nodes.

Affected Products

  • Coollabs Coolify 4.0.0-beta.18 through 4.0.0-beta.252
  • Self-hosted Coolify instances managing remote servers via SSH
  • Multi-tenant Coolify deployments with open registration

Discovery Timeline

  • 2025-01-24 - CVE-2025-22605 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-22605

Vulnerability Analysis

Coolify orchestrates remote server operations by constructing SSH command strings and executing them from the central Coolify container. The vulnerable logic in bootstrap/helpers/remoteProcess.php used a predictable delimiter when wrapping command output, allowing attacker-controlled input to break out of the intended command boundary. Any authenticated user with the ability to trigger a remote command flow can therefore inject additional shell commands that execute inside the Coolify container itself.

Because the Coolify container stores SSH private keys, deployment tokens, and configuration for every team and every managed server, the injection collapses tenant isolation. An attacker can read the shared secrets database, pivot to any managed remote host, or modify orchestration behavior to deploy malicious container images. This maps to Improper Neutralization of Special Elements used in an OS Command [CWE-78].

Root Cause

The root cause is unsanitized user input concatenated into SSH command strings combined with a static, predictable output delimiter. Since the delimiter was known and not securely generated, crafted input could terminate the wrapper, close the SSH command context, and append arbitrary shell instructions that the remote process helper then executed.

Attack Vector

Exploitation requires an authenticated account on the Coolify instance but no additional privileges beyond a standard team user. The attacker submits crafted input to any feature that flows into remote command execution, triggering command injection inside the Coolify container. From there, the attacker reads secrets, tampers with deployments, or issues arbitrary SSH commands to every server the instance manages.

php
// Security patch in bootstrap/helpers/remoteProcess.php
 use App\Models\ApplicationDeploymentQueue;
 use App\Models\PrivateKey;
 use App\Models\Server;
-use App\Notifications\Server\Revived;
-use App\Notifications\Server\Unreachable;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Hash;
 use Illuminate\Support\Facades\Process;
 use Illuminate\Support\Facades\Storage;
 use Illuminate\Support\Str;

Source: GitHub commit 353245bb. The patch introduces Illuminate\Support\Facades\Hash to generate a hashed random delimiter for SSH commands and ensures the delimiter is stripped from output, preventing attacker-controlled data from terminating the command wrapper.

Detection Methods for CVE-2025-22605

Indicators of Compromise

  • Unexpected shell commands or child processes spawned by the Coolify container outside normal deployment windows.
  • Reads or exports of PrivateKey records, .ssh directories, or environment variable stores by non-administrative users.
  • Outbound SSH sessions from the Coolify container to managed servers that do not correlate with a legitimate deployment event.
  • Container image pulls or deployments referencing registries or tags not defined in project configuration.

Detection Strategies

  • Inspect Coolify application logs for remote process invocations containing shell metacharacters such as ;, &&, |, or backticks in user-supplied fields.
  • Correlate authenticated user activity with subsequent process execution inside the Coolify container to identify anomalous command chains.
  • Baseline the set of binaries executed inside the container and alert on deviations such as curl, wget, nc, or base64 when they are not part of the normal deployment path.

Monitoring Recommendations

  • Enable container runtime auditing (for example, Falco or auditd) on the host running the Coolify container to capture execve events.
  • Forward Coolify application logs and container runtime events to a centralized SIEM for correlation across tenants.
  • Monitor egress SSH traffic volume from the Coolify container and alert on new destination hosts or off-hours activity.

How to Mitigate CVE-2025-22605

Immediate Actions Required

  • Upgrade all Coolify instances to version 4.0.0-beta.253 or later without delay.
  • Rotate every SSH private key, deployment token, API token, and shared secret stored in the Coolify instance, assuming compromise if the instance was internet-exposed.
  • Audit team membership and revoke any accounts created during the exposure window on multi-tenant instances.

Patch Information

The fix is included in Coolify 4.0.0-beta.253 and is tracked in GitHub Security Advisory GHSA-9wqm-fg79-4748. The underlying code change is in commit 353245bb, which replaces the static SSH output delimiter with a hashed random value and removes the delimiter from returned output. Additional context is available in Pull Request #1524 and Pull Request #1625.

Workarounds

  • Disable open user registration and restrict the instance to trusted operators until the upgrade is applied.
  • Place the Coolify web interface behind a VPN or IP allowlist to reduce the pool of potential authenticated attackers.
  • Segment managed servers so that a single compromised Coolify instance cannot reach unrelated production environments.
bash
# Upgrade a self-hosted Coolify instance to the patched release
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

# Verify the running version is 4.0.0-beta.253 or later
docker exec coolify php artisan about | grep -i version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.