CVE-2026-42153: Coolify PostgreSQL Command Injection – High Severity Authentication Bypass
Coolify, an open-source platform for managing servers, applications, and databases, contains a command injection vulnerability in its PostgreSQL health check functionality. An authenticated user can manipulate database configuration fields (specifically the PostgreSQL username and database name) to inject arbitrary shell commands that execute within the database container. This vulnerability affects Coolify versions prior to 4.0.0-beta.474 and requires authentication to exploit, meaning an attacker must have legitimate access to the Coolify platform.
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-78
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-06 / 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 healthcheck command generation used attacker-controlled database settings (postgres_user and postgres_db) in shell-form commands, allowing an authenticated user to inject commands executed in the database container. 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 stems from unsafe shell command construction in PostgreSQL healthcheck logic. Coolify builds shell-form commands using user-supplied input from postgres_user and postgres_db configuration parameters without proper sanitization or parameterization. An authenticated attacker can embed shell metacharacters and command separators into these fields—for example, injecting backticks, $(), or semicolons—causing the database container to execute unintended commands. The root cause is classified as CWE-78 (OS Command Injection). The attack surface is limited to authenticated users, but once exploited, an attacker gains the execution context of the database container process.
Business impact
Compromise of a Coolify-managed database container can lead to data exfiltration, database corruption, lateral movement to other containers or hosts on the network, or denial of service. Organizations relying on Coolify for multi-tenant or multi-application deployments face elevated risk of cascading failures if a single compromised database container is leveraged to attack infrastructure components. The impact is particularly severe in environments where Coolify manages sensitive databases or connects to production systems.
Affected systems
Coolify versions prior to 4.0.0-beta.474 are affected. The vulnerability requires an authenticated user account on the Coolify platform; it does not affect unauthenticated external users. Self-hosted Coolify instances are the primary exposure vector. Organizations running Coolify in containerized or Kubernetes environments should prioritize assessment, as the injected commands execute directly in the database container context.
Exploitability
Exploitability is moderate in scope. The attack requires prior authentication to Coolify, which raises the barrier compared to unauthenticated vulnerabilities. However, authentication can be achieved through compromised credentials, insider threats, or compromised integrated development environments linked to Coolify. Once authenticated, the injection is straightforward—modifying database settings is a typical user action, and no special tools or techniques are required. An attacker with database admin or configuration privileges can immediately weaponize this flaw.
Remediation
Upgrade Coolify to version 4.0.0-beta.474 or later. This version contains fixes that sanitize postgres_user and postgres_db parameters, preventing command injection. Organizations unable to upgrade immediately should restrict Coolify access to trusted users, implement network segmentation to isolate database containers, and monitor container execution logs for suspicious command patterns.
Patch guidance
Apply the patch by upgrading Coolify to 4.0.0-beta.474 or a newer stable release when available. Verify patch deployment by confirming the version in Coolify's administration interface. For self-hosted instances, follow the standard Coolify update procedure documented in the project repository. Test the upgrade in a non-production environment first to ensure compatibility with your existing database configurations. No database migration or configuration rollback is required; the fix is backward-compatible.
Detection guidance
Monitor Coolify database container logs and audit trails for commands that contain unusual shell metacharacters or suspicious patterns in postgres_user or postgres_db fields. Inspect Coolify configuration backups or exported settings for evidence of injected payloads. On the host level, use container runtime security tools to detect unexpected process execution within database containers, particularly child processes spawned from the healthcheck mechanism. Check for authentication logs showing unusual user account modifications tied to database configuration changes.
Why prioritize this
This vulnerability scores 8.8 (HIGH severity) due to its potential for complete compromise of database containers and the presence of high-impact capabilities: confidentiality, integrity, and availability are all at risk. Although authentication is required, the relatively low effort to exploit once authenticated, combined with the critical role databases play in infrastructure, justifies immediate attention. Organizations with externally-facing Coolify instances or those managing production databases should treat this as a priority patch.
Risk score, explained
The CVSS 3.1 score of 8.8 reflects: Network attack vector (N), Low attack complexity (L), requiring Low privileges (authentication, L), and no user interaction (N). The impact across confidentiality, integrity, and availability is High (H) for all three, indicating complete compromise of the affected resource scope. The scope is unchanged (U), meaning the vulnerability does not affect resources beyond the vulnerable component itself, though the nature of the injected commands could enable lateral movement in practice.
Frequently asked questions
Do I need to have database admin privileges in Coolify to exploit this vulnerability?
No. Any authenticated user who can access database settings and modify the postgres_user or postgres_db fields can exploit this flaw. This includes database operators, developers with Coolify access, and other authenticated accounts. Privilege escalation within Coolify is not a prerequisite.
What is the difference between 4.0.0-beta.474 and earlier versions?
Version 4.0.0-beta.474 introduced input sanitization and secure command construction for PostgreSQL healthcheck generation. Earlier versions directly interpolated user input into shell commands without validation. Verify your current version in Coolify's settings and upgrade if you are below beta.474.
If I restrict network access to my Coolify instance, am I protected?
Network isolation reduces exposure but does not eliminate risk. An insider, a developer with legitimate access, or someone with compromised credentials can still exploit this from within the network. Patching is the primary mitigation; network controls are a secondary layer.
Can I detect if someone has exploited this vulnerability in my Coolify instance?
Yes. Review database container execution logs and Coolify audit trails for unusual postgres_user or postgres_db field values containing shell metacharacters (backticks, $(), semicolons, pipes, etc.). Container runtime logs may also show unexpected child processes spawned from the healthcheck. Compare your Coolify configuration exports against baseline snapshots to detect unauthorized changes.
This analysis is based on disclosed vulnerability data current as of the publication date. Readers should verify all technical details, including affected versions and patch availability, against official Coolify project announcements and security advisories. SEC.co makes no warranty regarding completeness, accuracy, or fitness for any particular purpose. Organizations should conduct their own risk assessment and validation testing before and after applying patches. This analysis is for informational purposes only and does not constitute legal or compliance advice. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-41265HIGHWaterfall WF-500 TX Host OS Command Injection (CVSS 7.2)
- CVE-2025-41266HIGHWaterfall WF-500 TX Host Command Injection Vulnerability Analysis
- CVE-2025-41267HIGHWaterfall WF-500 TX Host Command Injection Vulnerability
- CVE-2025-41279HIGHOS Command Injection in Waterfall WF-500 RX Host Administration WebUI
- CVE-2025-41281HIGHWaterfall WF-500 OS Command Injection
- CVE-2025-66273HIGHQNAP Command Injection in QTS and QuTS hero
- CVE-2025-66279HIGHQNAP NAS Command Injection – Admin Authentication Required, HIGH Severity
- CVE-2025-69755HIGHNeterbit NW-431F Router RCE and Data Exposure Vulnerability