Bug 1411944

Summary: Release 1.3.5 may allow expired accounts access to systems
Product: Red Hat Enterprise Linux 7 Reporter: Gordon Messmer <gordon.messmer>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.3CC: mreynolds, msauton, nkinder, rmeggins, sramling
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.6.1-3.el7 Doc Type: No Doc Update
Doc Text:
See the 7.3.z bug 1414679.
Story Points: ---
Clone Of:
: 1414679 (view as bug list) Environment:
Last Closed: 2017-08-01 21:14:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1414679    

Description Gordon Messmer 2017-01-10 19:45:02 UTC
Description of problem:
Release 1.3.5 of 389-ds changed handling of the shadowExpire attribute and other shadow-related attributes.  Calculation of shadowExpire will replace the value in the LDAP database with a value that represents the current date plus the maximum age of a password.  Because this date will always be in the future, accounts which were expired and not allowed to log in under previous releases of 389-ds will be allowed to log in under 1.3.5.

Version-Release number of selected component (if applicable):
389-ds-base-1.3.5.10-12.el7_3.x86_64

How reproducible:
Always

Steps to Reproduce:
1. set shadowExpire value to past date for an account
2. attempt to log in to that account

Actual results:
User can log in.

Expected results:
User should be denied login because the account is expired.

Additional info:
https://fedorahosted.org/389/ticket/49080

Comment 4 Sankar Ramalingam 2017-05-16 02:36:01 UTC
Ran upstream test ticket548_test.py.

INFO:dirsrvtests.tests.tickets.ticket548_test:		Add the password policy subentry {passwordMustChange: on, passwordMinAge: 4, passwordMaxAge: 40, passwordWarning: 12}
INFO:dirsrvtests.tests.tickets.ticket548_test:		Add the COS template
ERROR:dirsrvtests.tests.tickets.ticket548_test:Failed to add COS template: error Already exists
INFO:dirsrvtests.tests.tickets.ticket548_test:		Add the COS definition
ERROR:dirsrvtests.tests.tickets.ticket548_test:Failed to add COS def: error Already exists
INFO:dirsrvtests.tests.tickets.ticket548_test:		Bind as {uid=user3,dc=example,dc=com,password}
INFO:dirsrvtests.tests.tickets.ticket548_test:Re-bind as uid=user3,dc=example,dc=com with new password
INFO:dirsrvtests.tests.tickets.ticket548_test:Expecting shadowLastChange 17302 once userPassword is updated
INFO:dirsrvtests.tests.tickets.ticket548_test:shadowLastChange of entry uid=user3,dc=example,dc=com has expected value 17302
INFO:dirsrvtests.tests.tickets.ticket548_test:Search entry uid=user3,dc=example,dc=com
INFO:dirsrvtests.tests.tickets.ticket548_test:shadowLastChange of entry uid=user3,dc=example,dc=com has expected value 17302
INFO:dirsrvtests.tests.tickets.ticket548_test:shadowMin of entry uid=user3,dc=example,dc=com has expected value 4
INFO:dirsrvtests.tests.tickets.ticket548_test:shadowMax of entry uid=user3,dc=example,dc=com has expected value 40
INFO:dirsrvtests.tests.tickets.ticket548_test:shadowWarning of entry uid=user3,dc=example,dc=com has expected value 12
INFO:dirsrvtests.tests.tickets.ticket548_test:Check shadowAccount with subtree level policy was successfully verified.
PASSEDInstance slapd-standalone_1 removed.


=================== 3 passed in 8.32 seconds ==================

Comment 5 Sankar Ramalingam 2017-05-16 03:12:35 UTC
Manually checked if setting shadowExpire attributes affect the password expired accounts. It doesn't have any effect. Hence, marking the bug as Verified.

[0 root@qeos-43 389ds-replica]# cat /export/pwdexp.ldif 
dn: cn=config
replace: passwordexp
passwordexp: on
-
replace: passwordmaxage
passwordmaxage: 12
-
replace: passwordwarning
passwordwarning: 1

[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 -vf /export/pwdexp.ldif 

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" |grep -i shadow
objectClass: shadowAccount
shadowLastChange: 17302
objectClass: shadowAccount
shadowLastChange: 17302

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu2,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!

[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 <<
-bash: syntax error near unexpected token `newline'
[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 << EE
> dn: uid=tttu3,ou=People,dc=testpw,dc=com
> replace: shadowExpire
> shadowExpire: 17390
> EE
modifying entry "uid=tttu3,ou=People,dc=testpw,dc=com"

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu3,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!
[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 << EEdn: uid=tttu3,ou=People,dc=testpw,dc=com
replace: shadowExpire
shadowExpire: 17090
EE

modifying entry "uid=tttu3,ou=People,dc=testpw,dc=com"

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu3,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu3,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!
[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 << EEdn: uid=tttu3,ou=People,dc=testpw,dc=com
replace: shadowLastChange
shadowLastChange: 17090
EE

modifying entry "uid=tttu3,ou=People,dc=testpw,dc=com"

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu3,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!
[0 root@qeos-43 389ds-replica]# ldapmodify -x -D "cn=Directory Manager" -w Secret123 -h localhost -p 1389 << EEdn: uid=tttu3,ou=People,dc=testpw,dc=com
replace: shadowLastChange
shadowLastChange: 17990
EE

modifying entry "uid=tttu3,ou=People,dc=testpw,dc=com"

[0 root@qeos-43 389ds-replica]# ldapsearch -x -D "uid=tttu3,ou=People,dc=testpw,dc=com" -w Secret123 -h localhost -p 1389 -b "dc=testpw,dc=com" 
ldap_bind: Invalid credentials (49)
	additional info: password expired!


[0 root@qeos-43 389ds-replica]# rpm -qa |grep -i 389-ds
389-ds-base-debuginfo-1.3.6.1-13.el7.x86_64
389-ds-base-libs-1.3.6.1-13.el7.x86_64
389-ds-base-1.3.6.1-13.el7.x86_64

Comment 6 Gordon Messmer 2017-05-16 23:34:28 UTC
This bug cannot be verified in that manner.  The shadowExpire does not affect, and should not affect, LDAP bind operations.  That attribute is used by the PAM stack to lock out accounts that have expired.

Comment 7 errata-xmlrpc 2017-08-01 21:14:10 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.

https://access.redhat.com/errata/RHBA-2017:2086