curl / Docs / curl CVEs / HTTP authentication leak in redirects

CVE-2018-1000007

HTTP authentication leak in redirects

Project curl Security Advisory, January 24th 2018 - Permalink

VULNERABILITY

curl might leak authentication data to third parties.

When asked to send custom headers in its HTTP requests, curl sends 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 subsequent 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 curl-using client's request.

INFO

This bug has existed since before curl 6.0. It existed in the first commit we have recorded in the project.

The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2018-1000007 to this issue.

CWE-522: Insufficiently Protected Credentials

Severity: Low

AFFECTED VERSIONS

libcurl is used by many applications, but not always advertised as such.

SOLUTION

In curl version 7.58.0, custom Authorization: headers are limited the same way other such headers is controlled within curl: they are only sent to the host used in the original URL unless curl is told that it is OK to pass on to others using the CURLOPT_UNRESTRICTED_AUTH option.

NOTE: this solution creates a slight change in behavior. Users who actually want to pass on the header to other hosts now need to give curl that specific permission. You do this with --location-trusted with the curl command line tool.

RECOMMENDATIONS

We suggest you take one of the following actions immediately, in order of preference:

A - Upgrade curl to version 7.58.0

B - Apply the patch to your version and rebuild

C - Do not enable CURLOPT_FOLLOWLOCATION if you pass on custom Authorization headers

TIMELINE

It was reported to the curl project on January 18, 2018

We contacted distros@openwall on January 19.

curl 7.58.0 was released on January 24 2018, coordinated with the publication of this advisory.

CREDITS

Thanks a lot!