Bug 1710620 (CVE-2019-5436)

Summary: CVE-2019-5436 curl: TFTP receive heap buffer overflow in tftp_receive_packet() function
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: andrew.slice, bodavis, csutherl, dbhole, gzaronik, hhorak, jclere, john.j5live, jorton, kanderso, kdudka, lgao, luhliari, mbabacek, msekleta, mturk, myarboro, omajid, paul, rwagner, security-response-team, twalsh, weli
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: curl 7.65.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 22:34: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: 1711839, 1711840, 1711841, 1712840, 1829562    
Bug Blocks: 1710621    

Description Pedro Sampaio 2019-05-15 21:07:45 UTC
libcurl contains a heap buffer overflow in the function (`tftp_receive_packet()`) that recevives data from a TFTP server. It calls `recvfrom()` with the default size for the buffer rather than with the size that was used to allocate it. Thus, the content that might overwrite the heap memory is entirely controlled by the server.

Upstream patch:

https://curl.haxx.se/0001-tftp-use-the-current-blksize-for-recvfrom.patch

References:

https://curl.haxx.se/docs/CVE-2019-5436.html

Comment 2 Huzaifa S. Sidhpurwala 2019-05-20 05:57:46 UTC
libcurl contains a heap buffer overflow in the function (`tftp_receive_packet()`) that recevives data from a TFTP server. It calls `recvfrom()` with the default size for the buffer rather than with the size that was used to allocate it. Thus, the content that might overwrite the heap
memory is entirely controlled by the server.

The flaw exists if the user selects to use a "blksize" of 504 or smaller (default is 512). The smaller size that is used, the larger the possible
overflow becomes.

Users chosing a smaller size than default should be rare as the primary use case for changing the size is to make it larger.

It is rare for users to use TFTP across the Internet. It is most commonly used within local networks.

Comment 4 Huzaifa S. Sidhpurwala 2019-05-20 08:41:32 UTC
Acknowledgments:

Name: the Curl project
Upstream: l00p3r

Comment 6 Dhananjay Arunesh 2019-05-22 11:01:21 UTC
Created curl tracking bugs for this issue:

Affects: fedora-all [bug 1712840]

Comment 8 errata-xmlrpc 2020-03-31 19:12:05 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1020 https://access.redhat.com/errata/RHSA-2020:1020

Comment 9 Product Security DevOps Team 2020-03-31 22:34:12 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-5436

Comment 10 errata-xmlrpc 2020-04-28 15:53:05 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:1792 https://access.redhat.com/errata/RHSA-2020:1792

Comment 13 Huzaifa S. Sidhpurwala 2020-05-04 03:05:56 UTC
External References:

https://curl.haxx.se/docs/CVE-2019-5436.html

Comment 14 Huzaifa S. Sidhpurwala 2020-05-04 03:09:59 UTC
Statement:

This flaw exists if the user selects to use a "blksize" of 504 or smaller (default is 512). The smaller size that is used, the larger the possible overflow becomes.
Users choosing a smaller size than default should be rare as the primary use case for changing the size is to make it larger. It is rare for users to use TFTP across the Internet. It is most commonly used within local networks.

Comment 15 errata-xmlrpc 2020-06-10 17:05:55 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.7 Extended Update Support

Via RHSA-2020:2505 https://access.redhat.com/errata/RHSA-2020:2505