Every CVE Search/ Get API key

CVE-2021-36159

libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric...

9.1 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
None
Availability
High

Exploit likelihood

2.64%Up 2.0 points since Aug 4, 2021
90%50%10%1%

What each source reports

NVD Score used 9.1

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.

Record
CVE-2021-36159
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
CVSS 2.0
6.4 MediumAV:N/AC:L/Au:N/C:P/I:N/A:P
Weakness
CWE-125
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-36159
Updated
2026-11-02
EUVDEUVD-2021-22783 No score

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.

Record
EUVD-2021-22783
Updated
2026-11-03
GitHub AdvisoriesGHSA-cqp5-89fm-vp89 No score

libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric...

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.

Record
GHSA-cqp5-89fm-vp89
Weakness
CWE-125
Updated
2026-11-02
OSVALPINE-CVE-2021-36159 9.1

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.

Record
ALPINE-CVE-2021-36159
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVBELL-CVE-2021-36159 9.1

CVE-2021-36159 does not affect BellSoft software

Record
BELL-CVE-2021-36159
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSV 9.1

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.

Record
CVE-2021-36159
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
apk-tools
Alpine:v3.10
before 2.10.7-r0
2.10.7-r0
apk-tools
Alpine:v3.11
before 2.10.7-r0
2.10.7-r0
apk-tools
Alpine:v3.12
before 2.10.7-r0
2.10.7-r0
apk-tools
Alpine:v3.13
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.14
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.15
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.16
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.17
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.18
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.19
before 2.12.6-r0
2.12.6-r0
Show 5 moreShow less
Affected packages
PackageAffectedFixed
apk-tools
Alpine:v3.20
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.21
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.22
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.23
before 2.12.6-r0
2.12.6-r0
apk-tools
Alpine:v3.24
before 2.12.6-r0
2.12.6-r0

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-36159 is a critical vulnerability (CVSS 9.1) in Freebsd Libfetch, published August 3, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.64%, the 85th percentile. Fixed in apk-tools 2.10.7-r0.

References

Show 8 moreShow less
MoveEnter Open