/

CVE-2026-45662

Severity:

HIGH RISK

(8.8)

OS Command Injection in Dokploy Registry Deletion Function

CVE-2026-45662

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution on the Server

Severity:

HIGH RISK

(8.8)

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 registry deletion logic constructs a docker logout command using unsanitized user-controlled input, allowing shell metacharacters inside registryUrl to influence command execution.

If an attacker can register or control a registry URL value, they may inject arbitrary shell commands that execute with the Dokploy server's privileges when a registry is deleted.

Affected context

This vulnerability appears in Dokploy's backend service responsible for managing container registries, specifically in the deleteRegistry function within packages/server/src/services/registry.ts.

The issue is exposed whenever a registry record containing an attacker-controlled registryUrl value is deleted and the server issues docker logout ${response.registryUrl}.

Environments are at risk where:

  • Users can create or modify registry configurations, and
  • The Dokploy server has permission to run Docker CLI commands on the host without additional sandboxing.

Exploit preconditions

  • Attack surface: HTTP/API interface or UI flow that creates or manages registry configurations in Dokploy.
  • Required access: Ability to supply or influence the registryUrl value used by the registry management subsystem (e.g., adding or editing a registry entry).
  • Trigger point: Invoking the registry deletion feature (directly or indirectly) so that the backend executes docker logout ${response.registryUrl}.
  • Why exploitation is possible: The logout command interpolates registryUrl directly into a shell command without escaping, allowing shell metacharacters and command separators to be interpreted by the shell rather than treated as plain data.

Why this happens

The underlying bug is a classic OS command injection issue: user-controlled data is concatenated into a shell command string and executed without proper escaping or parameterization.

While the related docker login path uses shEscape() to safely handle the registry URL, the docker logout path omits this protection and passes the raw registryUrl to the shell.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where shell metacharacters in input are not neutralized, allowing attackers to alter the commands executed by the server.

Potential impact

  • Execution of arbitrary shell commands with the Dokploy server's operating system privileges.
  • Unauthorized access to or modification of application and system files on the host.
  • Retrieval or exfiltration of sensitive data such as environment variables, credentials, or configuration files.
  • Lateral movement from the Dokploy host to other infrastructure or services reachable from that host.
  • Service disruption, including stopping containers, altering deployments, or causing denial of service.

General mitigation guidance

Effective mitigation focuses on eliminating unsafe command construction patterns and minimizing the privileges of components that must issue OS commands.

Recommended defensive patterns include:

  • Avoid embedding user-controlled strings directly into shell command lines; instead, use APIs or libraries that accept argument arrays without invoking a shell.
  • Apply the same escaping and validation logic consistently across all command paths (e.g., ensure docker logout uses the same shEscape() or equivalent mechanism as docker login).
  • Validate registry URLs against a strict whitelist of acceptable formats (e.g., hostnames, optional port) before they are stored or used.
  • Isolate and run the Dokploy server with the minimum OS privileges necessary, limiting its ability to impact the broader system.
  • Where feasible, confine Docker and related tooling within restricted environments (containers, namespaces, or dedicated service accounts) to reduce blast radius.

How teams detect issues like this

Detection is best approached by combining code-centric and operational strategies:

  • Static analysis: Configure rules or linters to flag uses of shell-executing functions (e.g., exec, spawn with { shell: true }, or similar APIs) when they incorporate variables or concatenated strings. Highlight discrepancies where some paths use escaping helpers but others do not.
  • Code review: During review of infrastructure-management or deployment code, look for inconsistent use of escaping helpers, direct string interpolation into commands, and any invocation of Docker or system binaries that includes user-controllable values.
  • Security policies: Enforce development policies that prefer non-shell execution APIs (argument arrays) and require centralized helper functions for command construction, with automated checks in CI to prevent bypassing these helpers.
  • Runtime monitoring: Monitor logs and command execution telemetry for anomalous command patterns originating from the Dokploy server, such as unexpected shell operators, redirections, or chained commands in Docker-related invocations.

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-827c-7x62-29jq

Frequently asked

questions

It can be, depending on how Dokploy is exposed. If attackers can reach the registry management features over the network and create or influence registry configurations, they may trigger command injection when those registries are deleted.

The attacker must be able to supply or modify a registryUrl value that the server later uses in the deleteRegistry flow. In many deployments, this may correspond to an authenticated Dokploy user with permissions to configure registries.

Replace shell-based command construction with parameterized command execution that does not invoke a shell, or ensure all user-controlled arguments are passed through a robust escaping/validation helper consistently across all code paths.

Adopt a standard pattern for running OS commands that:

  • Prohibits direct string interpolation into shell commands,
  • Requires argument-based execution APIs and centralized sanitization helpers,
  • Enforces these rules through code review checklists and automated CI checks,
  • And pairs these practices with least-privilege execution environments for any component that must interact with system-level tooling.
Find out what's already
exploitable in your codebase.