1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/source4/dsdb/tests/python
Joseph Sutton 9447c4e81e CVE-2023-0614 ldb: Prevent disclosure of confidential attributes
Add a hook, acl_redact_msg_for_filter(), in the aclread module, that
marks inaccessible any message elements used by an LDAP search filter
that the user has no right to access. Make the various ldb_match_*()
functions check whether message elements are accessible, and refuse to
match any that are not. Remaining message elements, not mentioned in the
search filter, are checked in aclread_callback(), and any inaccessible
elements are removed at this point.

Certain attributes, namely objectClass, distinguishedName, name, and
objectGUID, are always present, and hence the presence of said
attributes is always allowed to be checked in a search filter. This
corresponds with the behaviour of Windows.

Further, we unconditionally allow the attributes isDeleted and
isRecycled in a check for presence or equality. Windows is not known to
make this special exception, but it seems mostly harmless, and should
mitigate the performance impact on searches made by the show_deleted
module.

As a result of all these changes, our behaviour regarding confidential
attributes happens to match Windows more closely. For the test in
confidential_attr.py, we can now model our attribute handling with
DC_MODE_RETURN_ALL, which corresponds to the behaviour exhibited by
Windows.

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

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

[abartlet@samba.org adapted due to Samba 4.17 and lower
 not having the patches for CVE-2020-25720 and 4.16 and lower
 not having the patches for CVE-2022-32743 ]
2023-03-20 10:03:38 +01:00
..
testdata pytests: try ldap.modify_order with normal user 2019-05-01 05:32:25 +00:00
acl.py CVE-2022-32746 s4:dsdb:tests: Add test for deleting a disallowed SPN 2022-07-24 09:20:21 +02:00
ad_dc_medley_performance.py python: Fix usage strings 2021-09-04 00:10:37 +00:00
ad_dc_multi_bind.py python: Fix usage strings 2021-09-04 00:10:37 +00:00
ad_dc_performance.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
ad_dc_provision_performance.py PY3: change shebang to python3 in source4/dsdb dir 2018-12-14 14:40:20 +01:00
ad_dc_search_performance.py python: Fix usage strings 2021-09-04 00:10:37 +00:00
asq.py python: Fix usage strings 2021-09-04 00:10:37 +00:00
attr_from_server.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
confidential_attr.py CVE-2023-0614 ldb: Prevent disclosure of confidential attributes 2023-03-20 10:03:38 +01:00
deletetest.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
dirsync.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
dsdb_schema_info.py pytests: heed assertEquals deprecation warning en-masse 2020-02-07 10:37:37 +00:00
large_ldap.py CVE-2023-0614 dsdb: Alter timeout test in large_ldap.py to be slower by matching on large objects 2023-03-20 10:03:37 +01:00
ldap_modify_order.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
ldap_schema.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
ldap_syntaxes.py pytests: heed assertEquals deprecation warning en-masse 2020-02-07 10:37:37 +00:00
ldap.py CVE-2020-25722 selftest: Adapt ldap.py tests to new objectClass restrictions 2021-11-09 19:45:33 +00:00
linked_attributes.py selftest: Move self.assertRaisesLdbError() to samba.tests.TestCase 2021-10-04 21:07:31 +00:00
login_basics.py dsdb/tests: add test_login_basics_simple() 2022-03-16 13:41:14 +00:00
ndr_pack_performance.py PY3: change shebang to python3 in source4/dsdb dir 2018-12-14 14:40:20 +01:00
notification.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
password_lockout_base.py dsdb/tests: prepare BasePasswordTestCase for simple bind tests 2022-03-16 13:41:14 +00:00
password_lockout.py dsdb/tests: let all BasePasswordTestCase tests provide self.host_url[_ldaps] 2022-03-16 13:41:14 +00:00
password_settings.py CVE-2020-25722 selftest: Catch possible errors in PasswordSettingsTestCase.test_pso_none_applied() 2021-11-09 19:45:32 +00:00
passwords.py dsdb/tests: passwords.py don't need to import BasePasswordTestCase 2022-03-16 13:41:14 +00:00
priv_attrs.py selftest: Check received LDB error code when STRICT_CHECKING=0 2021-11-30 02:42:31 +00:00
rodc_rwdc.py rodc: Add tests for simple BIND alongside NTLMSSP binds 2022-03-16 13:41:14 +00:00
rodc.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
sam.py CVE-2020-25722 selftest: Add test for duplicate servicePrincipalNames on an add operation 2021-11-09 19:45:34 +00:00
sec_descriptor.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
sites.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
sort.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
subtree_rename.py selftest: Move self.assertRaisesLdbError() to samba.tests.TestCase 2021-10-04 21:07:31 +00:00
token_group.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
tombstone_reanimation.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
urgent_replication.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00
user_account_control.py CVE-2020-25722 selftest/user_account_control: more work to cope with UAC/objectclass defaults and lock 2021-11-09 19:45:32 +00:00
vlv.py python: remove all 'from __future__ import print_function' 2021-04-28 03:43:34 +00:00