docker icon indicating copy to clipboard operation
docker copied to clipboard

Verify version syntax in update.sh to avoid command injection

Open emanuelb opened this issue 6 years ago • 0 comments

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:

  1. injection attack is possible via inserting malicious command after new-lines. {"version":"5.0.2\nRUN ....\N COPY ..."}
  2. server-error, or malformed JSON data (no version field) will result in: "null" returned or "parse-error" error.

emanuelb avatar May 08 '20 01:05 emanuelb