Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 29 Nov 2017 10:34:22 +0100 (CET)
From: Daniel Stenberg <>
To: curl security announcements -- curl users <>,,
        libcurl hacking <>,
Subject: [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](, 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
wildcard functionality.

A [patch for CVE-2017-8817]( 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
      patterns used.


It was reported to the curl project on November 10, 2017.  We contacted
distros@...nwall 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!



Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.