Summary
Dokploy's database password-change procedures pass attacker-controlled passwords into Bash command strings, where permitted backticks can trigger command substitution. An authenticated user who can update a database password may therefore execute operating-system commands with the privileges of the Dokploy process.
Affected context
The issue affects Dokploy's password-change procedures for MySQL, PostgreSQL, MariaDB, MongoDB, and Redis when password values are interpolated into Bash command strings. It becomes risky when an authenticated user can update a database password and the validation permits characters that the shell interprets as command syntax.
Exploit preconditions
- Attack surface: Database password-change procedures in Dokploy
- Required access: An authenticated account authorized to update a database password
- Trigger point: The procedure constructs or runs a Bash command using the supplied password
- Why exploitation is possible: Permitted backticks in the password can be interpreted by Bash as command substitution before the database command runs
Why this happens
The underlying issue is command injection (CWE-77): data supplied as a password is incorporated into a shell command in a way that allows shell syntax to be interpreted as code. Input validation that permits backticks does not make shell interpolation safe; the vulnerable pattern is treating untrusted data as part of a command string rather than as a separate argument.
Potential impact
- An attacker with the required access may execute arbitrary operating-system commands
- Commands could run with the privileges of the Dokploy process, which may be root
- The host or service environment could be compromised
- Data, credentials, or other services accessible to the process could be exposed or altered
General mitigation guidance
Common defensive patterns focus on keeping untrusted values out of shell command syntax:
- Prefer direct library or database APIs, or invoke processes with argument arrays and without a shell.
- Avoid constructing commands through string interpolation; apply context-appropriate encoding when unavoidable.
- Treat password values as untrusted data and use validation as an additional safeguard, not as the primary defense against shell interpretation.
- Run the Dokploy process with the least privileges needed and limit its access to sensitive files and services.
How teams detect issues like this
- Use static analysis to identify shell execution APIs and command strings built through concatenation or interpolation.
- Review password-change code paths for values flowing from user input into Bash commands, including cases where validation permits shell metacharacters.
- Enforce code-review or CI policies that favor shell-free process invocation and flag unsafe command construction.
- Monitor for unexpected child processes or command execution by the Dokploy service account.

