Skip to content

Commit

Permalink
http_done: close Negotiate connections when done
Browse files Browse the repository at this point in the history
When doing HTTP requests Negotiate authenticated, the entire connnection
may become authenticated and not just the specific HTTP request which is
otherwise how HTTP works, as Negotiate can basically use NTLM under the
hood. curl was not adhering to this fact but would assume that such
requests would also be authenticated per request.

CVE-2015-3148

Bug: http://curl.haxx.se/docs/adv_20150422B.html
Reported-by: Isaac Boukris
  • Loading branch information
bagder committed Apr 21, 2015
1 parent 0583e87 commit 79b9d5f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/http.c
Expand Up @@ -1435,8 +1435,14 @@ CURLcode Curl_http_done(struct connectdata *conn,

#ifdef USE_SPNEGO
if(data->state.proxyneg.state == GSS_AUTHSENT ||
data->state.negotiate.state == GSS_AUTHSENT)
data->state.negotiate.state == GSS_AUTHSENT) {
/* add forbid re-use if http-code != 401/407 as a WA only needed for
* 401/407 that signal auth failure (empty) otherwise state will be RECV
* with current code */
if((data->req.httpcode != 401) && (data->req.httpcode != 407))
connclose(conn, "Negotiate transfer completed");
Curl_cleanup_negotiate(data);
}
#endif

/* set the proper values (possibly modified on POST) */
Expand Down

0 comments on commit 79b9d5f

Please sign in to comment.