commit | d22b28ecc66ff7765b62933e1c52e1fcd2cf010e | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Thu May 07 19:27:02 2020 +0200 |
committer | Christopher Faulet <cfaulet@haproxy.com> | Mon May 25 08:22:22 2020 +0200 |
tree | d796bdc240d89d2467ae82d517841ba703e7de14 | |
parent | d3be89bb73a0324731d16e795d59d418ac8f3bff [diff] |
BUG/MEDIUM: http_ana: make the detection of NTLM variants safer In issue #511 a problem was reported regarding NTLM and undesired session sharing. This was caused by an attempt to limit the protection against NTLM breakage to just NTLM and not properly working schemes in commit fd9b68c48 ("BUG/MINOR: only mark connections private if NTLM is detected"). Unfortunately as reported in the issue above, the extent of possible challenges for NTLM is a bit more complex than just the "NTLM" or "Negotiate" words. There's also "Nego2" and these words can be followed by a base64 value, which is not validated here. The list of possible entries doesn't seem to be officially documented but can be reconstructed from different public documents: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-ntht/7daaf621-94d9-4942-a70a-532e81ba293e https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-n2ht/5c1d2bbc-e1d6-458f-9def-dd258c181310 https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-n2ht/9201ed70-d245-41ce-accd-e609637583bf https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-n2ht/02be79f3-e360-475f-b468-b96c878c70c7 This patch tries to fix all this on top of previous attempts by making as private any connection that returns a www-authenticate header starting with "Nego" or "NTLM". We don't need to be too strict, we really just want to leave the connection shared if really sure it can be. This must be backported to 1.8 but will require some adaptations. In 1.9 and 2.0 the check appears both for legacy and HTX. The simplest thing to do is to look for "Negotiate" and fix all relevant places. (cherry picked from commit f1dccedcf63fdc1f6117cafaac89948904cc75b9) Signed-off-by: Christopher Faulet <cfaulet@haproxy.com> (cherry picked from commit 3093fda4723081eb2b91ab1591eec63232bac973) Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>