56 ms·
> Then we just have to tackle resisting the urge to copy&paste `workstation$ curl -sSL https://randomwebsite.weonlyjustlearnedof/something-shiny https://randomw
by rgoulter 4y ago
> Then we just have to tackle resisting the urge to copy&paste `workstation$ curl -sSL https://randomwebsite.weonlyjustlearnedof/something-shiny https://randomwebsite.weonlyjustlearnedof/something-shiny | sh`.
The argument that goes around about "don't pipe curl into sh" is: "the website can detect that it's being piped into `sh`, and then run malicious commands which you won't know about".
I've never seen a compelling reply that explained why `curl ... > tmp.sh && sh tmp.sh` is practically any safer. -- "don't curl into sh" is significantly more specific than "don't run random scripts" or "always use a package manager".
Rather, even if I see that the script is running `wget https://example.com/program.bin https://example.com/program.bin`, it seems more practical that `program.bin` could itself run malicious commands at a later date.
- neilv 4y agoThe main problem is all the casual arbitrary code execution from unvetted sources -- both doing it, and encouraging it.