NEWS[4.19.3]: Samba 4.19.3 Available for Download
[samba-web.git] / security / CVE-2020-25721.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4
5 <head>
6 <title>Samba - Security Announcement Archive</title>
7 </head>
8
9 <body>
10
11    <H2>CVE-2020-25721.html:</H2>
12
13 <p>
14 <pre>
15 =============================================================
16 == Subject:     Kerberos acceptors need easy access to stable
17 ==              AD identifiers (eg objectSid)
18 ==
19 == CVE ID#:     CVE-2020-25721
20 ==
21 == Versions:    All versions of Samba since Samba 4.0.0
22 ==
23 == Summary:     Samba as an AD DC now provides a way for Linux
24 ==              applications to obtain a reliable SID (and
25 ==              samAccountName) in issued tickets.
26 =============================================================
27
28 ===========
29 Description
30 ===========
31
32 In order to avoid issues like CVE-2020-25717 AD Kerberos accepting
33 services need access to unique, and ideally long-term stable
34 identifiers of a user to perform authorization.
35
36 The AD PAC provides this, but the most useful information is kept in a
37 buffer which is NDR encoded, which means that so far in Free Software
38 only Samba and applications which use Samba components under the hood
39 like FreeIPA and SSSD decode PAC.
40
41 Recognising that the issues seen in Samba are not unique, Samba now
42 provides an extension to UPN_DNS_INFO, a component of the AD PAC, in a
43 way that can be parsed using basic pointer handling.
44
45 From this, future non-Samba based Kerberised applications can easily obtain
46 the user's SID, in the same packing as objectSID in LDAP, confident
47 that the ticket represents a specific user, not matter subsequent
48 renames.
49
50 This will allow such non-Samba applications to avoid confusing one
51 Kerberos user for another, even if they have the same string name (due
52 to the gap between time of ticket printing by the KDC and time of
53 ticket acceptance).
54
55 The protocol deployment weakness, as demonstrated with the
56 CVE-2020-25717 in Samba when deployed in Active Directory, leaves most
57 Linux and UNIX applications only to rely on the "client name" from the
58 Kerberos ticket. When the "client name" as seen by the KDC is under an
59 attacker control across multiple Kerberos requests, such applications
60 need an additional information to correlate the client name across
61 those requests.
62
63 Directories where only full administrators can create users are not
64 the concern, the concern is where that user/computer creation right is
65 delegated in some way, explicitly or via ms-DS-MachineAccountQuota.
66
67 ==================
68 Patch Availability
69 ==================
70
71 Patches addressing both these issues have been posted to:
72
73     https://www.samba.org/samba/security/
74
75 Additionally, Samba 4.15.2, 4.14.10 and 4.13.14 have been issued
76 as security releases to correct the defect.  Samba administrators are
77 advised to upgrade to these releases or apply the patch as soon
78 as possible.
79
80 A patch has been written for Heimdal Kerberos to use this feature, and
81 will be published for possible inclusion shortly after Samba's
82 security relase.
83
84 ==================
85 CVSSv3 calculation
86 ==================
87
88 The impact of doing authorization with the string Kerberos cname name
89 varies by accepting application.
90
91 ==========
92 Workaround
93 ==========
94
95 It would be prudent to pre-create disabled users in Active Directory
96 matching on all privileged names not held in Active Directory, eg
97
98  samba-tool user add root -H ldap://$SERVER -U$USERNAME%$PASSWORD --random-password
99  samba-tool user add ubuntu -H ldap://$SERVER -U$USERNAME%$PASSWORD --random-password
100  ...
101  (repeat for eg all system users under 1000 in /etc/passwd or special
102  to any other AD-connected services, eg perhaps "admin" for a web-app)
103
104 If running a Microsoft Windows Active Directory, Setting
105 ms-DS-MachineAccountQuota to 0, in the Active Directory domain would
106 be advised, if possible.
107
108 ===========================
109 Credits and further reading
110 ===========================
111
112 Originally reported by Andrew Bartlett.
113
114 Patches provided by Andrew Bartlett and Joseph Sutton of Catalyst and
115 the Samba team.
116
117 Andrew wishes to give much thanks to NetSPI for the blog
118 "MachineAccountQuota is USEFUL Sometimes: Exploiting One of Active
119 Directory's Oddest Settings" by Kevin Robertson[1], on which the full
120 horror of MachineAccountQuota became clear.
121
122 [1] https://www.netspi.com/blog/technical/network-penetration-testing/machineaccountquota-is-useful-sometimes/
123
124
125 ==========================================================
126 == Our Code, Our Bugs, Our Responsibility.
127 == The Samba Team
128 ==========================================================
129 </pre>
130 </body>
131 </html>