Bug 1034451 - Possible to specify invalid SASL mechanism in nsslapd-allowed-sasl-mechanisms
Summary: Possible to specify invalid SASL mechanism in nsslapd-allowed-sasl-mechanisms
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Sankar Ramalingam
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-25 21:07 UTC by Ján Rusnačko
Modified: 2020-09-13 20:51 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-1.3.1.6-12.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:41:29 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 951 0 None None None 2020-09-13 20:51:34 UTC

Description Ján Rusnačko 2013-11-25 21:07:01 UTC
Description of problem:
Currently it is possible to add invalid SASL mechanism to nsslapd-allowed-sasl-mechanisms. 

Version-Release number of selected component (if applicable):
389-ds-base-1.3.1.6-8.el7.x86_64

How reproducible:
always

Steps to Reproduce:

[jrusnack@localhost slapd-dstet]$ ldapmodify -h $HOST -p $PORT -D "cn=directory
manager" -w Secret123 <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-allowed-sasl-mechanisms
nsslapd-allowed-sasl-mechanisms: GSSAPI šáľýčž
EOF

modifying entry "cn=config"

[jrusnack@localhost slapd-dstet]$ ldapsearch -h $HOST -p $PORT -D "cn=directory
manager" -w Secret123 -b "cn=config" -s base -LLL nsslapd-allowed-sasl-mechanisms
dn: cn=config
nsslapd-allowed-sasl-mechanisms:: xaHDocS+w73EjcW+

As per RFC 4422:
SASL mechanisms are named by character strings, from 1 to 20
characters in length, consisting of ASCII [ASCII] uppercase letters,
digits, hyphens, and/or underscores.

http://tools.ietf.org/html/rfc4422#page-8

Additional info:
Note that in this scenario GSSAPI actually works as allowed mechanism.

Comment 2 Nathan Kinder 2013-12-02 15:45:20 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/47614

Comment 3 mreynolds 2013-12-03 20:56:03 UTC
Fixed upstream

Comment 5 Milan Kubík 2014-01-29 13:09:30 UTC
$ cat invalid_sasl_mech_name.sh 
#!/bin/bash

LDAPhost=localhost
LDAPport=2222
ROOTDN="cn=directory manager"
ROOTDNPW=Secret123

ldapmodify -x -h $LDAPhost -p $LDAPport -D "$ROOTDN" -w "$ROOTDNPW" <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-allowed-sasl-mechanisms
nsslapd-allowed-sasl-mechanisms: GSSAPI +ľščť DIGEST-MD5
EOF

ldapmodify -x -h $LDAPhost -p $LDAPport -D "$ROOTDN" -w "$ROOTDNPW" <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-allowed-sasl-mechanisms
nsslapd-allowed-sasl-mechanisms: GSSAPI, +ľščť, DIGEST-MD5
EOF

ldapmodify -x -h $LDAPhost -p $LDAPport -D "$ROOTDN" -w "$ROOTDNPW" <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-allowed-sasl-mechanisms
nsslapd-allowed-sasl-mechanisms: lowercase
EOF

ldapmodify -x -h $LDAPhost -p $LDAPport -D "$ROOTDN" -w "$ROOTDNPW" <<EOF
dn: cn=config
changetype: modify
replace: nsslapd-allowed-sasl-mechanisms
nsslapd-allowed-sasl-mechanisms: MECHANISM-WITH-TOO-LONG-NAME
EOF

$ ./invalid_sasl_mech_name.sh 
modifying entry "cn=config"
ldap_modify: Server is unwilling to perform (53)

modifying entry "cn=config"
ldap_modify: Server is unwilling to perform (53)

modifying entry "cn=config"
ldap_modify: Server is unwilling to perform (53)

modifying entry "cn=config"
ldap_modify: Server is unwilling to perform (53)

Bug verified on 389-ds-base-1.3.1.6-15.

Tests in sasl suite sasl_allowed_mapping_[1..13]

Comment 6 Ludek Smid 2014-06-13 09:41:29 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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