First published: Tue Aug 03 2021(Updated: )
libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols. The FTP passive mode implementation allows an out-of-bounds read because strtol is used to parse the relevant numbers into address bytes. It does not check if the line ends prematurely. If it does, the for-loop condition checks for the '\0' terminator one byte too late.
Credit: cve@mitre.org
Affected Software | Affected Version | How to fix |
---|---|---|
Freebsd Libfetch | <2021-07-26 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2021-36159 is a vulnerability that affects libfetch, a library used in apk-tools, xbps, and other products. It mishandles numeric strings for the FTP and HTTP protocols, leading to an out-of-bounds read.
CVE-2021-36159 affects apk-tools, xbps, and other products that use libfetch before version 2021-07-26.
CVE-2021-36159 has a severity rating of 9.1 (Critical).
CVE-2021-36159 exploits the FTP passive mode implementation by using strtol to parse numeric strings into address bytes, which can lead to an out-of-bounds read.
You can find more information about CVE-2021-36159 on the following references: [GitHub](https://github.com/freebsd/freebsd-src/commits/main/lib/libfetch), [GitLab](https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749), and [Apache Mailing List](https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc@%3Cdev.kafka.apache.org%3E).