Summary
A critical OS command injection vulnerability in Dokploy's registry testing functionality allows an authenticated user to execute arbitrary commands on a local or SSH-connected target server. The issue becomes risky when a registry password is incorporated into a shell command without safe argument handling.
Affected context
The vulnerability occurs in Dokploy's registry testing API routes, including registry.testRegistry and registry.testRegistryById, when they process registry credentials and contact a local or SSH-connected target server. Deployments may be exposed when an authenticated user can invoke these routes and supplied password data reaches a shell command through string interpolation.
Exploit preconditions
- Attack surface: Dokploy registry testing API endpoints
- Required access: An authenticated Dokploy account with permission to invoke the affected registry functionality
- Trigger point: Processing a registry test request containing attacker-influenced credential data
- Why exploitation is possible: The password value is interpolated into an
execAsyncRemoteshell command rather than passed through a safe command-construction path
Why this happens
The underlying bug is shell command construction from untrusted or insufficiently trusted input. By embedding the registry password directly into a command string, the application allows shell metacharacters or additional command syntax to be interpreted by the target shell. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.
Potential impact
- An attacker may execute arbitrary operating-system commands on the local target
- An attacker could execute commands on an SSH-connected target server
- Application data, credentials, or deployment secrets may be exposed
- The affected host could be modified, disrupted, or used for lateral movement
- Containers, services, or deployment pipelines may be compromised
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from credential-handling workflows and reducing the trust placed in request data.
Common defensive patterns include:
- Use structured process APIs that pass executable arguments separately instead of building shell command strings
- Reuse safe command-construction helpers for registry authentication and connection testing
- Treat passwords and other request fields as data, never as command fragments
- Apply strict authorization checks and least-privilege permissions to registry testing operations
- Restrict SSH targets and service-account capabilities to only the systems and actions required
- Avoid exposing sensitive command output and credentials in logs or error messages
- Isolate deployment workers and enforce network and filesystem boundaries where practical
How teams detect issues like this
Detection can include static analysis and review rules that flag shell execution APIs receiving interpolated request values, especially credential fields.
Code reviews should examine all paths that construct commands for local or SSH execution and verify that arguments are passed through structured APIs. Runtime monitoring can alert on unusual child processes, unexpected shell usage, or commands launched by the Dokploy service account. Policy enforcement may require approved process-execution wrappers, prohibit direct shell interpolation, and scan pull requests for unsafe command construction. Automated security review tools can help identify these patterns during development.

