Dokploy Root-Level RCE: Critical OS Command Injection Threatens Self-Hosted Deployments

If you are running the popular open-source Platform as a Service solution Dokploy on your self-hosted servers, your infrastructure might be sitting on a ticking time bomb. Security researchers have uncovered a critical OS command injection vulnerability (VU#280377) in the platform's database backup and restoration features, allowing any authenticated user with default permissions to execute arbitrary commands as root. This flaw doesn't just compromise the application; it hands over the entire host machine, including the private keys and credentials of every other tenant on the instance.

Version 0.29.8 and 0.29.11 of Dokploy, along with commit 24b02f5 on the canary branch, are susceptible to a severe privilege escalation bug. Due to insufficient sanitization of user-controlled input in the backup creation process, threat actors can inject shell metacharacters directly into system commands, escalating a simple backup request into a full-blown system takeover. If you are utilizing Dokploy for your DevOps pipelines, this is a vulnerability you cannot afford to ignore.

The Anatomy of the Injection Flaw

The root cause of this critical cybersecurity issue lies in the way Dokploy orchestrates database snapshots. The platform supports a variety of database types—including PostgreSQL, MySQL, MariaDB, MongoDB, and LibSQL—and allows authenticated users to schedule and restore backups. However, the developers failed to heed the golden rule of secure coding: never trust user input. The application constructs database-specific shell commands by directly interpolating a user-supplied database name during the backup process, and a user-supplied `backupFile` value during restoration.

Because these variables are concatenated into the command string without shell escaping or restrictions on metacharacters, the system ultimately passes the tainted command to a shell execution helper that invokes `/bin/bash` as a child process. The parameters are exposed through tRPC procedures, which only validate that the supplied values are non-empty strings. This means an attacker can easily break out of the intended command structure by injecting characters like `;`, `&&`, or backticks, effectively hijacking the execution flow to run arbitrary code on the host operating system.

Privilege Escalation: The Perfect Storm

What makes this OS command injection vulnerability particularly devastating is the privilege context in which it operates. By default, the Dokploy process runs with root privileges—a necessity for provisioning containers and managing system-level resources. In the realm of cybersecurity, this is often referred to as a "high-impact" scenario because the blast radius is the entire host server rather than just the containerized application.

An attacker with an authenticated Dokploy account holding backup permission—which is granted by default for database services—can exploit this flaw to execute arbitrary commands as root on the Dokploy host. Successful exploitation provides full control of the host, including persistent read/write access to the target server's filesystem. This is a hacker's dreamland; it allows for the deployment of malware, the establishment of backdoors, and the potential to pivot into other sensitive parts of the network infrastructure.

The implications extend beyond the immediate server compromise. Since the attacker gains root access, they can steal private credentials stored for other tenants managed by the same Dokploy instance. In a multi-tenant environment, this transforms a single point of failure into a mass data breach, exposing sensitive production data and secrets across disparate projects and clients.

Affected Versions and the Patch

The vulnerability has been confirmed to affect all five database types supported by Dokploy, indicating that this is not a isolated issue within a single database adapter but a systemic problem in the backup utility's command construction logic. Exploitation was successfully verified against versions 0.29.8 and 0.29.11, as well as commit 24b02f5 on the canary branch available on GitHub.

If you are running any of these builds, your exposure is immediate. However, the development team has acted swiftly in response to the discovery by Muhammadjon Ahmadjonov. The issue has been patched in Dokploy versions 0.29.13 and beyond. The most straightforward and effective mitigation is to update your installation immediately to the latest available version to ensure your instance is no longer vulnerable to this command injection attack.

The CERT/CC recommends users update immediately to patch this critical OS command injection vulnerability. For those who are unable to update right away, there is a temporary mitigation strategy: turn off default backup permissions. By restricting these permissions only to necessary users and roles, admins can shrink the attack surface and reduce the risk of exploitation by low-privilege accounts or compromised internal users.

Conclusion

This Dokploy vulnerability serves as a stark reminder that even open-source platforms designed for developer convenience can harbor critical security flaws when handling system-level operations. The lack of input sanitization in shell command construction is a classic, yet potent, mistake that can lead to privilege escalation and total host compromise. If you have Dokploy in your stack, check your version number immediately. Updating to 0.29.13 or later is not just a recommendation; it is mandatory to protect your infrastructure from unauthorized access and potential data theft.