/

CVE-2026-72878

Severity:

CRITICAL RISK

(9.6)

OS Command Injection (CWE-78) in Dokploy Backup Pipeline

CVE-2026-72878

Received

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on the Dokploy Host

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

Dokploy's backup and restore pipeline constructs shell commands by directly embedding user-controlled database fields into shell command strings. An authenticated administrator or owner may exploit this behavior to execute arbitrary operating-system commands on the host running Dokploy, rather than only within an application container.

Affected context

This vulnerability affects Dokploy deployments whose backup or restore workflows build shell commands from database-controlled values and execute those commands through shell-enabled process APIs. Exploitation generally depends on an authenticated user having administrator or owner privileges and on the affected workflow processing attacker-influenced fields.

Exploit preconditions

  • Attack surface: Dokploy backup and restore functionality
  • Required access: Authenticated administrator or owner access, or another capability that permits influencing the relevant database fields
  • Trigger point: Execution of a backup or restore operation that incorporates the stored values into a shell command
  • Why exploitation is possible: User-controlled data is interpolated into bash -c or sh -c command strings before execution through a child-process API, allowing shell metacharacters and additional commands to be interpreted by the host shell

Why this happens

The underlying bug is command construction through string interpolation followed by shell interpretation. Rather than treating database values as inert arguments, the application combines them with shell command text and passes the result to a shell-enabled execution function.

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 occurs when data that may be influenced by users crosses into an operating-system command interpreter without robust separation from command syntax.

Potential impact

  • An attacker may execute arbitrary commands with the privileges of the Dokploy service
  • The host operating system could be compromised
  • Application secrets, credentials, and deployment data may be exposed
  • Managed applications or infrastructure could be modified, disrupted, or deleted
  • The compromised host could be used for lateral movement or persistence
  • Backups and restored data could be tampered with

General mitigation guidance

Mitigation generally focuses on eliminating shell interpretation and reducing trust in values used by backup and restore workflows.

Common defensive patterns include:

  • Prefer direct process APIs that accept an executable and an argument array rather than a shell command string
  • Avoid passing user-controlled values to bash -c, sh -c, or equivalent shell interpreters
  • Apply strict allowlists and type validation to fields that select files, databases, hosts, or operations
  • Use canonicalized, application-managed identifiers instead of accepting arbitrary command fragments or paths
  • Separate command construction from data handling and enforce validation before invoking external processes
  • Run backup and restore workers with the minimum host and filesystem privileges required
  • Restrict access to administrative workflows and protect stored configuration and database fields from unauthorized modification
  • Use isolation boundaries where feasible, while recognizing that container isolation alone does not address host-level command execution

How teams detect issues like this

High-level detection can combine source review, runtime monitoring, and policy enforcement:

  • Use static analysis rules to identify shell-enabled process execution, including exec() calls and uses of bash -c or sh -c
  • Search for string concatenation, interpolation, or template construction involving database fields near process-spawning APIs
  • Review backup and restore code for values that represent paths, filenames, connection parameters, or command options
  • Add code-review checks requiring argument-array process APIs and documented validation for external-process inputs
  • Monitor host process creation from Dokploy services and alert on unexpected shells, interpreters, or administrative utilities
  • Record and review privileged backup and restore activity, including the initiating identity and affected resources
  • Enforce application security policies that prohibit unsanitized user or database data from reaching shell interpreters
  • Automated code-review and software-composition tools may help identify common command-injection patterns, but should be supplemented with manual review

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/commit/d02f34f9d48b363b9bf15a948e263ff4ebfcceda
github.comgithub.com/Dokploy/dokploy/pull/4873
github.comgithub.com/Dokploy/dokploy/releases/tag/v0.29.13
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-p2c7-8j28-c7gq

Frequently asked

questions

It can be reachable through Dokploy's authenticated administrative workflows. Exploitation requires access to the backup or restore functionality and the ability to influence values processed by that workflow.

Yes, the described attack path requires an authenticated administrator or owner. The practical exposure also depends on whether the administrative interface is reachable and whether additional access controls limit those operations.

The safest pattern is to avoid shell interpretation entirely and invoke external programs through APIs that pass validated arguments separately. Values should be constrained by strict schemas and allowlists before they reach process execution.

Treat database and configuration values as untrusted at command boundaries, prohibit shell command construction from interpolated data, review privileged workflows for process execution, and apply least-privilege permissions to the service and its backup components.

Find out what's already
exploitable in your codebase.