Summary
Dokploy contains an OS command injection vulnerability in file mount handling, where an authenticated user with permission to create or update service mounts can supply shell metacharacters through the filePath value.
When the affected configuration is processed over SSH, attacker-controlled commands may execute on the configured remote managed server. In the default deployment model, this can result in direct remote code execution from the web interface.
Affected context
The issue affects Dokploy deployments using file mounts for services, particularly where:
- An authenticated account can create or modify service file mounts
- The filePath value is incorporated into a command or remote operation
- The operation is performed on a managed server over SSH
- Input is not safely separated from shell command construction
Risk depends on the permissions granted to the authenticated user and the privileges available to the remote managed server.
Exploit preconditions
- Attack surface: Dokploy's authenticated web interface for service file mounts
- Required access: An authenticated account authorized to create or update file mounts
- Trigger point: Processing or applying a service mount configuration on the remote managed server
- Why exploitation is possible: The filePath value can influence shell command interpretation when passed through an SSH-backed command execution path
Why this happens
The vulnerability is caused by incorporating attacker-influenced file path data into shell commands without reliably preventing shell interpretation.
When command construction treats a path as executable command text rather than as data, shell metacharacters can alter the intended command behavior. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.
Potential impact
- Attacker-controlled commands may execute on the configured remote managed server
- The affected host could be compromised with the privileges of the SSH-connected account
- Application data, deployment secrets, or service credentials may be exposed
- An attacker could alter deployed services or disrupt hosted workloads
- Additional systems may be affected through lateral movement or stolen credentials
General mitigation guidance
Mitigation generally focuses on ensuring that file paths remain data throughout the full execution path and that shell interpretation is not required.
Common defensive patterns include:
- Prefer direct process execution APIs that pass arguments separately rather than invoking a shell
- Apply strict, context-appropriate path validation and canonicalization
- Use allowlisted mount locations and reject unexpected path formats
- Avoid constructing remote shell commands from user-controlled values
- Reduce SSH account and remote service privileges to the minimum required
- Restrict which authenticated roles can create or modify service mounts
- Use isolated deployment identities and narrowly scoped credentials
- Treat web-interface configuration values as untrusted even when submitted by authenticated users
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying shell execution APIs that receive concatenated or interpolated user input
- Code review checks for remote command construction involving file paths or mount parameters
- Tests using metacharacter-oriented inputs to verify that values remain inert data
- Runtime monitoring of unusual commands executed by Dokploy's SSH identities
- Audit logging for service mount creation and modification events
- Policy enforcement that prohibits shell-based remote execution where direct argument passing is available
Automated security review tools may help identify command construction and insufficient input-neutralization patterns.

