Summary
Dokploy contains an operating system command injection vulnerability in database service deployment functions that incorporate user-controlled Docker image values into remote shell commands without adequate quoting.
An attacker who can control the relevant image configuration may execute arbitrary commands on the remote server, potentially causing full server compromise.
Affected context
The vulnerability occurs in Dokploy database service deployment workflows for MariaDB, MongoDB, MySQL, PostgreSQL, Redis, and LibSQL when the remote-server execution path constructs Docker commands from user-controlled image fields. Risk depends on whether an attacker can submit or modify deployment configuration and whether the affected service runs with permissions that allow access to sensitive host or platform resources.
Exploit preconditions
- Attack surface: Remote-server database service deployment functionality
- Required access: Ability to create, modify, or trigger a deployment containing a controlled Docker image value
- Trigger point: Construction and execution of the Docker pull command during service deployment
- Why exploitation is possible: The image value is passed unquoted into a shell command, allowing shell metacharacters or command syntax to alter the intended command
Why this happens
The underlying bug is command construction from untrusted input without strict argument separation or safe process execution.
The affected deployment functions interpolate the user-controlled dockerImage field directly into a shell command. This insecure pattern allows input intended as a Docker image reference to be interpreted by the shell as command syntax, mapping to CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Potential impact
- An attacker may execute arbitrary commands on the remote server
- The Dokploy host or deployment worker could be compromised
- Deployment credentials, environment variables, and application secrets could be exposed
- Attackers could modify or delete hosted services and data
- The compromised server could be used for lateral movement or persistence
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from deployment command execution and reducing trust in image configuration.
Common defensive patterns include:
- Invoking container tooling through structured argument arrays rather than shell-interpolated command strings
- Validating Docker image references against a strict grammar and approved registries
- Rejecting unexpected characters, separators, and shell control syntax
- Using secure-by-default deployment APIs that do not invoke a shell
- Separating user-controlled configuration from privileged deployment operations
- Running deployment workers with least-privilege accounts and narrowly scoped credentials
- Restricting network, filesystem, and container permissions available to deployment processes
How teams detect issues like this
Organizations can look for:
- Static analysis findings involving shell command construction, string interpolation, or process execution APIs
- Code review signals where request or configuration fields flow into
docker,sh, or command runner calls - Tests that verify image-reference validation and confirm shell metacharacters cannot alter process arguments
- Runtime monitoring for unexpected Docker commands, child processes, outbound connections, or changes to deployment files
- Policy enforcement requiring approved image registries and structured subprocess APIs
Automated security review tools may help identify tainted data flows into shell execution paths.

