Summary
Dokploy's local file-mount deletion path passes a user-controlled path to a shell command without safely separating it from command syntax. An authenticated member with file-mount creation and deletion permissions may execute arbitrary commands in the host context when deleting a local mount, even if no container is running.
Affected context
The issue occurs in Dokploy's local file-mount deletion flow. The local removal helper interpolates the user-controlled file path into an unquoted rm -rf command; the remote branch handles the path differently by quoting it. Risk depends on a user being able to create and delete file mounts with a path that reaches this local command.
Exploit preconditions
- Attack surface: Local file-mount deletion
- Required access: An authenticated account with file-mount create and delete permissions
- Trigger point: Deleting a local file mount
- Why exploitation is possible: The user-controlled path is interpolated unquoted into a shell command, allowing shell syntax to be interpreted as commands
- Runtime dependency: A running container is not required
Why this happens
The local removal helper constructs a shell command by inserting a user-controlled path without safely handling shell metacharacters or keeping the path separate from command syntax. This is OS command injection, mapped to CWE-78; more broadly, it is a command-injection weakness under CWE-77. Quoting the remote branch does not protect the vulnerable local branch.
Potential impact
- An attacker may execute arbitrary commands in the host context
- Host files or services could be modified or disrupted
- Sensitive data could be accessed or altered
- The host environment could be used for further compromise
General mitigation guidance
Mitigation patterns include avoiding shell interpretation when performing file operations and passing paths as discrete arguments to APIs that do not invoke a shell. Treat user-controlled paths as untrusted, apply canonicalization and boundary checks appropriate to the intended mount location, and enforce authorization for both creating and deleting mounts. Run services with the least privileges needed so that command execution, if it occurs, has a limited scope.
How teams detect issues like this
- Use static analysis to identify shell-command construction that concatenates or interpolates user-controlled values.
- Review file deletion helpers and compare how local and remote branches handle paths.
- Check for process-execution calls that pass assembled command strings rather than argument arrays.
- Enforce code-review or CI policies that prohibit unsafe shell invocation patterns and require validation of user-controlled filesystem paths.

