Bug 1597101 (CVE-2018-0500)

Summary: CVE-2018-0500 curl: Heap-based buffer overflow in Curl_smtp_escape_eob() when uploading data over SMTP
Product: [Other] Security Response Reporter: Sam Fowler <sfowler>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, bodavis, csutherl, dbaker, dbhole, gzaronik, hhorak, jclere, john.j5live, jokerman, jorton, kanderso, kdudka, lgao, luhliari, mbabacek, mturk, myarboro, omajid, paul, rschiron, rwagner, security-response-team, sfowler, sthangav, trankin, twalsh, weli
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: curl 7.61.0 Doc Type: If docs needed, set a value
Doc Text:
A heap-based buffer overflow has been found in the Curl_smtp_escape_eob() function of curl. An attacker could exploit this by convincing a user to use curl to upload data over SMTP with a reduced buffer to cause a crash or corrupt memory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-11 22:59:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1600081, 1600082    
Bug Blocks: 1597103    
Attachments:
Description Flags
Upstream patch none

Description Sam Fowler 2018-07-02 04:06:15 UTC
curl versions 7.54.1 through 7.60.0 are vulnerable to a heap-based buffer overflow in the Curl_smtp_escape_eob() function when uploading data over SMTP and using a reduced read buffer. An attacker could exploit this by convincing a user to use curl to upload data over SMTP with a reduced buffer to cause a crash or corrupt memory.

Comment 2 Sam Fowler 2018-07-02 04:13:34 UTC
Flaw introduced by:

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

Comment 3 Sam Fowler 2018-07-03 01:08:04 UTC
Created attachment 1456079 [details]
Upstream patch

Comment 4 Adam Mariš 2018-07-04 11:27:41 UTC
Acknowledgments:

Name: the Curl project
Upstream: Peter Wu

Comment 13 Riccardo Schirone 2018-07-05 13:26:24 UTC
Even though some versions shipped in RHEL and in RHSCL 3 provide the option to reduce the read buffer, they are not vulnerable to this flaw because they do not use the buffer size value to allocate the scratch buffer in Curl_smtp_escape_eob.

Comment 14 Riccardo Schirone 2018-07-05 13:26:41 UTC
Statement:

This issue did not affect the versions of curl/libcurl as shipped with Red Hat Enterprise Linux 5, 6 and 7 as they did not include the vulnerable code.

This issue did not affect the versions of curl/libcurl as shipped with Red Hat Software Collections 3 as they did not include the vulnerable code.

Comment 15 Riccardo Schirone 2018-07-11 10:07:21 UTC
Patch:
https://github.com/curl/curl/commit/ba1dbd78e5f1e

Comment 16 Riccardo Schirone 2018-07-11 10:09:53 UTC
External References:

https://curl.haxx.se/docs/adv_2018-70a2.html

Comment 17 Riccardo Schirone 2018-07-11 11:39:18 UTC
Created curl tracking bugs for this issue:

Affects: fedora-all [bug 1600081]

Comment 19 errata-xmlrpc 2018-08-16 16:09:15 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