RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1316328 - search returns no entry when OR filter component contains non readable attribute
Summary: search returns no entry when OR filter component contains non readable attri...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-10 01:02 UTC by Noriko Hosoi
Modified: 2020-09-13 21:31 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-1.3.5.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 20:40:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 1606 0 None None None 2020-09-13 21:31:39 UTC
Red Hat Product Errata RHSA-2016:2594 0 normal SHIPPED_LIVE Moderate: 389-ds-base security, bug fix, and enhancement update 2016-11-03 12:11:08 UTC

Description Noriko Hosoi 2016-03-10 01:02:14 UTC
Problem description
	access control requires that a user has read access to all attributes in OR filter components. 
	Else no entry is returned, even if the filter matches some entries.
	This is to prevent guessing of attribute values using OR filter.
	The problem is that this requirement prevents to use non readable attribute in filter.
	If we make sure that component, with non readable attributes, do not match the selected entry. 
	then guessing would be prevented and it will allow non readable attributes in the filter.

For example, 'user' has read access on 'cn' but no read access over 'telephonenumber' attribute

dn: cn=foo,dc=example,dc=com
objectClass: top
objectClass: person
sn: foo
cn: foo
telephoneNumber: 123

Without this access control guessing could be done this way

ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "dc=example, dc=com" "(cn=foo)" dn cn
dn: cn=foo,dc=example,dc=com
cn: foo
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=0*)(cn=bar))" dn
<no entry>
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=1*)(cn=bar))" dn
dn: cn=foo,dc=example,dc=com
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=10*)(cn=bar))" dn
<no entry>
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=11*)(cn=bar))" dn
<no entry>
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=12*)(cn=bar))" dn
dn: cn=foo,dc=example,dc=com
...

With the current access control, last 5 searches return <no entry> (preventing guessing)
But also
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=*)(cn=foo))" dn
<no entry>

Now if access control allows non readable attribute ('telephonenumber') but systematically reject matching with it
the last 5 searches also return <no entry>
But the following searches would be successfull
ldapsearch -D "cn=user,dc=example,dc=com" -w xxx -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=*)(cn=foo))" dn telephonenumber cn
dn: cn=foo,dc=example,dc=com
cn: foo

Comment 5 Kamlesh 2016-08-23 07:28:11 UTC
Thanks Ludwig, for clearing my doubt.
I verified this bug;

Step perform 

[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "dc=example, dc=com" "(cn=foo)" dn cn

# foo, example.com
dn: cn=foo,dc=example,dc=com
cn: foo
-----------------------

[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=0*)(cn=bar))" dn
No Result
----------------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=1*)(cn=bar))" dn

# foo, example.com
dn: cn=foo,dc=example,dc=com

----------------------

[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=10*)(cn=bar))" dn
No Result
---------------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=11*)(cn=bar))" dn

No Result

--------------------
ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=12*)(cn=bar))" dn
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=12*)(cn=bar))" dn

# foo, example.com
dn: cn=foo,dc=example,dc=com
--------------------

dn: dc=example,dc=com
changetype: modify
replace: aci
aci: (targetattr = "cn")(version 3.0;acl "cn allow";allow (read)(userdn = "ldap:///cn=user,dc=example,dc=com");)
-
aci: (targetattr = "telephoneNumber")(version 3.0;acl "deny Read and seach";deny (read)(userdn = "ldap:///cn=user,dc=example,dc=com");)

--------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "dc=example, dc=com" "(cn=foo)" dn cn
No Result
----------------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=0*)(cn=bar))" dn
No Result
----------------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=1*)(cn=bar))" dn
No Result
-----------------
ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=10*)(cn=bar))" dn 
No Result
---------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=12*)(cn=bar))" dn
No Result
--------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=*)(cn=foo))" dn
No Result
-------------
[root@test ~]# ldapsearch -D "cn=user,dc=example,dc=com" -w test1234 -b "cn=foo,dc=example, dc=com" "(|(telephonenumber=*)(cn=foo))" dn telephonenumber cn
No Result

Comment 7 errata-xmlrpc 2016-11-03 20:40:15 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/RHSA-2016-2594.html


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