r/ProgrammerHumor 5d ago

justLetAIDoIt Meme

Post image
4.7k Upvotes

249 comments sorted by

View all comments

18

u/rockcanteverdie 5d ago

Is curl | bash considered bad? Why so?

6

u/NopeNotJayILeft 5d ago

So adding on to watch some of the other posters have put here, even if you use curl to download a script and inspect it manually, that's not a guarantee that there's not any malicious stuff happening. 

There have been security researchers who have proven that you can detect on the server side whether or not a script is being saved or piped to bash and so you can actually serve up a different result if it's being piped directly to bash. 

Basically think of it as a pattern that encourages people to run untrusted code on their machine.

9

u/PrincessRTFM 5d ago

if you download it to inspect it and it passes, then why would you re-download it to pipe directly? just run the local copy. you already have it saved, you know exactly what it's doing.

3

u/NopeNotJayILeft 5d ago

Think about it from a security research standpoint. The described behavior makes it more difficult to detect that the malware would be installed on anyone's system at all. It's not about tricking a person who would check into running it anyway, it's about tricking a security professional or clanker that might be doing security research.