CVE-2021-36159
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.
What to do
Fixed builds are available from Alpine: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Alpine Linux 3.24 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.23 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.22 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.21 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.20 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.19 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.18 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.17 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.16 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.15 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.14 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.13 | apk-tools | Fixed | 2.12.6-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.12 | apk-tools | Fixed | 2.10.7-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.11 | apk-tools | Fixed | 2.10.7-r0 | ALPINE-CVE-2021-36159 |
| Alpine Linux 3.10 | apk-tools | Fixed | 2.10.7-r0 | ALPINE-CVE-2021-36159 |
References
- https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749
- https://github.com/freebsd/freebsd-src/commits/main/lib/libfetch
- https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cdev.kafka.apache.org%3E
- https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.org%3E
- https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.org%3E
- https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org%3E
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.