HIGH 8.8

CVE-2026-42200: Coolify PostgreSQL Path Traversal Remote Code Execution Vulnerability

Coolify, an open-source platform for managing servers, applications, and databases, contains a vulnerability in how it handles file paths during PostgreSQL database initialization. An authenticated user can exploit improper path validation to write files outside the intended directory and execute arbitrary commands on the host system. This vulnerability affects all versions prior to 4.0.0-beta.474, where the issue has been remediated.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.8 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-22
Affected products
0 configuration(s)
Published / Modified
2026-07-07 / 2026-07-07

NVD description (verbatim)

Coolify is an open-source and self-hostable tool for managing servers, applications, and databases. Prior to 4.0.0-beta.474, PostgreSQL initialization script (generate_init_scripts() method in app/Actions/Database/StartPostgresql.php) filename handling did not sufficiently restrict paths, allowing an authenticated user to write files outside the intended directory and achieve command execution through database initialization. This issue is fixed in version 4.0.0-beta.474.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the generate_init_scripts() method within app/Actions/Database/StartPostgresql.php. The PostgreSQL initialization script filename handling does not adequately restrict or validate file paths, enabling path traversal attacks. An authenticated attacker can craft malicious input that bypasses directory constraints, write arbitrary files to the filesystem, and achieve remote code execution during the database initialization process. The issue is classified as a CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) vulnerability.

Business impact

This vulnerability poses a critical operational risk for organizations self-hosting Coolify. A malicious authenticated user—whether an insider, compromised account, or attacker with valid credentials—can execute arbitrary commands with the privileges of the Coolify application. This can lead to complete system compromise, unauthorized data access, data exfiltration, lateral movement to connected infrastructure, and service disruption. Organizations relying on Coolify for production workload management face potential loss of availability and confidentiality.

Affected systems

Coolify versions prior to 4.0.0-beta.474 are affected. The vulnerability requires authentication to exploit, limiting exposure to users with legitimate access to the Coolify platform. Self-hosted instances are directly impacted; cloud-hosted or managed deployments depend on the provider's update status.

Exploitability

Exploitation requires valid authentication credentials within the Coolify platform. The attack vector is network-based with low complexity, meaning an authenticated user can perform the attack without special conditions or user interaction. The impact is severe: full compromise of confidentiality, integrity, and availability. While the authentication requirement reduces the attack surface compared to unauthenticated vulnerabilities, the ease of exploitation once authenticated access is obtained, combined with the severity of impact, makes this a material risk.

Remediation

Upgrade Coolify to version 4.0.0-beta.474 or later. This patch implements proper path validation and restriction in the PostgreSQL initialization script handling. Verify the upgrade is applied across all self-hosted Coolify instances. Organizations should also audit user access to Coolify and enforce least-privilege principles for account permissions.

Patch guidance

Apply the patch to version 4.0.0-beta.474 or any subsequent stable release. Verify the patch in your staging environment before deploying to production. Given the authentication requirement, prioritize patching instances accessible to external users or those with elevated user counts. Document the patch date for compliance and audit purposes.

Detection guidance

Monitor Coolify application logs for unusual PostgreSQL initialization activity, especially attempts to reference paths outside the expected database directory (e.g., paths containing "../" or absolute paths). Network-based detection should flag suspicious file writes originating from the Coolify process. Check for unexpected files created in sensitive directories (e.g., web roots, configuration directories) during database initialization. Endpoint detection and response (EDR) tools should alert on process execution spawned from Coolify database initialization routines.

Why prioritize this

This vulnerability scores 8.8 (HIGH) on CVSS v3.1 due to its broad impact on confidentiality, integrity, and availability combined with network-accessible exploitation. Although authentication is required, the low complexity of exploitation and the critical nature of the affected component (database initialization in infrastructure management software) warrant prompt patching. Organizations managing critical infrastructure through Coolify should treat this as a high priority.

Risk score, explained

The CVSS 3.1 score of 8.8 reflects: (1) network attack vector—the vulnerability is exploitable over the network; (2) low attack complexity—no special conditions required; (3) low privilege requirement—only authenticated access needed; (4) high impact on confidentiality, integrity, and availability—arbitrary code execution grants full system compromise. The score does not account for the authentication gate, which in real-world context limits exposure but is factored into the 'PR:L' (requires low privilege) vector component.

Frequently asked questions

Does this vulnerability require me to be an administrator in Coolify to exploit it?

No. The vulnerability requires only authenticated access to Coolify. Any user account, including those with limited permissions, can potentially exploit this to write files and execute commands, making this a significant insider or compromised-credential risk.

Is there a public exploit or proof-of-concept available?

No public exploit has been disclosed as of the current date. However, the technical nature of the vulnerability (path traversal in a well-known component) means motivated attackers could develop working exploits once details are publicly known.

Can I mitigate this without upgrading if I restrict network access to Coolify?

Network access restrictions reduce the attack surface by limiting who can authenticate to Coolify. However, they do not eliminate the vulnerability itself. Patching to 4.0.0-beta.474 or later is the proper remediation; network segmentation should be layered on top as defense-in-depth.

What should I do if I discover signs of exploitation in my logs?

Assume the system may be compromised. Isolate the affected Coolify instance from production, conduct forensic analysis to determine what files were written or commands executed, reset credentials for accounts that accessed the instance, and assess whether lateral movement occurred to connected servers or databases managed by Coolify.

This analysis is provided for informational purposes to support vulnerability management and risk assessment. It is not a substitute for vendor advisories or your organization's internal security review. Verify all technical claims against official Coolify documentation and advisories before taking action. Security posture should always incorporate defense-in-depth practices beyond single vulnerability patching. This assessment does not constitute legal or compliance advice. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).