/

CVE-2025-64420

Severity:

CRITICAL RISK

(9.9)

Insufficient Credential Protection in Coolify Server

CVE-2025-64420

Analyzed

Vulnerability type

Category:

Insufficient Credential Protection

CWE:

CWE-522

Impact:

Root Account Compromise and Full Server Takeover

Severity:

CRITICAL RISK

(9.9)

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 exposes the root user's private SSH key to low-privileged users in versions up to and including v4.0.0-beta.434, enabling them to authenticate as root on the underlying server.

When a user with limited permissions can view this key via the Coolify interface or stored configuration, they can bypass normal access controls and gain full system-level control over the host.

Affected context

This vulnerability affects Coolify deployments where:

  • The Coolify instance manages servers and uses an SSH private key associated with the root user on the host.
  • The application stores or renders this private key in a way that is accessible to low-privileged users through the UI or API.
  • Role-based access controls or data segregation do not prevent non-admin users from viewing sensitive configuration details.

The issue is most critical on instances where the exposed key is actively used to authenticate as root or as a highly privileged account on the underlying server or other managed servers.

Exploit preconditions

  • Attack surface: Coolify web interface and/or associated APIs.
  • Required access: Valid low-privileged Coolify account with the ability to access views or endpoints that expose configuration, connection details, or deployment settings.
  • Trigger point: Viewing or exporting the configuration or connection details where the root SSH private key is displayed or retrievable.
  • Why exploitation is possible: Sensitive authentication material (the root user's SSH private key) is stored and presented without proper secrecy boundaries, allowing it to be read by users who should not have access to this credential.

Why this happens

The core issue aligns with CWE-522: Insufficiently Protected Credentials.

In this case, the application treats a highly sensitive credential—the root user's SSH private key—as general configuration data rather than as secret material that must be strictly protected.

This typically manifests as:

  • Storing the private key in application-accessible storage without compartmentalization.
  • Exposing the key in UI components, logs, or APIs that are accessible to non-admin users.
  • Lack of proper role-based access control and secret-handling abstractions for high-value credentials.

Conceptually, the bug is that a credential intended only for backend, privileged use is directly visible to untrusted or semi-trusted tenants of the system.

Potential impact

  • Attackers may authenticate to the Coolify server as the root user over SSH.
  • Attackers can gain full administrative control of the underlying operating system.
  • Attackers could install backdoors, modify or destroy data, and pivot to other systems reachable from the compromised server.
  • Compromise of other servers or services that trust the same private key, if reused.
  • Loss of confidentiality for all data and secrets stored on the affected host.

General mitigation guidance

Effective mitigation focuses on treating all SSH private keys and similar credentials as secrets, isolating them both logically and operationally from regular application users.

Non-prescriptive defensive patterns include:

  • Secret isolation: Store SSH private keys in a dedicated secret store or OS-level secret management facility, not as regular application configuration values.
  • Principle of least privilege: Avoid using the root account for automated access where possible; use dedicated, minimally privileged accounts and distinct keys per function or environment.
  • Access control layering: Ensure that any interface that can reveal or handle secrets is restricted to highly privileged administrative roles, with explicit authorization checks and auditing.
  • Non-display of secrets: Design the system so that credentials are never fully displayed after initial provisioning; if necessary, allow rotation or re-upload, but not retrieval of the raw secret.
  • Key compartmentalization: Use different keys for different servers and roles, limiting blast radius if a key is inadvertently exposed.
  • Operational hygiene: Regularly rotate SSH keys and immediately replace any key that may have been exposed, in conjunction with revoking its trust (e.g., updating authorized_keys).

How teams detect issues like this

Detection can focus on both code-level indicators and operational signals:

  • Code and configuration review:
  • Identify locations where SSH keys or other sensitive credentials are stored, serialized, or rendered.
  • Verify that secret values are never passed to UI templates, logs, or low-privilege APIs.
  • Ensure RBAC checks wrap any configuration export or diagnostic endpoints.
  • Static analysis patterns:
  • Rules that flag handling of private key material (e.g., PEM-formatted content) in controller or view layers.
  • Detection of code paths that read secrets from storage and then are used to render HTTP responses.
  • Policy enforcement:
  • CI/CD checks that block merging code which logs or returns credential-like values.
  • Infrastructure policies that enforce separation of secret storage from general application data.
  • Runtime monitoring:
  • Logging and alerting on unusual access to configuration or settings pages by low-privileged accounts.
  • SSH access monitoring for root logins, especially following access to sensitive areas of the Coolify UI.

Automated review tools—static analyzers, secret scanners, and configuration auditors—can complement manual review by systematically scanning for secret exposure patterns.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-qwxj-qch7-whpc

Frequently asked

questions

Any attacker who can obtain a low-privileged Coolify account on an affected instance may be able to retrieve the root SSH private key and use it to log in as root, assuming the key is still trusted by the server or other systems.

The attacker typically needs authenticated, low-privilege access to the Coolify interface or API—such as a regular user account. No direct shell or file-system access is required if the key is visible through the application.

The safest approach is to redesign how secrets are handled: treat SSH private keys as non-retrievable secrets, restrict any secret-handling functions to trusted administrative paths, and avoid using root-level keys where possible. Keys that may have been exposed should be rotated and their trust revoked.

Establish a clear secret-management model: keep secrets in dedicated secret stores, prevent them from ever being rendered to low-privilege users, enforce strict RBAC around any secret-related operations, and integrate code-scanning and configuration reviews to detect potential secret exposure before deployment.

Find out what's already
exploitable in your codebase.