sudo login cache is retained even after user logs out

Bug #802997 reported by StephanBeal
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sudo
Unknown
Unknown
sudo (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When running sudo 2x in a short period, the second attempt uses cached credentials. That's all fine and good, but watch this:

[stephan@cheyenne:~/tmp]$ ssh imat-dev
stephan@infomat-dev:~$ sudo su -
root@infomat-dev:~#

Summary:

a) i sudo'd to root. i was asked for a password, as expected.
b) i finished my work and logged out from root, then logged off of the remote system.
c) A few moments later i logged in again to the remote system and did 'sudo su -'.
d) i expected to be asked for my password, but the old credentials from my _previous_ login were reused.

IMO the credentials should be invalidated if the user logs out. The current behaviour is highly questionable. i would rather it not cache at all than to keep the cache valid after i log out.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: sudo 1.7.2p7-1ubuntu2.1
ProcVersionSignature: Ubuntu 2.6.35-28.50-generic 2.6.35.11
Uname: Linux 2.6.35-28-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Tue Jun 28 15:45:13 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: sudo

Revision history for this message
StephanBeal (sgbeal) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. This is not a bug, but rather expected behavior:
https://wiki.ubuntu.com/SecurityTeam/FAQ#Sudo

Please feel free to report any other bugs you may find.

Changed in sudo (Ubuntu):
status: New → Invalid
Revision history for this message
Alex (chewytree) wrote :

sudo is designed to keep a "ticket" valid for 15 minutes after you use your password the first time. This is configurable.

Please read man sudoers:

timestamp_timeout
    Number of minutes that can elapse before sudo will ask
    for a passwd again. The default is 15. Set this to 0
    to always prompt for a password. If set to a value
    less than 0 the user’s timestamp will never expire.
    This can be used to allow users to create or delete
    their own timestamps via sudo -v and sudo -k respec‐
    tively.

Revision history for this message
StephanBeal (sgbeal) wrote :

i understand that the behaviour of having a timeout is expected (i wrote that in my ticket). What's not expected is that even though i log out, the cache remains valid.

Revision history for this message
Micah Gersten (micahg) wrote :

This was actually fixed in natty as 1.7.3 enabled clearing the catch on logout for pseudo ttys with per tty tickets enabled and 1.7.4 enabled per tty tickets by default.

Changed in sudo (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
StephanBeal (sgbeal) wrote :

Fair enough.

Bad for me, though - i back-rev'd from natty to maverick because natty completely destroyed my productivity (but that's another story for another forum).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.