fix: prevent command injection via docker options eval

Values supplied through docker options, `--ttl-seconds`, and `-e` flowed into a Bash `eval` during build, deploy, and run, letting a low-privileged user execute arbitrary commands on the host as the dokku user. These arguments are now tokenized and passed through to the container verbatim, without shell expansion. A one-time migration repairs stored labels whose backticks were saved with a stray backslash so Traefik-style rules stay valid on the next deploy.
This commit is contained in:
Jose Diaz-Gonzalez
2026-07-18 09:22:37 -04:00
parent 730fa85d03
commit 1a376c3622
25 changed files with 444 additions and 29 deletions

View File

@@ -86,14 +86,14 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
if [[ -n "$app_domains" ]]; then
# get length of domains
if [[ "$(echo "$traefik_domains" | wc -w)" -eq 1 ]]; then
traefik_domains="Host(\\\`$traefik_domains\\\`)"
traefik_domains="Host(\`$traefik_domains\`)"
else
for domain in $(echo "$app_domains" | xargs); do
if [[ -z "$traefik_domains" ]]; then
traefik_domains="Host(\\\`$domain\\\`)"
traefik_domains="Host(\`$domain\`)"
continue
fi
traefik_domains="$traefik_domains || Host(\\\`$domain\\\`)"
traefik_domains="$traefik_domains || Host(\`$domain\`)"
done
fi
fi