curl / Docs / curl CVEs / TFTP receive buffer overflow
Awarded 200 USD

CVE-2019-5436

TFTP receive buffer overflow

Project curl Security Advisory, May 22 2019 - Permalink

VULNERABILITY

libcurl contains a heap buffer overflow in the function (tftp_receive_packet()) that receives 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 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.

INFO

The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2019-5436 to this issue.

CWE-122: Heap-based Buffer Overflow

Severity: Low

AFFECTED VERSIONS

libcurl is used by many applications, but not always advertised as such.

SOLUTION

RECOMMENDATIONS

We suggest you take one of the following actions immediately, in order of preference:

A - Upgrade curl to version 7.65.0

B - Apply the patch to your version and rebuild

C - do not use TFTP with curl

TIMELINE

The issue was reported to the curl project on April 29, 2019. The patch was communicated to the reporter on April 29, 2019. We contacted distros@openwall on May 15.

curl 7.65.0 was released on May 22 2019, coordinated with the publication of this advisory.

CREDITS

Thanks a lot!