Bug 1503705 (CVE-2017-1000257) - CVE-2017-1000257 curl: IMAP FETCH response out of bounds read
Summary: CVE-2017-1000257 curl: IMAP FETCH response out of bounds read
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2017-1000257
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: 1505232 1505233 1505234 1505284 1505285 1505301 1505302
Blocks: 1503707
TreeView+ depends on / blocked
 
Reported: 2017-10-18 14:55 UTC by Andrej Nemec
Modified: 2021-02-17 01:20 UTC (History)
35 users (show)

Fixed In Version: curl 7.56.1
Doc Type: If docs needed, set a value
Doc Text:
A buffer overrun flaw was found in the IMAP handler of libcurl. By tricking an unsuspecting user into connecting to a malicious IMAP server, an attacker could exploit this flaw to potentially cause information disclosure or crash the application.
Clone Of:
Environment:
Last Closed: 2019-06-08 03:29:41 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3263 0 normal SHIPPED_LIVE Moderate: curl security update 2017-11-27 19:51:12 UTC
Red Hat Product Errata RHSA-2018:2486 0 None None None 2018-08-16 16:09:26 UTC
Red Hat Product Errata RHSA-2018:3558 0 None None None 2018-11-13 08:34:55 UTC

Description Andrej Nemec 2017-10-18 14:55:49 UTC
An IMAP FETCH response line indicates the size of the returned data, in number
of bytes. When that response says the data is zero bytes, libcurl would pass
on that (non-existing) data with a pointer and the size (zero) to the
deliver-data function.

libcurl's deliver-data function treats zero as a magic number and invokes
strlen() on the data to figure out the length. The strlen() is called on a
heap based buffer that might not be zero terminated so libcurl might read
beyond the end of it into whatever memory lies after (or just crash) and then
deliver that to the application as if it was actually downloaded.

Introduced with:

https://github.com/curl/curl/commit/ec3bb8f727

External References:

https://curl.haxx.se/docs/adv_20171023.html

Comment 3 Andrej Nemec 2017-10-18 14:58:37 UTC
Mitigation:

Switch off IMAP in `CURLOPT_PROTOCOLS`

Comment 5 Adam Mariš 2017-10-19 10:55:06 UTC
Acknowledgments:

Name: the Curl project
Upstream: Brian Carpenter, the OSS-Fuzz project

Comment 6 Dhiru Kholia 2017-10-23 06:03:04 UTC
Created curl tracking bugs for this issue:

Affects: fedora-all [bug 1505233]


Created mingw-curl tracking bugs for this issue:

Affects: epel-7 [bug 1505232]
Affects: fedora-all [bug 1505234]

Comment 11 errata-xmlrpc 2017-11-27 14:51:44 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:3263 https://access.redhat.com/errata/RHSA-2017:3263

Comment 13 errata-xmlrpc 2018-08-16 16:09:13 UTC
This issue has been addressed in the following products:

  Red Hat JBoss Core Services

Via RHSA-2018:2486 https://access.redhat.com/errata/RHSA-2018:2486

Comment 14 errata-xmlrpc 2018-11-13 08:34:43 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.