CVE-2021-36159
JSON

9.1critical

libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols.

Severity
9.1critical CVSS:3.1 by NVD
Exploit likelihood
2.64% (higher than 85% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
freebsd libfetchbefore 2021-07-26NVD

All scores

NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
NVD6.4medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:P

Classification

What each source says

CVE List

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.

NVD (es)

libfetch versiones anteriores al 26-07-2021, como se usa en apk-tools, xbps, y otros productos, maneja inapropiadamente las cadenas numéricas para los protocolos FTP y HTTP. La implementación del modo pasivo de FTP permite una lectura fuera de límites porque strtol se usa para analizar los números relevantes en bytes de dirección. No comprueba si la línea termina prematuramente. Si lo hace, la condición para bucle comprueba el terminador "\0" un byte demasiado tarde

References

Sources

SourceRecordLicence
CVE ListCVE-2021-36159 changed 2024-08-04CVE Terms of Use
NVDCVE-2021-36159 changed 2026-06-17Public domain