Bugzilla – Bug 163
session handling vulnerability
Last modified: 2004-12-30 00:05:11 MST
Sudo asks a password for first use and then stores it for a "session". (I think ist about 5 minutes or so.) I found that this session is binded to user but not to any terminal. Meaning that if I login at tty1 and use sudo, "unlocking" it with my password, a malicious user who got a user shell could use sudo without password. (Well at least one more security hole is required for gaining a user shell, but this session handling could elevate the gained privileges to (semi) root privileges.) I use Debian Linux 3.1, and tested only on this particular OS.
Sudo supports per-tty ticket files via the tty_tickets sudoers option; see the sudoers manual for more info. Note, however that unless you explicitly kill the ticket (sudo -k) when you logout, the same user logging in on the the same tty within 5 minutes will not be prompted for a password.