/

CVE-2026-27130

Severity:

CRITICAL RISK

(9.9)

OS Command Injection in Dokploy PaaS Service Operations

CVE-2026-27130

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution with Server-Level Privileges

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

Dokploy versions 0.26.6 and below contain an OS command injection vulnerability in the appName parameter, where user-controlled values are interpolated directly into shell commands.

An authenticated attacker can craft a malicious application name containing shell metacharacters, which are then executed with server-level privileges when service lifecycle operations (start, stop, remove, scale) are invoked.

Affected context

This vulnerability appears in Dokploy's backend logic responsible for managing application lifecycle operations (start, stop, remove, scale) on the host.

It affects deployments where:

  • Application names are accepted from authenticated users via the Dokploy interface or API
  • The appName field is only minimally sanitized (e.g., replacing spaces and lowercasing) without strict schema or character validation
  • These appName values are interpolated directly into shell commands executed by helper functions such as execAsync() and execAsyncRemote()

The issue manifests when service operations are triggered, not necessarily at application creation time, making it possible for a malicious app name to be stored and later executed in privileged contexts.

Exploit preconditions

  • Attack surface: Dokploy web UI or API endpoints that accept an appName value and later perform service operations (start, stop, remove, scale).
  • Required access: Valid authenticated access to a Dokploy account with permission to create or manage applications.
  • Trigger point: Execution of lifecycle operations on an application whose appName contains shell metacharacters (e.g., during start/stop/remove/scale actions).
  • Why exploitation is possible:
  • The cleanAppName function performs only superficial transformations (replacing spaces and lowercasing) and does not remove or reject shell metacharacters.
  • There is no schema-based validation enforcing a restricted character set or format for appName.
  • The appName is interpolated directly into shell command strings passed to execAsync() / execAsyncRemote(), allowing shell expansion of metacharacters such as ;, |, &, $() and backticks.

Why this happens

The core defect is direct concatenation of user-controlled data into shell command strings without proper neutralization, aligning with CWE-78: Improper Neutralization of Special Elements used in an OS Command ("OS Command Injection").

Instead of treating appName as opaque data and passing it to the OS via safe, argument-based APIs, the code constructs shell commands by interpolating appName into a command template.

Minimal transformations (such as trimming spaces and converting to lowercase) do not remove or escape characters that have special semantics in the shell, so the shell interprets attacker-provided metacharacters as control operators.

The absence of schema validation for appName (e.g., enforcing alphanumeric and limited safe separators) and reliance on general-purpose shell execution helpers combine to create a high-impact injection sink in service management logic.

Potential impact

  • Arbitrary command execution on the server with the privileges of the Dokploy service account
  • Full compromise of the underlying host or container environment where Dokploy runs
  • Unauthorized access to or modification of application data and configuration files
  • Deployment or installation of backdoors, cryptominers, or additional malicious services
  • Lateral movement to other services, containers, or infrastructure reachable from the Dokploy host
  • Disruption of hosted applications through unauthorized stopping, scaling, or removal operations

General mitigation guidance

Effective mitigation focuses on eliminating the possibility of user-controlled data being interpreted by a shell and tightening input semantics:

  • Avoid shell interpolation for untrusted input: Use APIs that pass command arguments as arrays (e.g., spawn/exec with argument lists) instead of constructing shell strings, so the OS does not perform shell expansion.
  • Enforce strict schemas on identifiers: Treat appName as an identifier with a well-defined character set and length; for example, limit to alphanumeric characters plus a small set of safe delimiters (-, _) and reject anything else.
  • Centralize validation logic: Implement a shared validation layer for all user-provided identifiers, ensuring consistent checks before any persistence or use in operational commands.
  • Apply contextual escaping where necessary: If shell usage cannot be avoided for some operations, apply rigorous, context-aware escaping of arguments, and prefer whitelisting over blacklisting special characters.
  • Minimize privilege of execution context: Run Dokploy service operations under a dedicated, least-privilege account with restricted filesystem and network access to reduce blast radius if command execution is abused.
  • Introduce safe-by-default helpers: Wrap command execution in internal utility functions that enforce argument-only execution and reject unsafe command patterns, so individual features cannot bypass safety checks easily.

How teams detect issues like this

Detection efforts can focus on both code-level patterns and runtime behavior:

  • Static analysis and code scanning:
  • Flag uses of generic shell execution helpers (e.g., exec, execAsync, execAsyncRemote, child_process.exec) where user-controlled variables are concatenated into command strings.
  • Search for string templates or concatenation involving fields like appName that originate from HTTP request bodies, query parameters, or database-stored user input.
  • Enforce linting rules or security policies that disallow shell-based command construction unless explicitly justified and reviewed.
  • Code review practices:
  • Treat any introduction of shell execution as a security-sensitive change requiring dedicated review.
  • Verify that all identifiers used in system-level commands pass through strict validation and that their allowed characters are documented and enforced.
  • Runtime monitoring and logging:
  • Log service operations (start/stop/remove/scale) along with sanitized metadata about the appName and origin account.
  • Monitor for unusual command patterns or arguments at the OS level, and alert on suspicious constructs (e.g., presence of ;, |, &&, $(, backticks) originating from application-managed processes.
  • Security testing and fuzzing:
  • Incorporate automated tests that attempt to pass shell metacharacters in fields like appName and verify that they are rejected and never reach execution sinks.

Sources

SourceLink
github.comgithub.com/Dokploy/dokploy/commit/960892fd8dcf12b7a73a00edaa1b7090fca860c7
github.comgithub.com/Dokploy/dokploy/security/advisories/GHSA-fcgq-jjfg-hrhj

Frequently asked

questions

It is remotely exploitable in the sense that an attacker can trigger it over the network through the Dokploy web UI or API, but they must have valid authenticated access to an account with permissions to create or manage applications.

The attacker needs authenticated access to a Dokploy instance and the ability to create or modify an application's name and then trigger lifecycle operations such as start, stop, remove, or scale for that application.

The safest pattern is to remove all shell-based command construction involving user input and switch to argument-based process execution APIs, combined with strict schema validation of identifiers like appName so that only a limited, safe character set is accepted.

Teams can prevent similar issues by establishing secure coding guidelines around OS command execution, enforcing strict input validation and whitelisting for identifiers, using static analysis and code review to detect shell interpolation, and wrapping system interactions in hardened utility functions that are safe by default.

Find out what's already
exploitable in your codebase.