CVE-2020-25722 s4/dsdb/samldb: check for SPN uniqueness, including aliases
commitb121b1920f996fc9c15ec40a63e7cf4dd7159161
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 22 Oct 2021 00:14:32 +0000 (22 13:14 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:11 +0000 (8 10:52 +0100)
tree61b0e89b7f10f70c8942202ce1579e92634ef313
parent9be11622765c060971c4fcc2fba981f760f897d8
CVE-2020-25722 s4/dsdb/samldb: check for SPN uniqueness, including aliases

Not only should it not be possible to add a servicePrincipalName that
is already present in the domain, it should not be possible to add one
that is implied by an entry in sPNMappings, unless the user is adding
an alias to another SPN and has rights to alter that one.

For example, with the default sPNMappings, cifs/ is an alias pointing to
host/, meaning if there is no cifs/example.com SPN, the host/example.com
one will be used instead. A user can add the cifs/example.com SPN only
if they can also change the host/example.com one (because adding the
cifs/ effectively changes the host/). The reverse is refused in all cases,
unless they happen to be on the same object. That is, if there is a
cifs/example.com SPN, there is no way to add host/example.com elsewhere.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/ldap_spn
source4/dsdb/samdb/ldb_modules/samldb.c