/

CVE-2026-72877

Severity:

CRITICAL RISK

(9.6)

OS Command Injection (CWE-78) in Dokploy Docker Builds

CVE-2026-72877

Received

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution and Build Host Compromise

Severity:

CRITICAL RISK

(9.6)

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 user with application create or update permission to influence shell commands through the dockerImage field. When a build targets the local host or a remote SSH build target, crafted input may execute arbitrary commands and expose host or project data.

Affected context

The vulnerability occurs in Dokploy Docker build workflows before version 0.29.13, where the dockerImage value is treated as an optional string and interpolated into shell commands without adequate quoting. It may affect deployments that permit authenticated users to create or update applications and that use either local builds or remote SSH build targets.

Exploit preconditions

  • Attack surface: Dokploy application creation or update functionality and its Docker build process
  • Required access: An authenticated account with permission to create or update applications
  • Trigger point: Processing of the dockerImage field during a local or remote Docker build
  • Why exploitation is possible: User-controlled input is inserted into shell commands without robust argument separation or escaping, allowing shell interpretation on the selected build host

Why this happens

The underlying issue is command construction from untrusted application metadata. The dockerImage field is validated only as a string and is then interpolated into shell commands without quoting or safe process-argument handling. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because shell syntax supplied through a data field can be interpreted as executable command content.

Potential impact

  • An attacker may execute arbitrary commands on a local build host
  • An attacker may execute commands on a configured remote SSH build target
  • Host credentials, environment secrets, or configuration data could be exposed
  • Other projects, containers, or build artifacts may be accessed or modified
  • Build integrity could be undermined through artifact tampering or supply-chain abuse
  • The affected host could be used for lateral movement, depending on its privileges and network access

General mitigation guidance

Mitigation generally focuses on preventing user-controlled values from becoming shell syntax.

Common defensive patterns include:

  • Use APIs that pass commands and arguments as structured arrays rather than constructing shell command strings
  • Apply strict allowlist validation for image references, registries, names, tags, and digests
  • Treat application metadata as untrusted even when submitted by authenticated users
  • Avoid invoking a shell when direct process execution is sufficient
  • Apply least-privilege permissions to local and remote build accounts
  • Restrict build-host network access and protect environment secrets from build processes
  • Isolate builds from other projects and sensitive host resources
  • Enforce immutable or centrally governed build configuration where practical

How teams detect issues like this

High-level detection can include:

  • Static analysis rules for string interpolation or concatenation of user-controlled values into shell commands
  • Code review checks for shell execution APIs that receive assembled command strings
  • Tests using metacharacter handling and argument-boundary cases without relying on production systems
  • Runtime monitoring for unexpected child processes launched by build services
  • Audit logging for application updates, build-target selection, and unusual build commands
  • Policy enforcement requiring structured process execution and approved container image references
  • Automated code review tools that flag command construction from request or application metadata

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/commit/cba0b253c7de4157dd932de7f16a2ad247c7cee9
github.comgithub.com/Dokploy/dokploy/pull/4860
github.comgithub.com/Dokploy/dokploy/releases/tag/v0.29.13
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-jxxj-gmpx-h5rj

Frequently asked

questions

It can be exploited through Dokploy's application management interface when the attacker has the required authenticated application create or update permission. The resulting command execution occurs on the configured local or remote build host.

Yes, under the described conditions, the attacker needs an authenticated account with permission to create or update an application. The practical impact also depends on the privileges and connectivity available to the build account.

The safest pattern is to avoid shell interpretation entirely by using structured process execution with separately validated arguments. Image references should be restricted to an approved format or registry policy.

Treat all application metadata as untrusted, prohibit shell-string construction in build workflows, apply least privilege and isolation to build hosts, and use static analysis, code review, and runtime monitoring to identify unsafe command execution.

Find out what's already
exploitable in your codebase.