Overview
Dokploy, a container-runtime management tool, contains an OS command injection flaw in the getComposeContainerCommand() function. The vulnerability is triggered when the serviceName parameter includes shell metacharacters, which can be stored through the backup.create or backup.update tRPC procedures. When scheduled backups run, the crafted value is executed as root via the mounted Docker socket, allowing full host compromise.
Technical details
The getComposeContainerCommand() routine builds a shell command using the serviceName argument without proper sanitization. Authenticated members of an organization can submit malicious serviceName values through the backup.create or backup.update tRPC calls. These values are persisted and later interpolated into a command run during backup operations, executed with root privileges because Dokploy runs with access to the Docker socket on the host.
Impact
An attacker who can authenticate as an organization member can execute arbitrary shell commands as root, potentially taking over the host operating system, modifying containers, extracting data, or installing persistent malware. All deployments using Dokploy versions prior to 0.31.1 are exposed.
Recommended actions
- Patch to version 0.31.1 or later.
- Restrict network access to the Dokploy management interface to trusted hosts only.
- Disable or restrict the backup.create and backup.update tRPC procedures for untrusted users.
- Monitor backup logs and Docker daemon activity for unexpected command execution.
- Rotate Docker socket credentials and audit existing containers for privilege escalation.
Detection
Review Dokploy application logs for calls to getComposeContainerCommand and any backup.create or backup.update requests containing unusual characters. Correlate these events with Docker daemon logs for exec commands originating from the Dokploy process. Alert on anomalous command patterns or unexpected container restarts that may indicate exploitation.
Reference: NVD entry for CVE-2026-129433