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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user