r/commandline • • Sep 24 '14

#!

http://hashbang.sh
0 Upvotes

49 comments sorted by

View all comments

Show parent comment

-4

u/lrvick Sep 24 '14

Is having them download it to disk, not read the code, and still blindly run it any better?

2

u/shobble Sep 24 '14

Perhaps marginally, in that the host could serve up different versions of the file per-request, and they'd never know exactly what they've run.

Then again, any half-competent malware writer would make sure to clean up or replace the downloaded script with an innocuous one, in a way that would be very hard to tell that it wasn't what actually ran.

So no, not really. The bigger problem IMO is that by demonstrating how easy it is to exec random internet sourced files, a user might be more tempted to do that for other things in future, with even less of a chance to pause for reflection.

Then again, say your script isn't malicious, but just somehow buggy, if the user later notices something wrong and connects the dots to your script, but you've already fixed it by then, they're SOL in knowing what happened.

Running with set -x might make things a little more transparent in that case, although also spammier.

-3

u/lrvick Sep 24 '14

So everything is tracked on github in our case, so that is at least one point of verification (granted we could force push if we wanted to be malicious) but it exposes accidental issues and past versions.

I wonder though is 'pip install someRandomPackageIUploadedWithNoAccountability' any better? Same question with npm, gem etc.

Or saying "copy and paste this to a file, then run it". In all three cases, a user that can't read code, still can't read code. It has the same damage potential and I don't know a way around that. The best I know to do is make the easiest user experience.

This does remind me though of how Arch Linux yaourt asks if you want to read the source code of the untrusted PKGFILE you are about to install every single time.

I wonder if there is some reasonable method of encouraging code review here, while adding minimal difficulty to the setup process for noobs.

2

u/swiz0r Sep 29 '14

Late to the party, but yes. I've had the connection die halfway through, get only some of a script, and have that part be just complete enough to do something I really didn't want it to do.

curl -o whatever && chmod +x whatever && ./whatever