Summary
Dokploy contains an OS command injection vulnerability in its volume backup operations, where an authenticated low-privilege member can influence a value passed to a shell command.
When the affected backup functions process attacker-controlled input, commands may execute on the Dokploy control-plane host with privileges associated with its Docker access, potentially providing host- or root-equivalent control.
Affected context
The issue affects Dokploy deployments using the volume backup functionality before the security fix was introduced. It becomes risky when a low-privilege authenticated member can submit or influence the volumeName value accepted by volumeBackup.create or volumeBackup.runManually, and the application executes the resulting command through a shell on the control-plane host.
Docker socket access can significantly increase the impact because commands executed in the application environment may be able to control containers or reach host-level resources.
Exploit preconditions
- Attack surface: Authenticated Dokploy volume backup functionality
- Required access: A valid account with low-privilege member permissions sufficient to invoke the affected backup operations
- Trigger point: Processing of the
volumeNamefield by the volume backup implementation - Execution path: The value is interpolated into a command and executed through a shell-backed process execution API
- Why exploitation is possible: Input is not safely separated from shell syntax before command execution, allowing data intended as a volume identifier to influence command interpretation
Why this happens
The vulnerability results from constructing a shell command by interpolating an externally influenced value without appropriate quoting or argument isolation.
Passing this constructed command to child_process.exec permits shell metacharacters and command syntax in the input to alter the command that is executed. This is CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection. Docker socket exposure further broadens the consequences of code execution within the control-plane environment.
Potential impact
- An attacker may execute arbitrary commands on the Dokploy control-plane host
- The attacker could gain control over managed containers and deployment resources
- Sensitive application secrets, credentials, or configuration data may be exposed
- The attacker may alter deployments, backup content, or hosted workloads
- The vulnerability can enable lateral movement or broader infrastructure compromise
General mitigation guidance
Mitigation generally focuses on eliminating shell interpretation and reducing the trust placed in user-controlled identifiers.
Common defensive patterns include:
- Prefer direct process-spawning APIs that pass arguments as structured arrays rather than invoking a shell
- Validate volume names against a strict allowlist or expected identifier format
- Apply context-appropriate argument escaping when shell execution cannot be avoided
- Separate user-controlled values from command templates and avoid string-based command construction
- Restrict access to volume backup operations according to least privilege
- Limit Docker socket exposure and use narrowly scoped service identities where possible
- Store credentials and deployment secrets outside attacker-reachable process environments
- Use patched application releases through the organization's normal change-management process
How teams detect issues like this
Detection can combine source analysis, runtime monitoring, and authorization review.
- Use static analysis rules to identify
child_process.execcalls that incorporate request, form, API, or database values into command strings - Review code for string interpolation or concatenation in shell commands, especially around backup, deployment, and container-management features
- Flag process-execution APIs that receive unsanitized identifiers or filenames
- Monitor control-plane hosts for unexpected child processes, command interpreters, container-management actions, and changes to deployment resources
- Audit which roles can invoke volume backup operations and whether those permissions exceed operational requirements
- Enforce secure coding policies that require structured process arguments and strict validation of resource names
- Automated code review and software composition analysis tools may help identify recurring command-construction patterns

