NEWS[4.17.0rc4]: Samba 4.17.0rc4 Available for Download
[samba-web.git] / security / CVE-2020-10704.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-10704.html:</H2>
12
13 <p>
14 <pre>
15 ===========================================================
16 == Subject:     LDAP Denial of Service (stack overflow) in
17 ==              Samba AD DC
18 ==
19 == CVE ID#:     CVE-2020-10704
20 ==
21 == Versions:    All versions of Samba since Samba 4.0.0
22 ==
23 == Summary:     A deeply nested filter in an un-authenticated
24 ==              LDAP search can exhaust the LDAP server's stack
25 ==              memory causing a SIGSEGV.
26 ===========================================================
27
28 ===========
29 Description
30 ===========
31
32 LDAP is encoded as ASN.1, and LDAP filters are defined recursively as
33    Filter ::= CHOICE {
34                 and             [0] SET OF Filter,
35                 or              [1] SET OF Filter,
36                 not             [2] Filter,
37                 
38 This recursion is mirrored in Samba's recursive decent parser, which
39 consumes around 600 bytes of stack per filter sent by the client.
40
41 In Samba, LDAP packets are parsed pre-authentication.
42
43 As an example on Linux x86_64, a LDAP search expression of (|(|(x=y)))
44 will consume over 1k of stack (600 bytes or so per OR).  Therefore,
45 even a fairly small, un-authenticated LDAP packet can cause the server
46 to fault with SIGSEGV as the stack reaches the OS-imposed limit (8MB
47 in this case).
48
49 If the network architecture allows a CLDAP packet (to UDP port 389) of
50 over 13,000 bytes (the maximum UDP packet size is 65,535) this
51 would also fit enough ASN.1 to crash the CLDAP server.
52
53 Samba 4.11 and later use the 'prefork' process model by default for
54 LDAP, and all versions use single process for CLDAP.
55
56 This shares one process between multiple network clients.  By crashing
57 one worker, legitimate service is disrupted to other clients.  The
58 process is restarted in all supported versions, but with a back-off.
59
60 NOTE WELL: Unsupported Samba versions before Samba 4.7 use a single
61 process for the (C)LDAP servers.  All versions of Samba before Samba
62 4.10 do not restart that process.
63
64 To address further concerns about resource use from LDAP packets, new
65 pre-parse limits are placed on LDAP searches (250k packet size limit),
66 all un-authenticated packets (250k packet size limit) other
67 authenticated packets (16MB) and CLDAP packets (4k).
68
69 * For authenticated connections the maximum packet size is controlled by
70   the smb.conf parameter "ldap max authenticated request size"
71
72 * For anonymous connections the maximum packet size is controlled by
73   the smb.conf parameter "ldap max anonymous request size"
74
75 * For searches, the maximum packet size is controlled by
76   the smb.conf parameter "ldap max search request size"
77
78 ==================
79 Patch Availability
80 ==================
81
82 Patches addressing both these issues have been posted to:
83
84     https://www.samba.org/samba/security/
85
86 Additionally, Samba 4.10.15, 4.11.8 and 4.12.2 have been issued
87 as security releases to correct the defect.  Samba administrators are
88 advised to upgrade to these releases or apply the patch as soon
89 as possible.
90
91 ==================
92 CVSSv3 calculation
93 ==================
94
95 CVSSv3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (7.5)
96
97 ================================
98 Workaround and mitigating factors
99 ================================
100
101 By default, Samba 4.10 is run using the "standard" process model,
102 which would leave only the CLDAP server affected.  (Later versions use
103 'prefork').
104
105 This is controlled by the -M or --model parameter to the samba binary.
106
107 All Samba versions are impacted if -M prefork or -M single is used. To
108 mitigate this issue for LDAP only, select -M standard (however this
109 will use more memory, may allow resource exhaustion, and will still
110 leave the CLDAP server exposed).
111
112 =======
113 Credits
114 =======
115
116 Credit to oss-fuzz.
117
118 Triage of the oss-fuzz report and advisory written by Andrew Bartlett
119 of Catalyst and the Samba Team.
120
121 Patches provided by Gary Lockyer of Catalyst and the Samba Team.
122
123 ==========================================================
124 == Our Code, Our Bugs, Our Responsibility.
125 == The Samba Team
126 ==========================================================
127 </pre>
128 </body>
129 </html>