this post was submitted on 04 Aug 2026
735 points (98.8% liked)

Programmer Humor

32678 readers
208 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Unleaded8163@fedia.io 32 points 3 days ago (2 children)

If you trust the site, curl | sh is no worse than any other install method. If you don't trust the site, it's also no worse.

[–] not_IO@lemmy.blahaj.zone 3 points 3 days ago

that's why you install from repos managed by people you trust, it's like an app store without all the evil

[–] kayzeekayzee@lemmy.blahaj.zone 4 points 3 days ago (3 children)

yeah you can also just curl > cat and check the script yourself

[–] FishFace@piefed.social 11 points 3 days ago (4 children)

Do you mean curl | cat or do you really want to create a file called cat?

Also piping to cat seems redundant but malicious hosts can detect whether the request is getting redirected, using some clever trick, so it's not.

Also, your chance of spotting something bad in a malicious script is probably quite small.

[–] Dumhuvud@programming.dev 2 points 2 days ago (1 children)

Also piping to cat seems redundant but malicious hosts can detect whether the request is getting redirected, using some clever trick, so it’s not.

Just so you know, servers cannot detect piping to any arbitrary process. The trick you're talking about is detecting piping to an interpreter, for the lack of a better term. Piping sleep N to bash is observable behaviour, for example. Piping anything to cat is not.

https://web.archive.org/web/20250622061208/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/

[–] FishFace@piefed.social 1 points 2 days ago

Oh, I had totally forgotten how it worked! I thought it was exactly that. Thanks for the correction

[–] xthexder@l.sw0.com 6 points 3 days ago* (last edited 3 days ago)

Saving it to a file is actually a decent method, since you can be sure the script you're reviewing is the same one you're running.

Personally I often will just manually run the install steps in order if the script is simple enough. Half the time it's just a bunch of OS version checks followed by a tar -xf

[–] cenzorrll@piefed.ca 8 points 3 days ago

This is my opinion on curl | sh/bash type directions. If the maintainers don't provide a hash so I can confirm that is what they intended, there ain't much I can do unless someone slapped in a function named "totallyNotMalware" into the script. I've looked through scripts, seen what they do, but I'm not good enough to recognize anything funky.

[–] Ghoelian@piefed.social 3 points 3 days ago (1 children)

If you just run the file you just created, it doesn't matter that they detected a redirect. I mean it would be a bit silly to download a script, check it, and then re-download it to pipe into bash.

[–] FishFace@piefed.social 1 points 3 days ago

Downloading a two kilobyte script a second time is probably less effort than remembering to rm the script after running it, so if you don't want to keep it, it could be better :)

[–] not_IO@lemmy.blahaj.zone 4 points 3 days ago