/

CVE-2026-45406

Severity:

CRITICAL RISK

(9.0)

Shell Eval Injection (CWE-95) via Dokku vhosts plugin

CVE-2026-45406

Analyzed

Vulnerability type

Category:

Shell Command Injection

CWE:

CWE-95

Impact:

Arbitrary Command Execution on Host

Severity:

CRITICAL RISK

(9.0)

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 shell command injection vulnerability in Dokku's openresty-vhosts plugin allows crafted filenames from an app's git repository to be interpolated into an eval'd shell string without proper escaping.

If an attacker can create or control files under openresty/http-includes/ with filenames containing special characters, they can execute arbitrary commands on the host as the dokku user during the next application deployment.

Affected context

This vulnerability occurs in Dokku deployments that use the openresty-vhosts plugin and rely on files under an app's openresty/http-includes/ directory being copied and processed on the host during deployment.

The risk is present when filenames from that directory are interpolated directly into shell strings that are later executed, especially in environments where application maintainers or integrated processes can introduce untrusted or dynamically generated filenames.

Exploit preconditions

  • Attack surface: Dokku deployment pipeline using the openresty-vhosts plugin
  • Required access: Ability to create, rename, or modify files in the app's openresty/http-includes/ directory via the associated git repository or build process
  • Trigger point: Application deployment, when the plugin copies files to the host and constructs shell strings containing their filenames
  • Why exploitation is possible: Filenames are injected unescaped into a single-quoted shell string that is later parsed by eval, allowing special characters (e.g., single quotes and command substitution syntax) to break quoting and introduce attacker-controlled shell commands

Why this happens

The underlying issue maps to CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ("eval injection").

The plugin builds a shell command by interpolating raw filenames into a single-quoted string and then passes that string to eval, effectively treating data as code.

Because user-controllable filenames are not sanitized or safely quoted, shell metacharacters embedded in the filename are interpreted by the shell, turning what should be passive data into executable directives.

Potential impact

  • Arbitrary command execution on the Dokku host as the dokku user
  • Modification or deletion of application code, configuration, or data managed by Dokku
  • Unauthorized access to other applications running under the same Dokku instance
  • Establishment of persistence mechanisms or backdoors on the host
  • Potential lateral movement to other services, depending on the dokku user's privileges and network access

General mitigation guidance

Effective mitigation focuses on eliminating direct eval of dynamically constructed shell strings and separating data from executable code.

Common defensive patterns include:

  • Avoiding eval entirely in deployment scripts and plugins, favoring explicit, parameterized commands
  • Treating filenames and other user-influenced values as opaque data and passing them as separate, properly quoted arguments to shell commands
  • Applying strict validation and normalization to filenames used in automation, rejecting or sanitizing characters that have special meaning to the shell
  • Running deployment tooling with least-privilege accounts and minimizing what those accounts can access or modify on the host
  • Designing plugins so that text processing and command construction are done with libraries or languages that reduce exposure to shell metacharacter parsing

How teams detect issues like this

High-level detection strategies for this vulnerability class typically involve a mix of static, review-based, and policy-driven controls:

  • Static analysis rules that flag uses of eval, backticks, or complex shell expansions in deployment scripts and plugins, especially when combined with user-controllable input
  • Code review practices that require reviewers to trace how filenames and other app-controlled values flow into shell commands, looking for missing quoting or sanitization
  • Organizational policies that discourage or forbid eval-based logic in infrastructure automation, with automated checks to enforce these standards
  • Periodic security audits of deployment pipelines and PaaS plugins to identify patterns where application data is used to construct shell code

Sources

SourceLink
github.comgithub.com/dokku/dokku/pull/8588
github.comgithub.com/dokku/dokku/security/advisories/GHSA-ggqh-98fj-8mg9

Frequently asked

questions

It can be, if an attacker can push changes to the affected application's git repository or otherwise influence files under openresty/http-includes/ that are processed during deployment. In such cases, exploitation can occur via the normal remote deployment workflow.

The attacker must be able to create or control filenames in the app's openresty/http-includes/ directory, typically through repository access, CI/CD integration, or another mechanism that populates that path before deployment.

The safest pattern is to remove eval usage and treat filenames purely as data: construct shell commands with properly quoted arguments, or better yet, use higher-level APIs that avoid direct shell interpretation of user-influenced values.

Avoid building shell strings from user-controllable input, prefer parameterized command execution, enforce strict input validation for filenames and paths, and adopt security-focused code review and automated checks that flag eval and unsafe shell constructs in deployment-related code.

Find out what's already
exploitable in your codebase.