Bug 1515760 (CVE-2017-8817) - CVE-2017-8817 curl: FTP wildcard out of bounds read
Summary: CVE-2017-8817 curl: FTP wildcard out of bounds read
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2017-8817
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1518620 1518621 1518622 1526300
Blocks: 1515763
TreeView+ depends on / blocked
 
Reported: 2017-11-21 10:36 UTC by Adam Mariš
Modified: 2021-03-11 16:21 UTC (History)
19 users (show)

Fixed In Version: curl 7.57.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-03 14:48:42 UTC
Embargoed:


Attachments (Terms of Use)
Upstream patch (3.58 KB, patch)
2017-11-21 10:43 UTC, Adam Mariš
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3558 0 None None None 2018-11-13 08:35:12 UTC

Description Adam Mariš 2017-11-21 10:36:58 UTC
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

Comment 2 Adam Mariš 2017-11-21 10:43:41 UTC
Created attachment 1356600 [details]
Upstream patch

Comment 3 Adam Mariš 2017-11-21 10:46:20 UTC
Acknowledgments:

Name: the Curl project
Upstream: the OSS-Fuzz project

Comment 4 Adam Mariš 2017-11-21 10:47:12 UTC
Issue was introduced by commit:

https://github.com/curl/curl/commit/0825cd80a62c

Comment 5 Adam Mariš 2017-11-29 10:49:01 UTC
External References:

https://curl.haxx.se/docs/adv_2017-ae72.html

Comment 6 Adam Mariš 2017-11-29 10:52:23 UTC
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]

Comment 10 Tomas Hoger 2018-01-03 14:48:42 UTC
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.

Comment 11 errata-xmlrpc 2018-11-13 08:35:05 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


Note You need to log in before you can comment on or make changes to this bug.