sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.2k stars 224 forks source link

plugins/pam: Check the user didn't change during PAM transaction #412

Closed 3v1n0 closed 1 month ago

3v1n0 commented 2 months ago

PAM modules can change the user during their execution, in such case, sudo would still use the user that has been provided giving potentially access to another user with the credentials of another one.

So prevent this to happen, by ensuring that the final PAM user is matching the one which started the transaction.

Similar to https://github.com/util-linux/util-linux/pull/3206