libcurl Out-of-Bounds Memory Read Error in FTP Wildcard Function Lets Remote Users Redirect the Target Client to an Arbitrary Site
SecurityTracker Alert ID: 1039897|
SecurityTracker URL: http://securitytracker.com/id/1039897
(Links to External Site)
Date: Nov 30 2017
Disclosure of system information, Modification of system information|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): 7.21.0 - 7.56.1|
A vulnerability was reported in libcurl. A remote user may be able to redirect the target client to an arbitrary site.|
A remote server can return specially crafted data to trigger an out-of-bounds memory read error in the FTP wildcard matching function (CURLOPT_WILDCARDMATCH) and cause the target connected libcurl client to be redirected.
libcurl applications that use HTTP or HTTPS URLs, allow libcurl redirects, and has FTP wildcards enabled are affected.
The vendor was notified on November 10, 2017.
The OSS-Fuzz project reported reported this vulnerability.
A remote user may be able to redirect the target client to an arbitrary site.|
The vendor has issued a fix (7.57.0).|
The vendor advisory is available at:
Vendor URL: curl.haxx.se/docs/adv_2017-ae72.html (Links to External Site)
|Underlying OS: Linux (Any), UNIX (Any), Windows (Any)|
This archive entry has one or more follow-up message(s) listed below.|
Source Message Contents
Subject: [oss-security] [SECURITY ADVISORY] curl: FTP wildcard out of bounds read|
FTP wildcard out of bounds read
Project curl Security Advisory, November 29th 2017 -
libcurl contains a read out of bounds flaw in the FTP wildcard function.
libcurl's FTP wildcard matching feature, which is enabled with the
`CURLOPT_WILDCARDMATCH` option can use a built-in wildcard function or a user
provided one. The built-in wildcard function has a flaw that makes it not
detect the end of the pattern string if it ends with an open bracket (`[`) but
instead it will continue reading the heap beyond the end of the URL buffer
that holds the wildcard.
For applications that use HTTP(S) URLs, allow libcurl to handle redirects and
have FTP wildcards enabled, this flaw can be triggered by malicious servers
that can redirect clients to a URL using such a wildcard pattern.
We are not aware of any exploit of this flaw.
This bug was introduced in commit
[0825cd80a62c](https://github.com/curl/curl/commit/0825cd80a62c), May 2010.
The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2017-8817 to this issue.
- Affected versions: libcurl 7.21.0 to and including 7.56.1
- Not affected versions: libcurl < 7.21.0 and >= 7.57.0
curl is used by many applications, but not always advertised as such.
In libcurl version 7.57.0, there's a better check for the end of the
string. Additionally, the wildcard feature is turned off if the URL passed to
libcurl is not using FTP(S), so a redirect to an FTP URL cannot trigger
A [patch for CVE-2017-8817](https://curl.haxx.se/CVE-2017-8817.patch) is
We suggest you take one of the following actions immediately, in order of
A - Upgrade curl to version 7.57.0
B - Apply the patch to your version and rebuild
C - Do not use `CURLOPT_WILDCARDMATCH` without carfully verifying the
It was reported to the curl project on November 10, 2017. We contacted
distros@openwall on November 21.
curl 7.57.10 was released on November 29 2017, coordinated with the
publication of this advisory.
Reported by OSS-Fuzz. Researched by Max Dymond. Patch by Daniel Stenberg.
Thanks a lot!