3 ms·
I wish curl (or a similar tool shipped by default on all distros) had a flag that accepts a hash and verifies that that downloaded file matches that flag before
by ithkuil 8y ago
I wish curl (or a similar tool shipped by default on all distros) had a flag that accepts a hash and verifies that that downloaded file matches that flag before streaming it out
I played around with that idea in https://github.com/mkmik/runck https://github.com/mkmik/runck but it obviously can used for installation instructions only if it's rather ubiquitous.
- swixmix 8y agoIntegrity of the file after transfer isn't the problem.
- kej 8y agoOne possible curl/bash attack is to serve a safe file to browsers but a malicious one to curl. In that case a step where you verify the integrity of the file curl downloads would be useful. (I seem to recall there being a way for the server to reliably guess whether the file was being piped or saved to disc, as well, which would let you restrict the malicious version even more. Google is failing me at the moment, though.)
- badideaprojects 8y agoThis post demonstrates detecting the difference between a user piping the output from curl to bash OR curl to stdout. https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/ https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b...