/

CVE-2026-72865

Severity:

CRITICAL RISK

(9.9)

OS Command Injection (CWE-78) in Dokploy Deployment

CVE-2026-72865

Received

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical OS command injection vulnerability in Dokploy allows an authenticated member with compose write and deploy permissions to influence shell commands through an unvalidated compose path. When a deployment or compose-start operation processes the crafted path, arbitrary operating-system commands may execute in the Docker-privileged Dokploy host context.

Affected context

The issue occurs in Dokploy deployments that process compose paths through shell commands such as Docker Compose, Docker Stack, or file-touch operations. Risk is present when a user has the required compose write and deploy permissions and the application interpolates a user-controlled path into a shell invoked through /bin/sh -c.

Exploit preconditions

  • Attack surface: Authenticated Dokploy compose management and deployment functionality
  • Required access: A member account with compose write and deploy permissions
  • Trigger point: A compose deployment or compose-start operation that processes the stored compose path
  • Why exploitation is possible: The compose path is not sufficiently validated before being interpolated into shell commands executed by a Docker-privileged host process

Why this happens

The vulnerability results from placing user-controlled path data into shell command strings without reliably separating data from command syntax. When those strings are executed through /bin/sh -c, shell metacharacters or command substitutions within the path may be interpreted as additional commands rather than as a filename.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection. The insecure pattern is constructing shell commands through string interpolation instead of using structured process execution and tightly constrained, validated path values.

Potential impact

  • An attacker may execute arbitrary operating-system commands
  • The Dokploy host and its managed workloads could be compromised
  • Docker-accessible resources, secrets, and service data could be exposed
  • Attackers could alter deployments, inject malicious workloads, or disrupt services
  • The incident could enable lateral movement into connected infrastructure

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from compose operations and reducing trust in user-supplied paths.

Common defensive patterns include:

  • Using structured process APIs with argument arrays instead of /bin/sh -c
  • Treating compose paths as identifiers resolved from controlled directories rather than arbitrary command fragments
  • Canonicalizing paths and enforcing allowlisted roots, filename rules, and file types
  • Validating inputs before storing them and again immediately before execution
  • Applying least privilege to application processes, Docker integrations, service accounts, and deployment roles
  • Separating deployment permissions from broader host or Docker administration capabilities
  • Restricting access to deployment files, secrets, sockets, and host-mounted resources

How teams detect issues like this

Detection can combine source review, runtime monitoring, and authorization analysis:

  • Use static analysis rules to identify shell execution APIs, /bin/sh -c, and string interpolation involving request or database-derived values
  • Review code paths that build Docker Compose, Docker Stack, or filesystem commands from configurable paths
  • Flag process execution where arguments are assembled as a single command string
  • Monitor deployment events for unexpected compose paths, unusual command activity, or changes outside approved project directories
  • Audit role definitions to confirm that compose write and deploy permissions are narrowly assigned
  • Enforce repository and CI policies that reject unsafe shell construction and require structured command execution
  • Use automated code review tools as a supplementary way to identify command-injection patterns

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/commit/d48037a80203bb0ecaec4f5653aef75fcfdb656d
github.comgithub.com/Dokploy/dokploy/pull/4863
github.comgithub.com/Dokploy/dokploy/releases/tag/v0.29.13
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-8r5w-vqjr-8c44

Frequently asked

questions

It can be exploitable through Dokploy's authenticated application interface when the affected compose deployment functionality is reachable and the attacker has the required permissions. It does not generally represent an unauthenticated attack.

Exploitation requires an authenticated member account with compose write and deploy permissions, or another path to obtain equivalent authorization.

Avoid constructing shell command strings from user-controlled values. Use structured process execution, constrain compose paths to approved locations, and validate them before both storage and execution.

Apply least-privilege authorization, treat paths and deployment settings as untrusted input, perform security-focused code review of process execution, and monitor deployment operations for anomalous paths or commands.

Find out what's already
exploitable in your codebase.