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. - Affected versions: libcurl 7.21.0 to and including 7.56.1 - Not affected versions: libcurl < 7.21.0 and >= 7.57.0
Created attachment 1356600 [details] Upstream patch
Acknowledgments: Name: the Curl project Upstream: the OSS-Fuzz project
Issue was introduced by commit: https://github.com/curl/curl/commit/0825cd80a62c
External References: https://curl.haxx.se/docs/adv_2017-ae72.html
Created curl tracking bugs for this issue: Affects: fedora-all [bug 1518621] Created mingw-curl tracking bugs for this issue: Affects: epel-7 [bug 1518622] Affects: fedora-all [bug 1518620]
Upstream commit: https://github.com/curl/curl/commit/0b664ba968437715819bfe4c7ada5679d16ebbc3
It should be noted that the affected functionality - FTP wildcard file matching - is not enabled by default and must be enabled explicitly in applications using libcurl using the CURLOPT_WILDCARDMATCH option. The curl command line tool does not enable the feature or provide a way for user to enable it. The curl tool's globbing functionality controlled via the -g / --globoff option is unrelated to this FTP wildcard matching. The rare use of this functionality reduces the impact of this flaw.
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