Bug 1192283 (CVE-2020-25722) - VUL-0: CVE-2020-25722: samba: AD DC UPN vs samAccountName not checked (top-level bug for AD DC validation issues)
Summary: VUL-0: CVE-2020-25722: samba: AD DC UPN vs samAccountName not checked (top-le...
Status: RESOLVED FIXED
: 1192264 (view as bug list)
Alias: CVE-2020-25722
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/314125/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-03 08:30 UTC by Marcus Meissner
Modified: 2024-05-28 12:13 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Marcus Meissner 2021-11-03 16:25:29 UTC
*** Bug 1192264 has been marked as a duplicate of this bug. ***
Comment 5 Marcus Meissner 2021-11-10 07:58:59 UTC
is public

https://www.samba.org/samba/security/CVE-2020-25722.html


CVE-2020-25722.html:

===========================================================
== Subject:     Samba AD DC did not do suffienct access and
==              conformance checking of data stored.
==
== CVE ID#:     CVE-2020-25722
==
== Versions:    Samba 4.0.0 and later
==
== Summary:     At a number of points in the Samba AD DC
==              per-attribute and schema based permission checks
==              were not correctly implemented, allowing up
==              to total domain compromise.
===========================================================

===========
Description
===========

Samba as an Active Directory Domain Controller has to take care to
protect a number of sensitive attributes, and to follow a security
model from Active Directory that relies totally on the intersection of
NT security descriptors and the underlying X.500 Directory Access
Protocol (as then expressed in LDAP) schema constraints for security.

Some attributes in Samba AD are sensitive, they apply to one object
but protect others.

Users who can set msDS-AllowedToDelegateTo can become any user in the
domain on the server pointed at by this list.  Likewise in a domain
mixed with Microsoft Windows, Samba's lack of protection of sidHistory
would be a similar issue.

This would be limited to users with the right to create users or
modify them (typically those who created them), however, due to
other flaws, all users are able to create new user objects.

Finally, Samba did not enforce userPrincipalName and
servicePrincipalName uniqueness, nor did it correctly implement the
"validated SPN" feature allowing machine accounts to safely set their
own SPN (the checks were easily bypassed and additionally should
have been restricted to objectClass=computer).

Samba has implemented this feature, which avoids a denial of service
(UPNs) or service impersonation (SPNs) between users privileged to add
users to the domian (but see the above point).

This release adds a feature similar in goal but broader in
implementation than that found in the Windows 2012 Forest Functional
level.

=================
Behaviour changes
=================

After this release, in addressing the above issues, significant new
restrictions apply to the userPrincipalName, servicePrincipalName and
sAMAccountName attributes on users and computers, particularly for
non-administrators.

As a non-administrator (eg a user delegated the right to create
users/computers):
 * objects of objectclass computer must have a userAccountControl flag
 including UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT
 * objects of objectclass computer must have a sAMAccountName ending
 in $

For all new computer objects, if not specified otherwise the default
userAcocuntControl is UF_WORKSTATION_TRUST_ACCOUNT.

For all user/computer objects, userPrincipalName must be unique,
including the implicit UPN of @.  This applies
both to modifications of userPrincipalName and sAMAccountName.

For all user/computer objects, servicePrincipalName must be unique,
including the implict SPN aliases from the sPNMappings feature.

The only exception is that a user who wants to create a new SPN of
(eg) http/myhost.samba.example.org may do so if they have write
permission on host/myhost.samba.example.org.

Note that, due to Samba's internal logic for this check, a no-op
modify on the entry holding host/myhost.samba.example.org may show up
in the audit logs if enabled.

Finally, it should be noted that Samba's choice of UPN and SPN
restrictions does not match that in Microsoft Windows and introduced
in FL 2012 (Samba is stricter) and so behaviour in and the security
properties of a mixed Samba-Windows domain would depend on the DC
acting on any such query or modification.

Also, opt-out flags in dSHeuristics used by Microsoft Windows for
these features are not implemented in Samba.

==================
Patch Availability
==================

Patches addressing both these issues have been posted to:

    https://www.samba.org/samba/security/

Additionally, Samba  4.15.2, 4.14.10 and 4.13.14 have been issued
as security releases to correct the defect.  Samba administrators are
advised to upgrade to these releases or apply the patch as soon
as possible.

==================
CVSSv3 calculation
==================

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (8.8)

==========
Workaround
==========


=======
Credits
=======

Originally reported by Andrew Bartlett.

Patches provided by:
 - Andrew Bartlett of Catalyst and the Samba Team.
 - Douglas Bagnall of Catalyst and the Samba Team.
 - Nadezhda Ivanova of Symas and the Samba Team
 - Joseph Sutton of Catalyst and the Samba Team

Catalyst wishes to thank Univention Gmbh and Symas Corporation in
particular for their support towards the production of this fix.

Advisory written by Andrew Bartlett of Catalyst

==========================================================
== Our Code, Our Bugs, Our Responsibility.
== The Samba Team
==========================================================
Comment 6 Swamp Workflow Management 2021-11-10 20:18:50 UTC
openSUSE-SU-2021:3647-1: An update that fixes 8 vulnerabilities is now available.

Category: security (important)
Bug References: 1014440,1192214,1192215,1192246,1192247,1192283,1192284,1192505
CVE References: CVE-2016-2124,CVE-2020-25717,CVE-2020-25718,CVE-2020-25719,CVE-2020-25721,CVE-2020-25722,CVE-2021-23192,CVE-2021-3738
JIRA References: 
Sources used:
openSUSE Leap 15.3 (src):    ldb-2.2.2-3.3.1, samba-4.13.13+git.528.140935f8d6a-3.12.1
Comment 7 Swamp Workflow Management 2021-11-10 20:32:51 UTC
SUSE-SU-2021:3647-1: An update that fixes 8 vulnerabilities is now available.

Category: security (important)
Bug References: 1014440,1192214,1192215,1192246,1192247,1192283,1192284,1192505
CVE References: CVE-2016-2124,CVE-2020-25717,CVE-2020-25718,CVE-2020-25719,CVE-2020-25721,CVE-2020-25722,CVE-2021-23192,CVE-2021-3738
JIRA References: 
Sources used:
SUSE MicroOS 5.1 (src):    ldb-2.2.2-3.3.1
SUSE Linux Enterprise Module for Python2 15-SP3 (src):    samba-4.13.13+git.528.140935f8d6a-3.12.1
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    ldb-2.2.2-3.3.1, samba-4.13.13+git.528.140935f8d6a-3.12.1
SUSE Linux Enterprise High Availability 15-SP3 (src):    samba-4.13.13+git.528.140935f8d6a-3.12.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 10 Swamp Workflow Management 2022-02-10 17:18:46 UTC
SUSE-SU-2022:0361-1: An update that solves 11 vulnerabilities, contains one feature and has two fixes is now available.

Category: security (critical)
Bug References: 1014440,1188727,1189017,1189875,1192214,1192215,1192246,1192247,1192283,1192284,1192505,1192849,1194859
CVE References: CVE-2016-2124,CVE-2020-17049,CVE-2020-25717,CVE-2020-25718,CVE-2020-25719,CVE-2020-25721,CVE-2020-25722,CVE-2021-20254,CVE-2021-23192,CVE-2021-3738,CVE-2021-44142
JIRA References: SLE-18456
Sources used:
SUSE Enterprise Storage 7 (src):    ldb-2.2.2-4.6.1, samba-4.13.13+git.545.5897c2d94f3-3.12.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 11 Samuel Cabrero 2023-12-20 10:30:23 UTC
Reassign to security team to close it.
Comment 12 Carlos López 2024-05-28 12:13:28 UTC
Done, closing.