013-CVE-2015-3148.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 6abfb512ed22c2de891a4398616d81a2a0690b5a Mon Sep 17 00:00:00 2001
  2. From: Daniel Stenberg <daniel@haxx.se>
  3. Date: Sat, 18 Apr 2015 23:50:16 +0200
  4. Subject: [PATCH] http_done: close Negotiate connections when done
  5. When doing HTTP requests Negotiate authenticated, the entire connnection
  6. may become authenticated and not just the specific HTTP request which is
  7. otherwise how HTTP works, as Negotiate can basically use NTLM under the
  8. hood. curl was not adhering to this fact but would assume that such
  9. requests would also be authenticated per request.
  10. CVE-2015-3148
  11. Bug: http://curl.haxx.se/docs/adv_20150422B.html
  12. Reported-by: Isaac Boukris
  13. ---
  14. lib/http.c | 8 +++++++-
  15. 1 file changed, 7 insertions(+), 1 deletion(-)
  16. --- a/lib/http.c
  17. +++ b/lib/http.c
  18. @@ -1493,8 +1493,14 @@ CURLcode Curl_http_done(struct connectda
  19. #ifdef USE_SPNEGO
  20. if(data->state.proxyneg.state == GSS_AUTHSENT ||
  21. - data->state.negotiate.state == GSS_AUTHSENT)
  22. + data->state.negotiate.state == GSS_AUTHSENT) {
  23. + /* add forbid re-use if http-code != 401 as a WA
  24. + * only needed for 401 that failed handling
  25. + * otherwie state will be RECV with current code */
  26. + if((data->req.httpcode != 401) && (data->req.httpcode != 407))
  27. + connclose(conn, "Negotiate transfer completed");
  28. Curl_cleanup_negotiate(data);
  29. + }
  30. #endif
  31. /* set the proper values (possibly modified on POST) */