CVE-2026-72884 Overview
CVE-2026-72884 is a command injection vulnerability [CWE-78] in Dokploy, a free, self-hostable Platform as a Service (PaaS). Versions prior to 0.29.13 contain a flawed sanitizeCommand function in packages/server/src/utils/builders/compose.ts. The function only trims whitespace and strips surrounding quotes from compose.command before it flows into exportEnvCommand and Docker command interpolation. An authenticated user with permission to update a Compose service can inject shell metacharacters and execute arbitrary commands on the Dokploy host. Dokploy released version 0.29.13 to remediate the issue.
Critical Impact
Authenticated users able to modify a Compose service can achieve arbitrary command execution on the underlying Dokploy host, leading to full host compromise.
Affected Products
- Dokploy versions prior to 0.29.13
- Self-hosted Dokploy PaaS instances exposing Compose service management
- Dokploy deployments where authenticated users can update Compose configurations
Discovery Timeline
- 2026-08-10 - CVE-2026-72884 published to NVD
- 2026-08-11 - Last updated in NVD database
- v0.29.13 - Dokploy releases patched version containing the fix
Technical Details for CVE-2026-72884
Vulnerability Analysis
The vulnerability resides in the sanitizeCommand helper used when building Docker Compose invocations. The function was designed to normalize a user-supplied compose.command string, but its sanitization logic performed only two operations: trimming whitespace and stripping matching surrounding quotes from each whitespace-separated token. It did not validate the content of the string against shell metacharacters.
The sanitized value is then interpolated into exportEnvCommand and passed to a shell that executes the docker invocation. Because the resulting string is evaluated by a shell, characters such as ;, &, |, backticks, $(), and redirection operators retain their meta-meaning. An authenticated user who can update a Compose service supplies a command value containing these metacharacters and escapes the intended docker ${command} context to execute arbitrary host commands.
Root Cause
The root cause is improper neutralization of special elements used in an OS command [CWE-78]. sanitizeCommand treated the input as a value to clean cosmetically rather than as untrusted data destined for a shell. It did not reject shell control characters, and it did not use safe argument quoting before shell interpolation.
Attack Vector
An attacker requires authenticated access with permission to update a Compose service in Dokploy. The attacker submits a Compose service update where the command field contains shell metacharacters. When Dokploy builds and executes the Docker invocation, the injected payload runs on the host with the privileges of the Dokploy runtime process.
// Patch: packages/server/src/utils/builders/compose.ts
// fix(security): escape compose path and validate custom compose command
// Shell control characters that must never appear in a user-provided compose
// command: they would let it break out of the `docker ${command}` invocation
// into arbitrary host commands. A normal docker compose CLI line never needs them.
const UNSAFE_COMPOSE_COMMAND = /[;&|`$(){}<>\n\\]/;
const sanitizeCommand = (command: string) => {
const sanitizedCommand = command.trim();
if (UNSAFE_COMPOSE_COMMAND.test(sanitizedCommand)) {
throw new Error(
"Invalid characters in compose command: shell control characters are not allowed",
);
}
const parts = sanitizedCommand.split(/\s+/);
const restCommand = parts.map((arg) => arg.replace(/^"(.*)"$/, "$1"));
// ...
};
Source: GitHub Commit d48037a. The patch adds a regex-based deny list that rejects shell control characters before the value is used in shell interpolation, and it introduces shell-quote for safer argument handling in packages/server/src/services/compose.ts.
Detection Methods for CVE-2026-72884
Indicators of Compromise
- Compose service definitions containing shell metacharacters such as ;, |, &, backticks, or $() in the command field.
- Unexpected child processes spawned by the Dokploy server process that are not docker or docker compose invocations.
- Outbound network connections or reverse shells originating from the Dokploy host shortly after a Compose service update.
- Modifications to system files, cron entries, or SSH authorized keys on the Dokploy host with no corresponding administrative action.
Detection Strategies
- Audit Dokploy application logs and database records for Compose services whose command value contains characters matched by the regex /[;&|$(){}<>\n\]/`.
- Monitor process execution telemetry on the Dokploy host for shells (sh, bash) spawned as descendants of the Dokploy Node.js runtime with arguments that are not standard Docker CLI flags.
- Correlate Compose service update events in application logs with subsequent host command executions to identify injection attempts.
Monitoring Recommendations
- Forward Dokploy application logs, container runtime logs, and host process events to a centralized log store for correlation and retention.
- Alert on new outbound network connections initiated by the Dokploy host process to previously unseen destinations.
- Track authenticated user activity that modifies Compose services and flag high-frequency or off-hours edits for review.
How to Mitigate CVE-2026-72884
Immediate Actions Required
- Upgrade Dokploy to version 0.29.13 or later, which contains the fix in commit d48037a.
- Review all existing Compose service definitions for command fields containing shell metacharacters and remove any suspicious entries.
- Rotate credentials, API tokens, and SSH keys stored on or accessible from the Dokploy host if unauthorized Compose edits are found.
- Restrict Compose service update permissions to the smallest set of trusted administrators until patching is complete.
Patch Information
The fix is available in Dokploy v0.29.13. See the GitHub Security Advisory GHSA-qh6h-669j-77rw, Pull Request #4863, the patch commit d48037a, and the v0.29.13 release notes. The patch rejects shell control characters in sanitizeCommand and adopts shell-quote for safer escaping of compose paths and arguments.
Workarounds
- If immediate upgrade is not possible, revoke Compose service edit permissions from all non-administrative accounts.
- Place the Dokploy management interface behind a VPN or network access control list to reduce the pool of potential authenticated attackers.
- Manually validate any Compose service command value before saving to ensure it contains no characters matching /[;&|$(){}<>\n\]/`.
# Upgrade Dokploy to the patched release
docker pull dokploy/dokploy:0.29.13
docker stop dokploy && docker rm dokploy
# Recreate the Dokploy container using the 0.29.13 image per official docs
# Verify the running version after restart
curl -s http://localhost:3000/api/health | jq '.version'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

