Fedora Account System
Red Hat Associate
Red Hat Customer
ldb_match_bitmask() in lib/ldb/common/ldb_match.c does not check whether the attribute it compares is inaccessible. ldb_match_message() skips ldb_must_suppress_match() when the filter operation is LDB_OP_EXTENDED. The bitwise rules are that operation. Their callback is ldb_match_bitmask(). A search unpacks the record and calls the redact callback before the match. On an AD DC that callback is acl_redact_msg_for_filter() in source4/dsdb/samdb/ldb_modules/acl_read.c. For an attribute named in the filter, acl_redact_attr() calls ldb_msg_element_mark_inaccessible() when the caller lacks the access mask. A confidential attribute requires control access in addition to read property. A secret attribute is marked inaccessible for every caller. ldb_match_bitmask() then finds the element and calls ldb_comparator_bitmask(). That function parses the stored bytes and the filter value with strtoull(). The AND rule matches when every bit in the filter value is set in the stored value. The OR rule matches when any bit is set. The entry is selected when the comparison matches. aclread_callback() later removes inaccessible values from the entry it sends on. A stored value that is not an integer makes ldb_comparator_bitmask() return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX. A missing value does not match. ldb_kv_search_and_return_base() returns that syntax error. The full search stores LDB_ERR_OPERATIONS_ERROR. The caller learns the integer. Each bit of an unreadable integer attribute selects or skips the entry, and the value is removed from the entry afterwards. msKds-CreateTime and msKds-UseStartTime are large integers, and msKds-Version is an integer. Provision stores them as decimal strings on the root key. msKds-RootKeyData is an octet string. The comparator does not return those bytes. The same comparison is the one that reports the syntax error when a non-integer value is present. The caller is authenticated. aclread_check_object_visible() allows the object when the caller has list rights on the parent. The container class default descriptor grants Authenticated Users read property and list contents. The root key class default descriptor grants read to Domain Admins, Enterprise Admins, and the system account. It does not grant that read to Authenticated Users. A confidential attribute also requires control access, which that user does not have, so the attribute is marked inaccessible. The search has no Domain Admin check. The flaw is reachable in the default configuration of an AD DC. ldb_init() registers both bitwise rules. The acl search parameter defaults to true. The stock schema sets SEARCH_FLAG_CONFIDENTIAL on msKds-CreateTime, msKds-UseStartTime, and msKds-Version. Provision creates the root key that holds them. Introduced on 14 February 2023 by Joseph Sutton in commit 9f31e4139c12262f5626108c6a883f07c4dd314e, "CVE-2023-0614 ldb: Centralise checking for inaccessible matches". The same change is in samba 4.16.10 (commit d60683e5e9daf243e9a2acc203b567c3a6c92567, ldb 2.5.3), samba 4.17.7 (commit b98f8c1af7770b49a447fdcc67ea64d98454955f, ldb 2.6.2), and samba 4.18.1 (commit 358894675d188b06cc0d24299012c898b394f99f, ldb 2.7.2). It is not in samba 4.16.9, samba 4.17.6, samba 4.18.0, or the 4.15 line through samba 4.15.13. It is present in samba 4.25.1 and on the current master branch.