Summary
Dokploy backup workflows may construct rclone shell commands using a backup prefix that preserves shell metacharacters. An authenticated organization member with backup permission for a service could exploit this when a backup or retention cleanup runs, potentially executing commands with root privileges on the Dokploy host or configured remote server.
Affected context
The issue affects Dokploy backup workflows where a prefix is interpolated into rclone upload or retention-cleanup command strings without removing or safely handling shell metacharacters. It may occur across supported PostgreSQL, MySQL, MariaDB, MongoDB, libSQL, Compose, and web-server backups when an authorized backup workflow runs manually, on schedule, or during retention cleanup. The described flaw applies to versions before the fix in 0.31.1.
Exploit preconditions
- Attack surface: Dokploy service backup and retention-cleanup workflows that invoke rclone.
- Required access: An authenticated organization member with backup permission for the relevant service.
- Trigger point: A manual or scheduled backup, or a retention-cleanup operation.
- Why exploitation is possible: The backup prefix is checked only for being nonempty; shell metacharacters can remain in the normalized value when it is interpolated into command strings.
- Execution context: Commands may run as root on the Dokploy host or on the configured remote server.
Why this happens
The underlying flaw is OS command injection, mapped to CWE-78. A value that can be influenced through the backup prefix is inserted into a shell command without safe argument handling or adequate neutralization of shell syntax. Checking only that the value is nonempty does not establish that it is safe to pass to a command interpreter.
Potential impact
- An attacker may execute arbitrary commands with root privileges in the backup execution environment.
- The Dokploy host or configured remote server could be compromised.
- Data or backup integrity could be altered, destroyed, or exposed.
- Compromised systems could be used for further access to connected services or infrastructure.
General mitigation guidance
Defensive patterns focus on preventing user-controlled values from becoming shell syntax:
- Prefer direct process execution with an argument array over constructing shell command strings.
- Treat backup prefixes as untrusted input; validate them against a narrow, documented format and reject unsupported characters.
- Use safe-by-default command and path handling that preserves values as data rather than interpreting them through a shell.
- Keep backup and cleanup processes limited to the least privileges needed, and constrain their access to hosts, files, and remote destinations.
- Reduce who can configure or trigger backups, and apply equivalent controls to manual, scheduled, and retention-cleanup paths.
How teams detect issues like this
- Use static analysis to flag shell command construction that interpolates configuration or user-controlled values.
- Review backup and cleanup code for shell invocation APIs, string concatenation, and values passed from service settings into command arguments.
- Enforce code-review or CI policies requiring argument-array execution and validation of command inputs.
- Monitor backup process activity for unexpected command execution, privilege use, or changes to backup destinations and files.
- Automated code review tools may help identify unsafe shell interpolation patterns.

