1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

http: do not leak basic auth credentials on re-used connections

CVE-2015-3236

This partially reverts commit curl-7_39_0-237-g87c4abb

Reported-by: Tomas Tomecek, Kamil Dudka
Bug: http://curl.haxx.se/docs/adv_20150617A.html
This commit is contained in:
Kamil Dudka 2015-05-28 20:04:35 +02:00 committed by Daniel Stenberg
parent 24f0b6ebf7
commit 24a8359b25

View File

@ -2312,20 +2312,12 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
te te
); );
/* /* clear userpwd to avoid re-using credentials from re-used connections */
* Free userpwd for Negotiate/NTLM. Cannot reuse as it is associated with Curl_safefree(conn->allocptr.userpwd);
* the connection and shouldn't be repeated over it either.
*/
switch (data->state.authhost.picked) {
case CURLAUTH_NEGOTIATE:
case CURLAUTH_NTLM:
case CURLAUTH_NTLM_WB:
Curl_safefree(conn->allocptr.userpwd);
break;
}
/* /*
* Same for proxyuserpwd * Free proxyuserpwd for Negotiate/NTLM. Cannot reuse as it is associated
* with the connection and shouldn't be repeated over it either.
*/ */
switch (data->state.authproxy.picked) { switch (data->state.authproxy.picked) {
case CURLAUTH_NEGOTIATE: case CURLAUTH_NEGOTIATE: