CVE-2018-10919 acl_read: Fix unauthorized attribute access via searches
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 20 Jul 2018 03:42:36 +0000 (15:42 +1200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 11 Aug 2018 19:56:42 +0000 (21:56 +0200)
commit9b17ce9a1f46e8519302eb6ec72f1104560bf953
tree28fddc17c5cb77577c44b2d5fa0f4fc8b7963d61
parent717bde3288704d501368ca650963e2648d005c55
CVE-2018-10919 acl_read: Fix unauthorized attribute access via searches

A user that doesn't have access to view an attribute can still guess the
attribute's value via repeated LDAP searches. This affects confidential
attributes, as well as ACLs applied to an object/attribute to deny
access.

Currently the code will hide objects if the attribute filter contains an
attribute they are not authorized to see. However, the code still
returns objects as results if confidential attribute is in the search
expression itself, but not in the attribute filter.

To fix this problem we have to check the access rights on the attributes
in the search-tree, as well as the attributes returned in the message.

Points of note:
- I've preserved the existing dirsync logic (the dirsync module code
  suppresses the result as long as the replPropertyMetaData attribute is
  removed). However, there doesn't appear to be any test that highlights
  that this functionality is required for dirsync.
- To avoid this fix breaking the acl.py tests, we need to still permit
  searches like 'objectClass=*', even though we don't have Read Property
  access rights for the objectClass attribute. The logic that Windows
  uses does not appear to be clearly documented, so I've made a best
  guess that seems to mirror Windows behaviour.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
selftest/knownfail.d/acl [deleted file]
selftest/knownfail.d/confidential_attr [deleted file]
source4/dsdb/samdb/ldb_modules/acl_read.c