Bug 1537125 (CVE-2018-1000007)

Summary: CVE-2018-1000007 curl: HTTP authentication leak in redirects
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bodavis, cbuissar, cperry, csutherl, dbhole, erik-fedora, gzaronik, hhorak, jclere, john.j5live, jorton, kanderso, kdudka, luhliari, mbabacek, mike, mturk, omajid, paul, rwagner, security-response-team, sisharma, slawomir, twalsh
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: curl 7.58.0 Doc Type: If docs needed, set a value
Doc Text:
It was found that curl and libcurl might send their Authentication header to a third party HTTP server upon receiving an HTTP REDIRECT reply. This could leak authentication token to external entities.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 03:37:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1537966, 1537967, 1537968, 1555221, 1561720, 1802794, 1802795    
Bug Blocks: 1537129    
Attachments:
Description Flags
Upstream patch none

Description Adam Mariš 2018-01-22 13:45:33 UTC
It was found that libcurl might accidentally leak authentication data to third parties.

When asked to send custom headers in its HTTP requests, libcurl will send that set of headers first to the host in the initial URL but also, if asked to follow redirects and a 30X HTTP response code is returned, to the host mentioned in URL in the `Location:` response header value.

Sending the same set of headers to subsequest hosts is in particular a problem for applications that pass on custom `Authorization:` headers, as this header often contains privacy sensitive information or data that could allow others to impersonate the libcurl-using client's request.

This bug has existed since before curl 6.0.

Comment 1 Adam Mariš 2018-01-22 13:45:38 UTC
Acknowledgments:

Name: the Curl project
Upstream: Craig de Stigter

Comment 2 Adam Mariš 2018-01-22 13:46:49 UTC
Created attachment 1384445 [details]
Upstream patch

Comment 3 Adam Mariš 2018-01-24 08:09:25 UTC
External References:

https://curl.haxx.se/docs/adv_2018-b3bf.html

Comment 4 Adam Mariš 2018-01-24 08:10:34 UTC
Created curl tracking bugs for this issue:

Affects: fedora-all [bug 1537968]


Created mingw-curl tracking bugs for this issue:

Affects: epel-7 [bug 1537966]
Affects: fedora-all [bug 1537967]

Comment 7 Cedric Buissart 2018-02-05 16:26:23 UTC
Ceph uses libcurl in the rados gateway (RGW) only. By default CURLOPT_FOLLOWLOCATION is disabled and thus 3xx are returned rather than followed (https://curl.haxx.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html). RGW does not override default, and thus is not vulnerable.

Comment 10 Cedric Buissart 2018-03-29 12:51:52 UTC
Mitigation:

By default, curl and libcurl will not follow redirect requests.
This flaw happens only when curl or libcurl are explicitly requested to follow redirects (option --location in curl, and CURLOPT_FOLLOWLOCATION in libcurl).
To mitigate this, it is possible to prevent the automated following of redirects, replacing it by manual redirects (and remove the authentication header), for example.

Comment 15 Cedric Buissart 2018-04-19 07:28:19 UTC
Statement:

This issue affects the versions of curl as shipped with Red Hat Enterprise Linux 5, 6, and 7, as well as the versions of httpd24-curl as shipped with Red Hat Software Collections. Red Hat Product Security has rated this issue as having Moderate security impact. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 19 errata-xmlrpc 2018-10-30 07:43:04 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:3157 https://access.redhat.com/errata/RHSA-2018:3157

Comment 20 errata-xmlrpc 2018-11-13 08:35:07 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2018:3558 https://access.redhat.com/errata/RHSA-2018:3558

Comment 21 errata-xmlrpc 2019-06-18 19:09:04 UTC
This issue has been addressed in the following products:

  JBoss Core Services Apache HTTP Server 2.4.29 SP2

Via RHSA-2019:1543 https://access.redhat.com/errata/RHSA-2019:1543

Comment 23 errata-xmlrpc 2020-02-18 14:43:54 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

Via RHSA-2020:0544 https://access.redhat.com/errata/RHSA-2020:0544

Comment 24 errata-xmlrpc 2020-02-25 12:11:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.4 Telco Extended Update Support

Via RHSA-2020:0594 https://access.redhat.com/errata/RHSA-2020:0594