CVE-2025-66213

8.8 HIGH

📋 TL;DR

CVE-2025-66213 is an authenticated command injection vulnerability in Coolify's File Storage Directory Mount Path functionality. It allows users with application/service management permissions to execute arbitrary commands as root on managed servers by exploiting unsanitized input in the file_storage_directory_source parameter. This affects all Coolify instances prior to version 4.0.0-beta.451.

💻 Affected Systems

Products:
  • Coolify
Versions: All versions prior to 4.0.0-beta.451
Operating Systems: Linux-based systems where Coolify is deployed
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user with application/service management permissions. The vulnerability exists in the default configuration when using file storage directory functionality.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full root-level remote code execution on all managed servers, allowing complete system compromise, data exfiltration, lateral movement, and persistent backdoor installation.

🟠

Likely Case

Authenticated attackers with service management permissions gain root access on managed servers, enabling privilege escalation, data theft, and service disruption.

🟢

If Mitigated

Limited impact if proper network segmentation, least privilege access, and input validation are implemented, though risk remains for authorized users.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access but is straightforward once authentication is obtained. Public proof-of-concept code is available in the referenced GitHub repository.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.0.0-beta.451

Vendor Advisory: https://github.com/coollabsio/coolify/security/advisories/GHSA-cj2c-9jx8-j427

Restart Required: Yes

Instructions:

1. Backup your Coolify configuration and data. 2. Update Coolify to version 4.0.0-beta.451 or later using the official upgrade process. 3. Restart the Coolify service. 4. Verify the update was successful by checking the version.

🔧 Temporary Workarounds

Disable File Storage Directory Mount Path functionality

linux

Temporarily disable the vulnerable file storage directory mount feature until patching can be completed.

# Modify Coolify configuration to remove or disable file_storage_directory_source parameter usage
# Check configuration files for file_storage_directory settings and comment them out

Restrict application/service management permissions

all

Limit which users have permissions to manage applications/services to reduce attack surface.

# Review and modify user roles in Coolify admin interface
# Remove application/service management permissions from non-essential users

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Coolify instances from critical systems
  • Apply strict input validation and sanitization at the application layer for all user-supplied parameters

🔍 How to Verify

Check if Vulnerable:

Check if your Coolify version is below 4.0.0-beta.451. Review logs for suspicious file_storage_directory_source parameter values containing shell metacharacters.

Check Version:

coolify --version or check the Coolify web interface admin panel

Verify Fix Applied:

Confirm Coolify version is 4.0.0-beta.451 or later. Test the file storage directory functionality with malicious input to ensure it's properly sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual shell commands executed by Coolify process
  • Suspicious file_storage_directory_source parameter values containing ;, |, &, $, or backticks
  • Unexpected root-level process execution from Coolify context

Network Indicators:

  • Unexpected outbound connections from Coolify server
  • Suspicious SSH or reverse shell connections originating from Coolify host

SIEM Query:

process.name:coolify AND (command_line:*file_storage_directory* AND command_line:*[;&|`$]* )

🔗 References

📤 Share & Export