/

CVE-2026-45628

Severity:

CRITICAL RISK

(9.6)

Command Injection in Dokploy PaaS

CVE-2026-45628

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-20, CWE-77

Impact:

Remote Code Execution by Authenticated Users

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 versions 0.29.2 and earlier construct shell commands with JavaScript template literals and execute them via child_process.exec() while directly embedding user-controlled values such as branch names, repository URLs, and Docker credentials.

Because these parameters are not escaped or validated, an authenticated user with create/edit permissions can inject arbitrary shell syntax, potentially leading to remote code execution on the host running Dokploy.

Affected context

This vulnerability appears in Dokploy's deployment and build logic where Git and Docker-related operations are invoked through shell commands composed as strings in JavaScript.

It is relevant when:

  • Dokploy uses child_process.exec() (or equivalent) to run shell commands via /bin/sh -c
  • User-supplied values (branch names, repository URLs, Docker usernames/passwords, image names, etc.) are concatenated into the command string
  • No robust argument escaping, shell quoting, or strict validation is applied to these values

The risk is most pronounced in multi-tenant or team environments where non-admin, but authenticated, users can create or edit applications and deployment settings.

Exploit preconditions

  • Attack surface: Dokploy web UI or API endpoints that allow configuring deployments (branches, repositories, Docker credentials, image settings).
  • Required access: Valid authenticated Dokploy account with permissions to create or edit applications or deployment configurations.
  • Trigger point: A deployment, build, or related operation that causes Dokploy to interpolate the configured values into a shell command and execute it with child_process.exec() (via /bin/sh -c).
  • Why exploitation is possible:
  • Shell commands are constructed as template literal strings.
  • User-controlled fields are inserted without proper quoting or escaping.
  • exec() invokes a shell interpreter, which treats special characters (;, &&, |, backticks, $(), etc.) as control operators rather than data, enabling injected shell fragments to be executed.

Why this happens

The underlying bug is a classic command injection pattern described by CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), compounded by insufficient input validation (CWE-20).

Application logic constructs full shell command strings by concatenating or interpolating user-supplied parameters and then executes them using child_process.exec(), which delegates to /bin/sh -c.

Because these parameters are not strictly validated against expected formats (e.g., a branch name, URL, or username) and are not safely passed as separate arguments to a non-shell API (such as spawn with an argument array), the shell parses metacharacters from user input as part of the command language.

This design effectively treats partially untrusted configuration data as executable shell syntax, allowing additional commands or options to be injected into the runtime environment.

Potential impact

  • Remote execution of arbitrary commands as the Dokploy service user.
  • Access to sensitive environment variables (e.g., API keys, cloud credentials) accessible to the Dokploy process.
  • Reading, modifying, or deleting files on the host where Dokploy is running, subject to process privileges.
  • Tampering with application source code or deployment artifacts, including injecting malicious content into deployed services.
  • Lateral movement to other services or infrastructure reachable from the compromised host.
  • Denial of service by terminating critical processes, exhausting system resources, or corrupting deployments.

General mitigation guidance

Reducing exposure to command injection in systems that orchestrate tooling like Git and Docker usually requires reshaping how commands are built and executed, rather than just filtering inputs.

Safer command execution patterns:

  • Prefer APIs that avoid invoking a shell altogether (e.g., using spawn/execFile with an argument array instead of exec with a single command string).
  • Use strict, typed parameterization for external tool invocations where user input is passed as discrete arguments, never as part of a shell command line.

Input validation and normalization:

  • Apply whitelist-based validation for fields such as branch names, repository URLs, and usernames (e.g., allowed character sets and length limits).
  • Normalize and reject values containing shell control characters or unexpected patterns for the given field type.

Privilege and environment hardening:

  • Run Dokploy and invoked tools under a least-privilege account with minimal filesystem and network permissions.
  • Isolate build and deployment operations in containers or sandboxes that limit the blast radius if command execution is abused.
  • Avoid storing high-value secrets in the same environment unless strictly necessary; prefer scoped, short-lived credentials.

Secure-by-default configuration:

  • Disable or gate any optional features that involve raw shell command fields unless they can be carefully constrained.
  • Provide administrative controls and clear documentation so operators understand which fields are treated as data vs. executable context.

How teams detect issues like this

Detecting and preventing this pattern is most effective when combined across code, configuration, and runtime layers.

Static analysis and code review:

  • Search for usages of child_process.exec() or other shell-based execution APIs where arguments are built from template literals or string concatenation involving request or configuration data.
  • Flag any code where user-controlled fields (branch names, URLs, credentials, image names) appear inside a single shell command string rather than as separate arguments.
  • Review for missing validation logic around deployment configuration fields, especially where values are later used to invoke Git, Docker, or system utilities.

Automated policy enforcement:

  • Introduce linting or secure coding rules that forbid or restrict use of exec() in production paths, requiring safer alternatives (execFile, spawn with argument arrays).
  • Use security-focused static analysis tools that can trace tainted data from HTTP handlers or configuration inputs into command execution sinks.

Runtime and operational detection:

  • Monitor process execution logs for unusual or unexpectedly complex command lines originating from Dokploy (e.g., multiple chained commands, redirections, or shells).
  • Enable system or container-level auditing to capture and alert on anomalous command patterns, especially when they interact with sensitive files or admin tooling.

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-3frc-cfh9-ch2c

Frequently asked

questions

Exploitation requires an authenticated Dokploy account with permissions to create or modify applications or deployment settings.

In single-tenant setups where only trusted administrators have such access, the practical risk may be lower; however, in multi-tenant or team scenarios, any compromised or malicious user account with these privileges could abuse the issue.

An attacker needs valid credentials and the ability to configure or edit deployments (e.g., setting branch names, repository URLs, or Docker credentials).

No direct shell or host access is necessary; the malicious input is provided through the Dokploy interface or API and executed indirectly when a deployment or related operation runs.

The most robust fix is to eliminate shell-based command construction for user-influenced operations.

Use command execution APIs that accept an executable plus a list of arguments (avoiding /bin/sh -c), and ensure that each user-supplied value is passed as a separate, typed argument after strict validation.

Adopt a general policy of never interpolating untrusted data into shell command strings.

Combine this with:

  • Whitelist-based validation on configuration fields.
  • Secure coding guidelines that discourage exec() in favor of safer alternatives.
  • Automated checks in CI to detect new instances of dangerous command construction patterns before they reach production.
Find out what's already
exploitable in your codebase.