CVE-2018-10919 acl_read: Fix unauthorized attribute access via searches
commit9891df452e53b5e7b52ef6a0ce40b7b64aee28bf
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 20 Jul 2018 03:42:36 +0000 (20 15:42 +1200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 11 Aug 2018 06:16:02 +0000 (11 08:16 +0200)
treeab32fd9fca5e453fc3bafb020c48ac4fe9e72a92
parent1575ba4234a7fbb0d2cc7b23e361c4e753939a6b
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