4 ms·
> this is really dangerous People repeat this a lot but really it just seems dangerous. Can you give an example of a scenario where offering a download via `cu
by IshKebab 5y ago
> this is really dangerous
People repeat this a lot but really it just seems dangerous. Can you give an example of a scenario where offering a download via `curl | bash` is more dangerous than "download this installer with the hash 01234 and then execute it"?
- ben0x539 5y agoThe site could detect that it's invoked as part of a `curl | bash` and sometimes serve a different script than you would get if you manually downloaded the script or the installer for manual inspection/auditing, making it harder to detect shenanigans. I think someone wrote this up as a PoC/blog post at some point.
- IshKebab 5y agoA binary that you download could be obfuscated to make it hard to audit. A site could offer different binaries to different people, locations, times of day, user agents, etc. That's not really a realistic risk.
- ben0x539 5y agoIt's not so much script vs binary, but once everybody downloads a file they can compare them to make sure they're getting the same file.
- IshKebab 5y agoYou can download the script using curl and then inspect it and run it if you really want?
- ben0x539 5y agoAnd then we get to what I was trying to state in my original post. I don't have a strong opinion that it's good or bad practice, I just thought it was a clever thing to do about it. Edit: I think I was thinking of https://news.ycombinator.com/item?id=17636032 https://news.ycombinator.com/item?id=17636032 / https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/ https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b.... Wow, it's been a while.
- chlorion 5y agoYou could mistype the url by a letter or two and hit enter before realizing the mistake. Creating malicious domains that are very close to popular ones is somewhat of a common thing for exactly this reason. If you downloaded and peeked into the script before running it, this would be a lot less likely to happen. There is really no downsides to downloading it, checking it out and then running it other than it not being able to be blindly copy pasted into a terminal.
- IshKebab 5y ago> You could mistype the url by a letter or two and hit enter before realizing the mistake. People copy and paste these commands. They don't type them out. There's a big "copy to clipboard" button next to the rustup one.