News for hackers. Stuff that matters.
Re:Curl to shell isn’t so bad (2019) by aequitas on Tuesday January 28, 2020 @10:02AM (#22169974)
As the author notes:

> You’re not running some random shell script from a random author, you’re running it from a software vendor who you already trust to run software.

Re:Curl to shell isn’t so bad (2019) by falcolas on Tuesday January 28, 2020 @10:23AM (#22170181)
Without any form of validation that the shell script I'm running is actually from the software vendor in question. That trust is even further stretched when the request is 301 redirected to another host entirely.

Between custom domain names, TLDs, Let's Encrypt (I love Let's Encrypt, but it provides is encryption, not trust) and cheeky developers using combinations of those, how can I really know that a script coming from (fictional example) https://install.dock.er is actually the Docker company?

Re:Curl to shell isn’t so bad (2019) by aequitas on Tuesday January 28, 2020 @10:42AM (#22170366)
The same arguments apply for downloading a binary.

If you want to pull this even further. When is the last time you verified the signing keys of your OS distribution repo without relying on the internet?

A lot of install methods that are not curl/sh are like: here copy this bash line to add apt GPG keys for our repo, apt update and install. A lot of people don't bother to check those keys.

Re:Curl to shell isn’t so bad (2019) by falcolas on Tuesday January 28, 2020 @10:51AM (#22170450)
True, some people don't check those keys, but it's possible to do. There's a well trodden (and cryptographically secure) path for gaining trust in a key that's distinct from downloading and unpackaging a file.

This is (currently) not possible to do with scripts downloaded from a web page. Especially when immediately piped into a shell.

Re:Curl to shell isn’t so bad (2019) by aequitas on Tuesday January 28, 2020 @11:12AM (#22170688)
As with most issues in security its a balance between usability and security. The real problem is the majority of the users will always try to find the path of least resistance. No matter how well documented a secure procedure is, if a user can find a oneliner they will use it instead.

I've seen this in other places as well. Vendor makes a comprehensive guide. Some people condense that to a minimum and will even boast they "made" an easier way to do X or Z, whilst ommiting all the caveats. Of course that will become the popular 'standard' people find. And they'll go complain to the vendor if it doesn't work without even reading the original instructions.

Re:Curl to shell isn’t so bad (2019) by falcolas on Tuesday January 28, 2020 @11:28AM (#22170874)
You're not wrong with your first paragraph. That doesn't make the use of curl|sh good however. It doesn't justify developers laziness in eschewing secure methods of distribution, or writing articles like this that justify that same laziness.
Re:Curl to shell isn’t so bad (2019) by eeZah7Ux on Tuesday January 28, 2020 @10:24AM (#22170186)
Wrong. You are trusting much more than that, including network components outside of your control and the author's.

Plus you are pushing forward the bad pattern and being part of the problem.

You are encouraging other authors and users to do the same.

Re:Curl to shell isn’t so bad (2019) by aequitas on Tuesday January 28, 2020 @10:37AM (#22170324)
Tell me how this is different for downloading a binary instead. Unless you get something like a GPG through a completely different channel.
Re:Curl to shell isn’t so bad (2019) by eeZah7Ux on Tuesday January 28, 2020 @05:59PM (#22175101)
First, distribution do exactly that. The GPG chain of trust is preinstalled.

Second, there are at least 3-4 more attacks possible during curl-bash. You can simply read the links on HN.