CVE-2021-36159

libfetch: an out of boundary read while libfetch uses strtol to parse the relevant numbers into address bytes leads to information leak or crash

Published Aug 3, 2021 CVSS 3.1 · 9.1 Critical EPSS 2.6% KEV · Not listed
Description
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2021-22783 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.
Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Aug 4, 2024, 12:47 AM
Reserved
Jul 5, 2021, 12:00 AM
Status
Modified
Published
Aug 3, 2021, 2:15 PM
Modified
Jun 17, 2026, 3:58 AM
Severity
Important
Public date
Aug 3, 2021, 12:00 AM