/

CVE-2026-45408

Severity:

CRITICAL RISK

(9.0)

Shell Injection (CWE-78) via Dokku Git Hook App Names

CVE-2026-45408

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Authenticated Remote Command Execution

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

Dokku's app name validation previously allowed shell metacharacters that were later embedded unquoted into a Bash pre-receive hook.

An authenticated user who can push to a Dokku git remote can craft an app name that injects additional commands, resulting in arbitrary command execution as the dokku user during git push.

Affected context

This vulnerability occurs in Dokku deployments that accept application creation and git pushes from authenticated users.

It manifests when app names containing shell metacharacters are accepted by validation logic and then interpolated directly into Bash hook scripts via an unquoted heredoc.

The risk is present in environments where the dokku user has meaningful access to system resources or controls production applications.

Exploit preconditions

  • Attack surface: Git remote interface exposed by Dokku
  • Required access: Authenticated access capable of creating apps and pushing to the Dokku git remote
  • Trigger point: Execution of the Bash pre-receive hook during git push for a crafted app name
  • Why exploitation is possible: The app name is embedded unquoted into a shell script via an unquoted heredoc; shell metacharacters in the name are interpreted as command separators and executed

Why this happens

The root cause is improper neutralization of special elements in shell commands (CWE-78).

Application names supplied by users are only lightly validated by a regex that still permits shell metacharacters and are then written directly into a Bash script without quoting or escaping.

When the pre-receive hook runs, Bash parses these untrusted values as part of its command stream, allowing attackers to inject additional commands.

Abstractly, this reflects a pattern where user-controlled identifiers are treated as safe and embedded into shell constructs without strict sanitization or isolation.

Potential impact

  • Authenticated users may execute arbitrary commands as the dokku user
  • Attackers could manipulate deployed applications or their configuration
  • Sensitive data accessible to the dokku user could be read or modified
  • Hosts running Dokku could be further compromised through privilege escalation or lateral movement

General mitigation guidance

Mitigation focuses on separating untrusted data from shell interpretation boundaries and tightening validation of identifiers.

Recommended patterns include:

  • Applying strict allowlist-based validation for app names, limiting characters to a safe subset that cannot alter shell syntax
  • Ensuring all user-supplied values embedded into shell scripts are properly quoted or escaped, or avoiding direct shell composition entirely
  • Refactoring operational tooling to use safer APIs (e.g., direct exec calls or configuration files) instead of dynamically generated shell scripts
  • Running Dokku and related automation under least-privilege accounts to reduce impact if command execution occurs

How teams detect issues like this

Detection commonly involves:

  • Static analysis and linting rules that flag unquoted use of variables or heredocs in shell scripts and templates
  • Code review practices that scrutinize any interpolation of user-controlled values into command lines or hooks
  • Policy-based checks in CI pipelines to enforce safe patterns for regex validation and shell interaction
  • Runtime monitoring of Dokku environments for unusual commands executed by the dokku user or anomalous activity after git pushes

Sources

SourceLink
github.comgithub.com/dokku/dokku/pull/8590
github.comgithub.com/dokku/dokku/security/advisories/GHSA-9x85-7gxq-fcr3

Frequently asked

questions

Yes, but it requires authenticated access to a Dokku git remote. An attacker who can push code to Dokku can exploit the issue over the network.

The attacker must be an authenticated Dokku user with the ability to create or use an app and perform git push to its remote. No direct shell access is required.

The safest approach is to combine strict allowlist validation on app names with robust quoting or escaping when any user-supplied value is placed into shell scripts. Where possible, avoid constructing shell commands from untrusted data entirely.

Adopt defensive patterns around automation scripts: treat all user-controlled identifiers as untrusted, enforce character allowlists, use non-shell APIs for orchestration when feasible, and integrate automated checks that flag unsafe shell interpolation in hooks and deployment tooling.

Find out what's already
exploitable in your codebase.