Summary
A critical OS command injection vulnerability in Dokploy allows unvalidated Bitbucket owner and repository values to become part of Git clone commands.
A member with service deployment permission may be able to execute arbitrary operating system commands on the Dokploy host or a configured target server when Bitbucket repository cloning is triggered.
Affected context
The vulnerability occurs in Dokploy deployments that use the Bitbucket provider to clone repositories and accept repository owner or name values through the application configuration workflow. It becomes risky when a user with service deployment permission can influence those values and the resulting command is executed through a local or remote shell without adequate argument isolation.
Exploit preconditions
- Attack surface: Dokploy Bitbucket provider and repository deployment workflow
- Required access: A member account with permission to deploy services or otherwise influence Bitbucket deployment settings
- Trigger point: Cloning a Bitbucket repository during application deployment
- Why exploitation is possible: Unvalidated owner and repository values are interpolated into shell commands executed through local or remote command helpers
Why this happens
The underlying bug is command construction from attacker-influenced input. The application stores Bitbucket owner and repository fields without sufficient validation, then embeds those values into a command string passed to shell-execution functions.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The insecure pattern is treating repository metadata as trusted command syntax instead of separating data from executable arguments and enforcing an appropriate input model.
Potential impact
- An attacker may execute arbitrary operating system commands on the Dokploy host.
- An attacker could execute commands on a configured target server through remote deployment operations.
- Application credentials, environment variables, deployment secrets, or source code may be exposed.
- The affected host or target server could be modified, disrupted, or used for lateral movement.
- Deployments and hosted applications could be tampered with or rendered unavailable.
General mitigation guidance
Mitigation generally focuses on eliminating shell interpretation of repository metadata and reducing the trust placed in deployment inputs.
Common defensive patterns include:
- Use a process execution API that passes commands and arguments as separate values without invoking a shell.
- Apply allowlisted validation for repository owners, repository names, and provider-specific identifiers.
- Avoid building command strings through interpolation or concatenation.
- Restrict deployment permissions according to least privilege and separate repository configuration from command execution authority.
- Limit credentials, filesystem access, and network permissions available to deployment workers and target servers.
- Treat locally supplied and remotely retrieved repository metadata as untrusted input.
How teams detect issues like this
Organizations can look for:
- Static analysis findings involving shell execution APIs, command-string interpolation, and concatenation of request or configuration values.
- Code review signals where repository, branch, owner, or URL fields flow into local or remote command runners.
- Runtime monitoring for unusual Git clone arguments, shell metacharacters, unexpected child processes, or deployment commands outside normal workflows.
- Policy checks requiring argument-array process execution and approved validation routines for deployment integrations.
Automated security review tools can help identify data flows from deployment inputs into command execution functions.

