4 ms·
And the UNIX style has a cost: It is insecure e.g. [0][1]. Luckily modern UNIX-based systems are rarely used as multi-user terminals these days or we would see
by Someone1234 11y ago
And the UNIX style has a cost: It is insecure e.g. [0][1].
Luckily modern UNIX-based systems are rarely used as multi-user terminals these days or we would see many more privilege escalations via exploiting bugs in scripts which iterate over user owned files. Even in web scenarios, most web frameworks carefully manage what is allowed in a filename or set the filename themselves.
Ultimately because on UNIX there is no type, you have to make assumptions. These assumptions are sometimes dangerously wrong. You can definitely write scripts and execute commands in a more secure way, but you can go google Linux tutorials right now and find tons of examples where newbies are taught to do it wrong out of the gate.
Data types make this "secure by default." String for everything requires the script-writer or command line-writer to be perfect every time they hit return.
[0] http://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt http://www.defensecode.com/public/DefenseCode_Unix_WildCards...
[1] https://www.helpnetsecurity.com/2014/06/27/exploiting-wildcards-on-linux/ https://www.helpnetsecurity.com/2014/06/27/exploiting-wildca...
- striking 11y agoBash scripts aren't usually intended to be secure. They're quickly written one-offs that do some tiny task and do it well, not usually exposed to an insecure environment or externally controlled input. If you want to write a good program, use a programming language that cares about good programming. Bash et al. don't care about how good the program is, they care about getting something done quick.
- verbatim 11y agoWell, that's what we thought before the ShellShock vulnerability ended up being a major security worry due to all of the places that bash scripts end up being used.
- striking 11y agoBash doesn't come with a guarantee of usability sticker. Actually, it comes with an indemnification of liability sticker. People who are dumb enough to hammer in screws shouldn't be building houses. Whether they do or not isn't exactly my worry. Don't use the wrong tool for the job and you probably won't get burned.