NEWS[4.19.3]: Samba 4.19.3 Available for Download
[samba-web.git] / security / CVE-2016-2125.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-2016-2125.html:</H2>
12
13 <p>
14 <pre>
15 ===============================================================================
16 == Subject:     Unconditional privilege delegation to Kerberos servers in trusted realms
17 ==
18 == CVE ID#:     CVE-2016-2125
19 ==
20 == Versions:    Samba 3.0.25 to 4.5.2
21 ==
22 == Summary:     Samba client code always requests a forwardable ticket
23 ==              when using Kerberos authentication. This means the
24 ==              target server, which must be in the current or trusted
25 ==              domain/realm, is given a valid general purpose Kerberos
26 ==              "Ticket Granting Ticket" (TGT), which can be used to
27 ==              fully impersonate the authenticated user or service.
28 ==
29 ================================================================================
30
31 ===========
32 Description
33 ===========
34
35 The Samba client code always requests a forwardable Kerberos ticket when
36 performing Kerberos authentication by passing the GSS_C_DELEG_FLAG to the
37 gss_init_sec_context() GSSAPI function.
38
39 The use of GSS_C_DELEG_FLAG, if accepted by the Kerberos KDC, results in
40 passing the forwardable TGT to the remote target service via Kerberos AP-REQ.
41 The target service by design must be part of the same or a trusted Kerberos
42 realm (a domain in the same or trusted Active Directory forest).
43
44 The service that accepts the AP-REQ from the client can thus do whatever the
45 client is also able to achieve with the Kerberos TGT.
46
47 The risks of impersonation of the client are similar to the well known risks
48 from forwarding of NTLM credentials, with two important differences:
49  - NTLM forwarding can and should be mitigated with packet signing
50  - Kerberos forwarding can only be attempted after the trusted
51    destination server decrypts the ticket.
52
53 Finally, it should be noted that typically the connections involved
54 are either explicitly requested, or are between or to Domain
55 Controllers already of ultimate privilege.
56
57 Controlling Kerberos forwarding
58 -------------------------------
59
60 In the Active Directory world it's possible for administrators to
61 limit the delegation. User and computer objects can both act as
62 Kerberos users and also as Kerberos services. Both types of objects have an
63 attribute called 'userAccountControl' which is a bitmask that controls the
64 behavior of the account. The following three values have impact on possible
65 delegation:
66
67 0x00100000: UF_NOT_DELEGATED:
68
69 The UF_NOT_DELEGATED can be used to disable the ability to get forwardable TGT
70 for the account. It means the KDC will respond with an error if the client asks
71 for the forwardable ticket.  The client typically gives up and removes the
72 GSS_C_DELEG_FLAG flag and continues without passing delegated credentials.
73 Administrators can use this to disable possible delegation for the most
74 privileged accounts (e.g. administrator accounts).
75
76 0x00080000: UF_TRUSTED_FOR_DELEGATION
77
78 If the UF_TRUSTED_FOR_DELEGATION is set on an account a KDC will include the
79 OK_AS_DELEGATE flag in a granted service ticket. If the client application
80 uses just GSS_C_DELEG_POLICY_FLAG (instead of GSS_C_DELEG_FLAG) gssapi/Kerberos
81 libraries typically only include delegated credentials when the service ticket
82 includes the OK_AS_DELEGATE flag.  Administrators can use this to control which
83 services will get delegated credentials, for example if the service runs in a
84 trusted environment and actually requires the presence of delegated
85 credentials.
86
87 0x01000000: UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION
88
89 The UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION is not really relevant for this
90 CVE and just listed here for completeness. This flag is relevant for the
91 S4U2Proxy feature, where a service can ask the KDC for a proxied service
92 ticket which can impersonate users to other services.
93
94 The patched Samba version will still use GSS_C_DELEG_POLICY_FLAG and provide
95 delegated credentials to services which have the UF_TRUSTED_FOR_DELEGATION
96 bitmask set on the user account.
97
98 ==================
99 Patch Availability
100 ==================
101
102 A patch addressing this defect has been posted to
103
104   https://www.samba.org/samba/security/
105
106 Additionally, Samba 4.5.3, 4.4.8 and 4.3.13 have been issued as
107 security releases to correct the defect. Samba vendors and
108 administrators running affected versions are advised to upgrade or
109 apply the patch as soon as possible.
110
111 ==========
112 Workaround
113 ==========
114
115 See the description about UF_NOT_DELEGATED above.
116
117 The samba-tool command and the AD DC mode honours the undocumented
118 "gensec_gssapi:delegation=no" option in the [global] section of the
119 smb.conf file.
120
121 =======
122 Credits
123 =======
124
125 This vulnerability was discovered by Simo Sorce of Red Hat and
126 researched by Stefan Metzmacher of SerNet (https://samba.plus) both
127 members of the Samba Team (https://www.samba.org). Stefan Metzmacher
128 also provided the fixes.
129 </pre>
130 </body>
131 </html>