Live data from Hacker News

"So that a truncated partial download doesn't end up executing half a script"

tailscale.com

1–10 of 87 posts

Re: "So that a truncated partial download doesn't end up executing half a script"

#5

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

As opposed to downloading a binary install file?

Re: "So that a truncated partial download doesn't end up executing half a script"

#6

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

Everyone says this, but nearly nobody does it.

Just like security through open source, it's more a nice myth than a reality.

Re: "So that a truncated partial download doesn't end up executing half a script"

#7

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

It is an awful habit of some open source projects to have the official way to install their software be to execute a shell script from the Internet. Nobody reads it, as they are usually quite complex and given the xz situation a well crafted shell script can seem harmless while being very dangerous.

Re: "So that a truncated partial download doesn't end up executing half a script"

#8

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

As opposed to downloading a binary install file?

Distributors usually give you a way to verify that what you've downloaded is correct, usually through checksums, PGP signatures, code signing... You forego that if you pipe the script to your shell. What if you make a typo and somehow pipe an HTML document to your shell? If you're unlucky this could wreak havoc.

Re: "So that a truncated partial download doesn't end up executing half a script"

#9

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

As opposed to downloading a binary install file?

Having a distribution maintainer provide official packages is the best way.

Re: "So that a truncated partial download doesn't end up executing half a script"

#10

Don't pipe curl/wget a script to a shell without reading what you've downloaded. This should be common sense. Do `wget $url; most install.sh` and only if you're satisfied with what you read , execute `sh install.sh`.

It is an awful habit of some open source projects to have the official way to install their software be to execute a shell script from the Internet. Nobody reads it, as they are usually quite complex and given the xz situation a well crafted shell script can seem harmless while being very dangerous.

Didn't the xz situation kinda prove that even reading the script is probably not gonna do you a lot of good if you're up against someone smart?
Post reply on HN