Skip to content

Commit

Permalink
http: do not leak basic auth credentials on re-used connections
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kdudka authored and bagder committed Jun 17, 2015
1 parent 24f0b6e commit 24a8359
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/http.c
Expand Up @@ -2312,20 +2312,12 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
te
);

/*
* Free userpwd for Negotiate/NTLM. Cannot reuse as it is associated with
* 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;
}
/* clear userpwd to avoid re-using credentials from re-used connections */
Curl_safefree(conn->allocptr.userpwd);

/*
* 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) {
case CURLAUTH_NEGOTIATE:
Expand Down

0 comments on commit 24a8359

Please sign in to comment.