Summary
Dokploy contains an incomplete server-side validation fix for Git branch fields, allowing a low-privileged authenticated user to store a malicious branch value. When a deployment uses that value in shell-based Git commands, the attacker may execute arbitrary commands on the Dokploy host.
Affected context
The vulnerability affects Dokploy deployments in the impacted release range when branch-related fields accepted by the compose update workflow are not validated on the server. A subsequent compose deployment can pass values such as custom Git, GitHub, GitLab, Bitbucket, or Gitea branches into shell-based Git provider commands.
Exploit preconditions
- Attack surface: Authenticated compose management and deployment functionality
- Required access: A low-privileged authenticated account able to update compose configuration and trigger deployment
- Trigger point: Git clone or repository deployment commands executed during
compose.deploy - Why exploitation is possible: Branch values stored without adequate server-side validation are later incorporated into shell command execution paths
Why this happens
The underlying issue is an incomplete input-validation boundary. The application accepts branch-related values through a direct update request, but does not sufficiently validate them before they reach shell-based Git operations.
Treating user-controlled branch data as command input creates an OS command injection condition, mapping primarily to CWE-78. The missing server-side validation also relates to CWE-20, while relying on client-side or incomplete validation reflects CWE-602.
Potential impact
- An attacker may execute arbitrary commands on the Dokploy host
- A deployment worker or service account could be compromised
- Application secrets, repository credentials, or environment variables could be exposed
- Hosted applications and deployment infrastructure could be modified or disrupted
- The compromised host could be used for lateral movement or supply-chain manipulation
General mitigation guidance
Mitigation generally focuses on ensuring that repository and branch metadata remains data rather than shell syntax.
Common defensive patterns include:
- Enforcing strict server-side allowlists and format validation for branch values
- Avoiding shell interpretation by using argument-safe process APIs
- Separating Git command construction from untrusted input
- Applying validation consistently across every provider-specific deployment path
- Treating client-side validation as supplementary rather than authoritative
- Running deployment services with least privilege and isolating them from sensitive host resources
- Restricting access to compose updates and deployment triggers according to operational need
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules that identify shell execution with request-derived or database-derived arguments
- Code review checks for direct string interpolation in Git and process-launch commands
- Tests that submit malformed, metacharacter-containing, and unexpected branch values through API paths
- Policy enforcement requiring centralized server-side validation for repository metadata
- Runtime monitoring for unexpected child processes, unusual Git arguments, and deployments initiated by low-privileged accounts
Automated security review tools may help identify shell construction patterns, but findings should be confirmed across all provider integrations.

