Issue 6912 - support for case sensitive SASL usernames
Summary: support for case sensitive SASL usernames
Status: VERIFIED WONTFIX
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-21 10:54 UTC by daniel@pluta.biz
Modified: 2023-10-09 17:56 UTC (History)
0 users

See Also:


Attachments
daniel-pluta-2011-04-24.patch (942 bytes, patch)
2020-03-20 03:46 UTC, Quanah Gibson-Mount
Details
daniel-pluta-2011-05-02.patch (730 bytes, patch)
2020-03-20 03:47 UTC, Quanah Gibson-Mount
Details

Note You need to log in before you can comment on or make changes to this issue.
Description daniel@pluta.biz 2011-04-21 10:54:36 UTC
Full_Name: authz-regex dnNormalize() filter expression with matching rule assertion
Version: HEAD
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (2001:4ca0:0:fe00:200:5efe:81bb:f4c)


We tried to support/implement case-sensitive logins using SASL DIGEST-MD5.

Imagine the following partial authz-regexp statement:
ldap:///ou=users,ou=eecbcs.de,dc=foo,dc=bar??one?(uid:caseExactMatch:=$1)

During "dnNormalize" the uid is transformed into lowercase which cause the
caseExactMatch to fail:

SASL [conn=1010] Debug: DIGEST-MD5 server step 2
slap_sasl_getdn: u:id converted to uid=user1HAHA,cn=DIGEST-MD5,cn=auth
>>> dnNormalize: <uid=user1HAHA,cn=DIGEST-MD5,cn=auth>
<<< dnNormalize: <uid=user1HAHA,cn=digest-md5,cn=auth>
==>slap_sasl2dn: converting SASL name uid=user1HAHA,cn=digest-md5,cn=auth to a
DN
==> rewrite_context_apply [depth=1]
string='uid=user1HAHA,cn=digest-md5,cn=auth'
==> rewrite_rule_apply
rule='uid=([^,]+),cn=(PLAIN|LOGIN|OTP|DIGEST-MD5|CRAM-MD5),cn=auth'
string='uid=user1HAHA,cn=digest-md5,cn=auth' [1 pass(es)]
==> rewrite_context_apply [depth=1]
res={0,'ldap:///ou=users,ou=eecbcs.de,dc=foo,dc=bar??one?(uid:caseExactMatch:=user1haha)'}
Comment 1 daniel@pluta.biz 2011-04-24 15:35:19 UTC
this micro-patch "works for me": 
ftp://ftp.openldap.org/incoming/Daniel-Pluta-110424.patch

Disclaimer: I don't know the details regarding the need for 
normalization but ...
... to my current knowledge and opposed to authDNs, there's no need to 
normalize authcIDs at all?


slapd's behaviour before the patch:

do_bind: dn () SASL mech DIGEST-MD5
SASL [conn=1001] Debug: DIGEST-MD5 server step 2
slap_sasl_getdn: u:id converted to uid=userHAHAHA,cn=DIGEST-MD5,cn=auth
 >>> dnNormalize: <uid=userHAHAHA,cn=DIGEST-MD5,cn=auth>
<<< dnNormalize: <uid=userhahaha,cn=digest-md5,cn=auth>
==>slap_sasl2dn: converting SASL name 
uid=userhahaha,cn=digest-md5,cn=auth to a DN
==> rewrite_context_apply [depth=1] 
string='uid=userhahaha,cn=digest-md5,cn=auth'
==> rewrite_rule_apply 
rule='uid=([^,]+),cn=(PLAIN|LOGIN|OTP|DIGEST-MD5|CRAM-MD5),cn=auth' 
string='uid=userhahaha,cn=digest-md5,cn=auth' [1 pass(es)]
==> rewrite_context_apply [depth=1] 
res={0,'ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userhahaha)'}
slap_parseURI: parsing 
ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userhahaha)
ldap_url_parse_ext(ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userhahaha))
put_filter: "(userLogin=userhahaha)"


slapd's behaviour after the patch has been applied:

do_bind: dn () SASL mech DIGEST-MD5
SASL [conn=1000] Debug: DIGEST-MD5 server step 2
slap_sasl_getdn: u:id converted to uid=userHAHAHA,cn=DIGEST-MD5,cn=auth
==>slap_sasl2dn: converting SASL name 
uid=userHAHAHA,cn=DIGEST-MD5,cn=auth to a DN
==> rewrite_context_apply [depth=1] 
string='uid=userHAHAHA,cn=DIGEST-MD5,cn=auth'
==> rewrite_rule_apply 
rule='uid=([^,]+),cn=(PLAIN|LOGIN|OTP|DIGEST-MD5|CRAM-MD5),cn=auth' 
string='uid=userHAHAHA,cn=DIGEST-MD5,cn=auth' [1 pass(es)]
==> rewrite_context_apply [depth=1] 
res={0,'ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userHAHAHA)'}
slap_parseURI: parsing 
ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userHAHAHA)
ldap_url_parse_ext(ldap:///ou=users,dc=foo,dc=bar??one?(userLogin=userHAHAHA))
put_filter: "(userLogin=userHAHAHA)"
put_filter: simple
put_simple_filter: "userLogin=userHAHAHA"

note, the userLogin attribute is defined using octetString-Syntax and 
thus is compared case sensitive

Comment 2 daniel@pluta.biz 2011-05-03 14:10:34 UTC
In case authcIDs do not need to be normalized, this seems to be a better 
place to disable normalization:

ftp://ftp.openldap.org/incoming/Daniel-Pluta-110502.patch

Now authzIDs of the form "u:xxxx" are also affected.

Comment 3 Quanah Gibson-Mount 2017-04-08 00:11:25 UTC
changed notes
moved from Incoming to Software Bugs
Comment 4 OpenLDAP project 2017-09-07 21:16:31 UTC
has patch
specification failure on what to do in this case
Comment 5 Quanah Gibson-Mount 2017-09-07 21:16:31 UTC
changed notes
moved from Software Bugs to Incoming
Comment 6 Quanah Gibson-Mount 2020-03-20 03:46:11 UTC
Created attachment 621 [details]
daniel-pluta-2011-04-24.patch

From FTP server
Comment 7 Quanah Gibson-Mount 2020-03-20 03:47:17 UTC
Created attachment 622 [details]
daniel-pluta-2011-05-02.patch
Comment 8 Quanah Gibson-Mount 2020-03-20 03:49:14 UTC
Comment on attachment 621 [details]
daniel-pluta-2011-04-24.patch

Patches must be applied together
Comment 9 Quanah Gibson-Mount 2023-10-09 17:55:59 UTC
no.