docker
docker copied to clipboard
Verify version syntax in update.sh to avoid command injection
https://github.com/phpmyadmin/docker/blob/c5174eeef99fb121a7b91e6a7f1de009183e4b74/update.sh#L24
The latest variable will contain the data from version field in JSON from: https://www.phpmyadmin.net/home_page/version.json
Add verification to ensure it's in correct format for version string, otherwise:
- injection attack is possible via inserting malicious command after new-lines.
{"version":"5.0.2\nRUN ....\N COPY ..."} - server-error, or malformed JSON data (no version field) will result in: "null" returned or "parse-error" error.