mirror of
https://github.com/phpmyadmin/docker.git
synced 2026-08-24 10:13:22 -05:00
Fix #287 - Verify the version syntax in *.sh to avoid command injection
This commit is contained in:
@@ -63,7 +63,7 @@ join() {
|
||||
echo "${out#$sep}"
|
||||
}
|
||||
|
||||
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version')"
|
||||
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version' | grep -E '^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$')"
|
||||
|
||||
for variant in apache fpm fpm-alpine; do
|
||||
commit="$(dirCommit "$variant")"
|
||||
|
||||
@@ -88,7 +88,7 @@ command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Abo
|
||||
# Create variants
|
||||
printf '%s\n' "{}" > versions.json
|
||||
|
||||
latest="$(curl -fsSL "https://www.phpmyadmin.net/home_page/version.json" | jq -r '.version')"
|
||||
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version' | grep -E '^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$')"
|
||||
sha256="$(curl -fsSL "$(download_url "$latest").sha256" | cut -f1 -d ' ' | tr -cd 'a-f0-9' | cut -c 1-64)"
|
||||
|
||||
for variant in "${variants[@]}"; do
|
||||
|
||||
Reference in New Issue
Block a user