Summary
A critical OS command injection vulnerability in Dokploy's backup file-listing endpoint allows an authenticated user with backup:read permission to execute arbitrary commands on the Dokploy host. The issue becomes risky when user-controlled search input is incorporated into an rclone command without safe argument handling.
Affected context
The vulnerability occurs in Dokploy deployments using the backup.listBackupFiles tRPC endpoint. It requires a reachable backup-management interface, an authenticated account with backup:read permission, and processing of the search parameter by the backup router. Deployments that expose this functionality to untrusted or broadly authorized users may have greater exposure.
Exploit preconditions
- Attack surface: Dokploy's backup.listBackupFiles tRPC endpoint
- Required access: An authenticated account with backup:read permission
- Trigger point: Processing the user-supplied search parameter during backup file listing
- Why exploitation is possible: The parameter is incorporated into an rclone command executed through a shell-backed child-process API without sufficiently separating data from command syntax
Why this happens
The underlying bug is command construction from user-controlled input. Although the search value passes through path normalization, normalization alone does not establish that the value is safe for shell command execution. Interpolating that value into a command executed by child_process.exec() can allow shell metacharacters or command syntax to alter the intended operation, matching CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Potential impact
- An attacker may execute arbitrary commands on the Dokploy host.
- The Dokploy service account or host environment could be compromised.
- Sensitive application, backup, or cloud-storage credentials could be exposed.
- Attackers could modify, delete, or exfiltrate hosted data.
- The vulnerability could enable lateral movement or broader infrastructure compromise.
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from backup operations and reducing the trust placed in request parameters.
Common defensive patterns include:
- Using process-spawn APIs that pass executable arguments as an array without invoking a shell.
- Applying strict allowlists and schema validation to search and path values.
- Treating path normalization as a separate concern from command safety.
- Using a dedicated rclone or storage-library interface rather than dynamically assembled shell commands.
- Restricting backup-read permissions according to least privilege and separating them from administrative capabilities.
- Running the service with minimal filesystem, network, and operating-system privileges.
- Protecting backup endpoints with authorization boundaries, auditing, and rate controls.
How teams detect issues like this
Detection approaches can include:
- Static analysis rules that identify shell-backed process execution with interpolated request values.
- Code review checks for string concatenation or template interpolation in command arguments.
- Tests that submit shell-sensitive input to endpoints handling paths, filenames, or search terms and verify that it remains data.
- Runtime monitoring for unexpected child processes, command interpreters, or unusual rclone activity from the Dokploy service.
- Policy enforcement that prohibits shell execution for externally influenced values unless a documented, reviewed exception exists.
- Neutral automated code-review or software-composition tools that flag command-injection patterns.

