Bug 1371678 - Disabling CLEAR password storage scheme will crash server when setting a password
Summary: Disabling CLEAR password storage scheme will crash server when setting a pass...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.9
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: mreynolds
QA Contact: Viktor Ashirov
Marc Muehlfeld
URL:
Whiteboard:
Depends On: 1371284
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-30 18:57 UTC by mreynolds
Modified: 2020-09-13 21:50 UTC (History)
8 users (show)

Fixed In Version: 389-ds-base-1.2.11.15-83.el6
Doc Type: Bug Fix
Doc Text:
Directory Server no longer fails when disabling the *CLEAR* password storage scheme plug-in Previously, Directory Server required that the *CLEAR* password storage plug-in was enabled when setting "userPassword" attributes. As a consequence, Directory Server terminated unexpectedly when attempting to set "userPassword" attributes, if *CLEAR* was disabled. This update applies a patch and as a result, Directory Server no longer fails in the described situation.
Clone Of: 1371284
Environment:
Last Closed: 2017-03-21 10:22:49 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 2034 0 None None None 2020-09-13 21:50:38 UTC
Red Hat Product Errata RHBA-2017:0667 0 normal SHIPPED_LIVE 389-ds-base bug fix update 2017-03-21 12:35:05 UTC

Description mreynolds 2016-08-30 18:57:29 UTC
+++ This bug was initially created as a clone of Bug #1371284 +++

This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/48975

The server always expects the the CLEAR password storage scheme to always be enabled.  If it is disabled then a NULL pointer gets dereferenced and the server crashes:

Program terminated with signal 11, Segmentation fault.
#0  valuearray_init_bervalarray_unhashed_only (pb=0x13ea250, pw_change=1, old_pw=0x0) at ldap/servers/slapd/modify.c:1460
1460                            if(strcmp(pwsp->pws_name, "CLEAR") == 0){

#0  valuearray_init_bervalarray_unhashed_only (pb=0x13ea250, pw_change=1, old_pw=0x0) at ldap/servers/slapd/modify.c:1460
#1  op_shared_modify (pb=0x13ea250, pw_change=1, old_pw=0x0) at ldap/servers/slapd/modify.c:968
#2  0x0000003c9208867e in do_modify (pb=0x13ea250) at ldap/servers/slapd/modify.c:408
#3  0x00000000004146d4 in connection_dispatch_operation () at ldap/servers/slapd/connection.c:594
#4  connection_threadmain () at ldap/servers/slapd/connection.c:2360
#5  0x00000036e4c29c13 in _pt_root (arg=0x1419ee0) at ../../../nspr/pr/src/pthreads/ptthread.c:212
#6  0x00000036e2c07aa1 in start_thread (arg=0x7f084e1fc700) at pthread_create.c:301
#7  0x00000036e28e8aad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

--- Additional comment from  on 2016-08-30 14:50:48 EDT ---

Fixed upstream

Comment 4 Amita Sharma 2016-11-23 06:57:21 UTC
[root@spider yum.repos.d]# rpm -qa | grep 389
389-ds-base-libs-1.2.11.15-85.el6.x86_64
389-ds-base-1.2.11.15-85.el6.x86_64

Disable password storage scheme CLEAR
[root@spider yum.repos.d]# /usr/bin/ldapmodify -x -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config
> replace: nsslapd-pluginEnabled
> nsslapd-pluginEnabled: off
> EOF
modifying entry "cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config"

[root@spider yum.repos.d]# /usr/bin/ldapsearch -x -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 -b "cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config" |grep -i nsslapd-pluginEnabled
nsslapd-pluginEnabled: off



Add users with password with clear text.
[root@spider yum.repos.d]# ldapadd -x -h localhost -p 389 -D "cn=Directory Manager" -w Secret123  << EOF
> dn: uid=amita,dc=example,dc=com
> cn: amita
> sn: amita
> givenname: amita
> objectclass: top
> objectclass: person
> objectclass: organizationalPerson
> objectclass: inetOrgPerson
> uid: amita
> mail: amita
> userpassword: Secret123
> EOF
adding new entry "uid=amita,dc=example,dc=com"

[root@spider yum.repos.d]# /usr/bin/ldapmodify -x -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: uid=amita,dc=example,dc=com
> replace: userpassword
> userPassword: 123456www
> EOF
modifying entry "uid=amita,dc=example,dc=com"

[root@spider yum.repos.d]# ps -ef |grep -i slapd-spider
nobody    8712     1  0 01:31 ?        00:00:00 ./ns-slapd -D /etc/dirsrv/slapd-spider -i /var/run/dirsrv/slapd-spider.pid -w /var/run/dirsrv/slapd-spider.startpid
root      8800  8438  0 01:52 pts/0    00:00:00 grep -i slapd-spider


Set nsslapd-pluginEnabled: on and repeat all the steps

[root@spider yum.repos.d]# /usr/bin/ldapmodify -x -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
> dn: cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config
> replace: nsslapd-pluginEnabled
> nsslapd-pluginEnabled: on
> EOF
modifying entry "cn=CLEAR,cn=Password Storage Schemes,cn=plugins,cn=config"


ldapadd -x -h localhost -p 389 -D "cn=Directory Manager" -w Secret123  << EOF
> dn: uid=amita1,dc=example,dc=com
> cn: amita1
> sn: amita1
> givenname: amita1
> objectclass: top
> objectclass: person
> objectclass: organizationalPerson
> objectclass: inetOrgPerson
> uid: amita1
> mail: amita1
> userpassword: Secret123
> EOF
adding new entry "uid=amita1,dc=example,dc=com"

[root@spider yum.repos.d]# /usr/bin/ldapmodify -x -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
dn: uid=amita1,dc=example,dc=com
replace: userpassword
userPassword: 123456www
EOF

[root@spider yum.repos.d]# ps -ef |grep -i slapd-spider
nobody    8712     1  0 01:31 ?        00:00:00 ./ns-slapd -D /etc/dirsrv/slapd-spider -i /var/run/dirsrv/slapd-spider.pid -w /var/run/dirsrv/slapd-spider.startpid
root      8829  8438  0 01:56 pts/0    00:00:00 grep -i slapd-spider

Hence marking as VERIFIED.

Comment 9 errata-xmlrpc 2017-03-21 10:22:49 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://rhn.redhat.com/errata/RHBA-2017-0667.html


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