Summary
Dokploy versions 0.28.8 and earlier contain an authenticated OS command injection vulnerability in the /listen-deployment WebSocket endpoint that allows arbitrary system commands to be executed on remote servers managed by Dokploy.
Any authenticated organization member who can reach this endpoint may be able to trigger command execution in the deployment environment, potentially resulting in full server compromise.
Affected context
This vulnerability affects Dokploy instances where:
- The Dokploy application is configured to manage deployments on one or more remote servers.
- Organization members have authenticated access to deployment-related WebSocket functionality, including
/listen-deployment. - Server-side logic incorporates user-controllable values into OS-level commands or scripts that run on managed hosts.
The risk is highest in environments where Dokploy controls production workloads or hosts sensitive data, and where organization membership is broad or delegated.
Exploit preconditions
- Attack surface: Dokploy backend, specifically the
/listen-deploymentWebSocket endpoint. - Required access: Valid authenticated user credentials with membership in the organization configured on the Dokploy instance.
- Network conditions: Ability to establish a WebSocket connection to the Dokploy server over the configured management network.
- Trigger point: Sending crafted WebSocket messages or parameters that are propagated into OS-level commands on the managed servers.
- Why exploitation is possible: User-controlled data is incorporated into shell commands or command-line arguments without adequate validation, sanitization, or use of safe command execution primitives, enabling injection of additional commands or arguments.
Why this happens
The underlying issue is an OS command injection flaw, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command.
In the vulnerable implementation, data influenced by authenticated users over the /listen-deployment WebSocket is passed into shell commands or command interpreters on Dokploy-managed servers.
Instead of treating user input as opaque data, the code likely concatenates strings or interpolates variables directly into command lines, allowing attackers to inject command separators or additional shell syntax.
This pattern breaks the boundary between data and executable instructions, enabling arbitrary command execution with the privileges of the process or service account used to perform deployments.
Potential impact
- Execution of arbitrary system commands on servers managed by Dokploy.
- Full compromise of affected servers, including installation of backdoors or persistence mechanisms.
- Access to and exfiltration of sensitive data stored on compromised hosts.
- Modification or destruction of application data, logs, or configuration.
- Abuse of compromised servers for lateral movement within the infrastructure.
- Use of affected servers as a platform for further attacks, such as launching network scans or denial-of-service traffic.
General mitigation guidance
Long-term mitigation focuses on eliminating direct command injection pathways and narrowing trust around deployment operations:
- Prefer safe command execution APIs that do not invoke a shell and that pass parameters as separate arguments, avoiding string concatenation of commands.
- Normalize and strictly validate all user-controllable fields used in deployment operations against allowlists (e.g., known deployment identifiers, fixed action names).
- Separate control data from execution logic by using structured configuration formats and job descriptors rather than raw command strings.
- Restrict the permissions of the Dokploy service account on managed servers, applying least privilege and isolating deployment users from sensitive system resources.
- Introduce robust authorization checks on deployment-related WebSocket endpoints, limiting who can initiate or listen to deployment actions.
- Log deployment commands and responses in a tamper-evident way, while avoiding logging secrets, to support post-incident investigation and anomaly detection.
These patterns reduce the chance that attacker-controlled values can influence low-level system operations.
How teams detect issues like this
Detection of this class of flaw and its potential exploitation can involve a combination of code-focused and operational strategies:
- Static analysis: Configure rules to flag use of shell-invoking APIs (e.g., generic shell command runners,
exec-style functions, or command-building helpers) where arguments are derived from WebSocket or HTTP request data without canonicalization and strict validation. - Code review signals: During manual review, look for string concatenation or template interpolation used to build command lines, especially in deployment or management modules and WebSocket message handlers.
- Runtime monitoring: Track deployment-related activity logs for unusual command patterns, unexpected arguments, or commands not associated with known deployment workflows.
- Policy enforcement: Establish secure coding guidelines that prohibit direct shell invocation with untrusted data and enforce them via CI checks, pre-commit hooks, or automated code review tools integrated into the development pipeline.

