]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2018-10919 tests: test ldap searches for non-existent attributes.
authorGary Lockyer <gary@catalyst.net.nz>
Fri, 3 Aug 2018 03:51:28 +0000 (15:51 +1200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 11 Aug 2018 19:56:41 +0000 (21:56 +0200)
It is perfectly legal to search LDAP for an attribute that is not part
of the schema.  That part of the query should simply not match.

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

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/tests/python/ldap.py

index 4235541fdbe2e66fa9498d1505a7ffdec4c856f1..2514d0a9d72782c33df03e1c744350e5267fb9bb 100755 (executable)
@@ -599,6 +599,15 @@ class BasicTests(samba.tests.TestCase):
         except LdbError, (num, _):
             self.assertEquals(num, ERR_NO_SUCH_ATTRIBUTE)
 
+        #
+        # When searching the unknown attribute should be ignored
+        expr = "(|(cn=ldaptestgroup)(thisdoesnotexist=x))"
+        res = ldb.search(base=self.base_dn,
+                         expression=expr,
+                         scope=SCOPE_SUBTREE)
+        self.assertTrue(len(res) == 1,
+                        "Search including unknown attribute failed")
+
         delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         # attributes not in objectclasses and mandatory attributes missing test