I have an upcoming test and looking at past years they always ask a similar question. Basically the security hole that would be created by setting something like:
PATH=".:/bin:/usr/bin"
I get that PATH determines the absolute directories to be searched for the executable when the user calls a command such as "ls". I'm just not sure what behavior the above would cause.
It seems that it would first check the current directory (based on the '.') for a "/bin" directory and then move on to the absolute directory "/usr/bin" if there isn't one. The issue being that if a user called "ls" and an attacker had created a "/bin" in the current directory, it could contain a version of ls that for instance deletes a bunch of files.
Is this on the right track or am I misunderstanding the PATH notation?