Vulnerabilities / CVE-2021-36159

critical

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 Modified CWE 125
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Red Hat9.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by Red Hat (high).

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 packages and fixed versions

SourcePackageFixed in
alpine 3.10apk-tools2.10.7-r0
alpine 3.11apk-tools2.10.7-r0
alpine 3.12apk-tools2.10.7-r0
alpine 3.13apk-tools2.12.6-r0
alpine 3.14apk-tools2.12.6-r0
alpine 3.15apk-tools2.12.6-r0
alpine 3.16apk-tools2.12.6-r0
alpine 3.17apk-tools2.12.6-r0
alpine 3.18apk-tools2.12.6-r0
alpine 3.19apk-tools2.12.6-r0
alpine 3.20apk-tools2.12.6-r0
alpine 3.21apk-tools2.12.6-r0
Show all 16 entries from 16 sources
SourcePackageFixed in
alpine 3.10apk-tools2.10.7-r0
alpine 3.11apk-tools2.10.7-r0
alpine 3.12apk-tools2.10.7-r0
alpine 3.13apk-tools2.12.6-r0
alpine 3.14apk-tools2.12.6-r0
alpine 3.15apk-tools2.12.6-r0
alpine 3.16apk-tools2.12.6-r0
alpine 3.17apk-tools2.12.6-r0
alpine 3.18apk-tools2.12.6-r0
alpine 3.19apk-tools2.12.6-r0
alpine 3.20apk-tools2.12.6-r0
alpine 3.21apk-tools2.12.6-r0
alpine 3.22apk-tools2.12.6-r0
alpine 3.23apk-tools2.12.6-r0
alpine 3.24apk-tools2.12.6-r0
alpine edgeapk-tools2.12.6-r0

References

All 9 references

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.