ASA-2019-00306 – curl: TFTP receive buffer overflow


Allele Security Alert

ASA-2019-00306

Identifier(s)

ASA-2019-00306, CVE-2019-5436

Title

TFTP receive buffer overflow

Vendor(s)

the Curl project

Product(s)

curl

Affected version(s)

libcurl 7.19.4 to and including 7.64.1

Fixed version(s)

libcurl 7.65.0

Proof of concept

Unknown

Description

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.

Technical details

Unknown

Credits

l00p3r

Reference(s)

TFTP receive buffer overflow
https://curl.haxx.se/docs/CVE-2019-5436.html

– Chad Monroe provided the new CURLOPT_TFTP_BLKSIZE option that allows an app
https://github.com/curl/curl/commit/0516ce7786e95

tftp: use the current blksize for recvfrom()
https://github.com/curl/curl/commit/2576003415625d7b5f0e390902f8097830b82275

[SECURITY ADVISORY] curl: TFTP receive buffer overflow
https://seclists.org/oss-sec/2019/q2/124

CVE-2019-5436
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-5436

CVE-2019-5436
https://nvd.nist.gov/vuln/detail/CVE-2019-5436

If there is any error in this alert or you wish a comprehensive analysis, let us know.

Last modified: May 24, 2019

We are not responsible for any data loss, device corruption or any other type of issue due to the use of any information mentioned in our security alerts.