libcurl can in some circumstances reuse the wrong connection when asked to do an NTLM-authenticated HTTP or HTTPS request.
libcurl features a pool of recent connections so that subsequent requests can reuse an existing connection to avoid overhead.
When reusing a connection a range of criterion must first be met. Due to a logical error in the code, a request that was issued by an application could wrongfully reuse an existing connection to the same server that was authenticated using different credentials. One underlying reason being that NTLM authenticates connections and not requests, contrary to how HTTP is designed to work and how other authentication methods work.
An application that allows NTLM and another auth method (the bug only triggers if more than one auth method is asked for) to a server (that responds wanting NTLM) with user1:password1 and then does another operation to the same server with user2:password2 (when the previous connection was left alive) - the second request reuses the same connection and since it then sees that the NTLM negotiation is already made, it just sends the request over that connection thinking it uses the user2 credentials when it is in fact still using the connection authenticated for user1...
The set of auth methods to use is set with CURLOPT_HTTPAUTH.
Two common auth defines in libcurl are CURLAUTH_ANY and CURLAUTH_ANYSAFE.
Both of them ask for NTLM and other methods and can therefore trigger this
problem.
Applications can disable libcurl's reuse of connections and thus mitigate
this problem, by using one of the following libcurl options to alter how
connections are or are not reused: CURLOPT_FRESH_CONNECT,
CURLOPT_MAXCONNECTS and CURLMOPT_MAX_HOST_CONNECTIONS (if using the
curl_multi API).
{
"CWE": {
"id": "CWE-305",
"desc": "Authentication Bypass by Primary Weakness"
},
"www": "https://curl.se/docs/CVE-2014-0015.html",
"URL": "https://curl.se/docs/CVE-2014-0015.json",
"package": "curl",
"last_affected": "7.34.0",
"affects": "both",
"severity": "Medium"
}[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"function_hash": "279262842035850808475238446781750507391",
"length": 4863.0
},
"target": {
"function": "ConnectionExists",
"file": "lib/url.c"
},
"id": "CURL-CVE-2014-0015-174a450c",
"source": "https://github.com/curl/curl.git/commit/8ae35102c43d8d06572c3a1292eb6e27e663c78d",
"signature_type": "Function"
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"96362446408172629023671747822393012285",
"232529768766278468058420231767146097306",
"23529890510160597717740996281088605471",
"111457838185563236342060025827401879201",
"55073553013929180067853886365453308103",
"306153440073996961060092002823410809838"
]
},
"target": {
"file": "lib/url.c"
},
"id": "CURL-CVE-2014-0015-d0cbe2c3",
"source": "https://github.com/curl/curl.git/commit/8ae35102c43d8d06572c3a1292eb6e27e663c78d",
"signature_type": "Line"
}
]