8 ms·
WARNING: this page has a dangerous typo. do not put '.' in your path. "This is similar to the confusion I felt when I realised the dot folder was not included
by gumby 8y ago
WARNING: this page has a dangerous typo. do not put '.' in your path.
"This is similar to the confusion I felt when I realised the dot folder was not included in my more familiar PATH variable… but you should [not] do that in the PATH variable because you can get tricked into running a ‘fake’ command from some downloaded code."
- fiddlerwoaroof 8y agoToday, the threat model for a personal computer makes this a lot less important: to exploit this someone needs to be able to create a file on your computer and set its mode to +x: but if someone has that kind of access to one’s personal computer, it’s already game over.
- tsbinz 8y agoyou mean like you checking out some repository from github or you unzipping a file that you downloaded or ...?
- fiddlerwoaroof 8y agoMount those directories noexec
- marcosdumay 8y agoMost people want to execute things on their homedir.
- fiddlerwoaroof 8y agoI usually mount a separate file system on ~/Downloads
- DonHopkins 8y agoYou really are missing the point. https://web.mit.edu/~simsong/www/ugh.pdf https://web.mit.edu/~simsong/www/ugh.pdf Unix-Haters Handbook Preface Things Are Going to Get Lot Worse Before Things Get Worse “I liken starting one’s computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act.” -Ken Pier, Xerox PARC
- dredmorbius 8y agoWhitelisting is safer than blacklisting. Mount /home noexec, mount ~/bin exec. If you're going to go this route. I don't go this far yet, but do strongly recommend nodev and nosuid except where absolutely needed. This is also a strong argument for multiple partitions rather than single-partition formatting.
- fiddlerwoaroof 8y agoThis is really interesting. I mount ~/Downloads anyways, because I put it on a nfs mount, but I’ve never considered some scheme like what you’re talking about. Maybe I’ll go for this on my next Linux machine. Also, there’s a better argument for not putting . in $PATH: if your $PATH is relatively static, you have less to think about when looking through your shell’s history for a particular command: if . is on the PATH, you always have to wonder whether a particular history entry is running a system-wide command or a command in $PWD
- deleted 8y ago[deleted]
- DonHopkins 8y agoOH NOOOO!!! Now you've gone and done it! You're in violation of Wikipedia:Don't stuff beans up your nose: https://en.wikipedia.org/wiki/Wikipedia:Don%27t_stuff_beans_up_your_nose https://en.wikipedia.org/wiki/Wikipedia:Don%27t_stuff_beans_... It's too late, the damage is irreparable. By now, hundreds of people have probably already put . in their path, mounted their repos and /home noexec nodev and nosuid, and mounted a separate file system on ~/Downloads, just to spite you. ;) Or were you trying to trick them into doing that all along, so you could hack into their systems? I can never tell with you slippery cyber security types...