Bug 1533964 - sudo skips PAM account module in case NOPASSWD is used in sudoers
Summary: sudo skips PAM account module in case NOPASSWD is used in sudoers
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sudo
Version: 7.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: Patrik Kis
Mirek Jahoda
Depends On: 1547974
TreeView+ depends on / blocked
Reported: 2018-01-12 16:35 UTC by Thorsten Scherf
Modified: 2018-11-06 13:50 UTC (History)
5 users (show)

Fixed In Version: sudo-1.8.23-1.el7
Doc Type: Enhancement
Doc Text:
*sudo* now runs PAM stack even when no authentication is required With this update, the *sudo* utility runs Pluggable Authentication Module (PAM) account management modules even when the "NOPASSWD" option is configured in the policy. This enables checking for restrictions imposed by PAM modules outside of the authentication phase. As a result, PAM modules, such as `pam_time`, now work properly in the described scenario.
Clone Of:
: 1679209 (view as bug list)
Last Closed: 2018-10-30 11:09:01 UTC
Target Upstream Version:

Attachments (Terms of Use)
proposed patch (17.91 KB, patch)
2018-01-17 08:31 UTC, Daniel Kopeček
no flags Details | Diff
upstream fix of a regression related to NOPASSWD PAM stack handling (7.02 KB, patch)
2018-09-24 14:01 UTC, Daniel Kopeček
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3320531 0 None None None 2018-01-15 09:35:10 UTC
Red Hat Knowledge Base (Solution) 3679241 0 None None None 2018-11-06 13:50:21 UTC
Red Hat Product Errata RHEA-2018:3199 0 None None None 2018-10-30 11:09:46 UTC

Description Thorsten Scherf 2018-01-12 16:35:02 UTC
Description of problem:
sudo skips the PAM account phase and therefore also skips the pam_time module which results in failed time based account restriction.  

sudo should use 'pam_acct_mgmt()' in case no authentication is required. The function is fully independent of 'pam_authenticate()'.


Version-Release number of selected component (if applicable):
all versions of sudo are affected.

How reproducible:


account required pam_time.so


sudo still works for the 'foobar' user. Expectation is that sudo is failing.

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 3 Daniel Kopeček 2018-01-17 08:31:54 UTC
Created attachment 1382271 [details]
proposed patch

Comment 12 Daniel Kopeček 2018-09-24 14:01:25 UTC
Created attachment 1486438 [details]
upstream fix of a regression related to NOPASSWD PAM stack handling

Comment 15 errata-xmlrpc 2018-10-30 11:09:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.