CVE-2025-22609

10.0 CRITICAL

📋 TL;DR

This vulnerability allows any authenticated user in Coolify to attach existing private SSH keys to their own server configuration. If the attacker's server matches the victim's SSH configuration (IP/domain, port 22, user root), they can use the Terminal feature to execute arbitrary commands on the victim's server. All Coolify instances running versions before 4.0.0-beta.361 are affected.

💻 Affected Systems

Products:
  • Coolify
Versions: All versions prior to 4.0.0-beta.361
Operating Systems: All platforms running Coolify
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user access to Coolify instance and matching SSH server configuration (IP/domain, port 22, root user).

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full compromise of victim servers via remote code execution as root, leading to data theft, lateral movement, and complete system takeover.

🟠

Likely Case

Unauthorized access to servers with matching SSH configurations, allowing command execution and potential data exposure.

🟢

If Mitigated

Limited impact if proper network segmentation, SSH key management, and access controls are implemented.

🌐 Internet-Facing: HIGH - Internet-facing Coolify instances expose SSH servers to potential compromise.
🏢 Internal Only: HIGH - Internal instances still vulnerable to authenticated users within the organization.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access but is straightforward once authentication is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.0.0-beta.361

Vendor Advisory: https://github.com/coollabsio/coolify/security/advisories/GHSA-3w2c-jfr2-9pg9

Restart Required: Yes

Instructions:

1. Backup your Coolify instance. 2. Update to version 4.0.0-beta.361 or later. 3. Restart the Coolify service. 4. Verify the update was successful.

🔧 Temporary Workarounds

Restrict SSH key access

all

Implement strict access controls on SSH private keys and limit which users can attach keys to servers.

Disable Terminal feature

all

Temporarily disable the Terminal feature in Coolify if not required for operations.

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Coolify instances from critical servers.
  • Enforce least privilege access controls and monitor for unauthorized SSH key attachment attempts.

🔍 How to Verify

Check if Vulnerable:

Check Coolify version via web interface or configuration files. If version is below 4.0.0-beta.361, the instance is vulnerable.

Check Version:

Check Coolify web interface dashboard or configuration files for version information.

Verify Fix Applied:

Confirm version is 4.0.0-beta.361 or higher and test that authenticated users cannot attach unauthorized SSH keys.

📡 Detection & Monitoring

Log Indicators:

  • Unauthorized SSH key attachment events
  • Unexpected Terminal session initiation
  • Failed authorization attempts for key operations

Network Indicators:

  • Unexpected SSH connections from Coolify instance to servers
  • Anomalous command execution patterns

SIEM Query:

source="coolify" AND (event="ssh_key_attach" OR event="terminal_session") AND user!="authorized_user"

🔗 References

📤 Share & Export