# CVE-2021-36159

- Priority: **Prioritise**
- Reason: Public exploit (reference, Date unknown)
- Next step: Check applicability: affected before 2021-07-26 (CNA); fix release not confirmed
- Status: published
- Published: 2021-08-03 · Modified: 2024-08-04
- Aliases: ALPINE-CVE-2021-36159
- Record: https://cvemate.com/vulnerability/CVE-2021-36159 · JSON: https://cvemate.com/vulnerability/CVE-2021-36159/json

## Description

```text
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.
```

## Signals

- CVSS: 9.1 critical (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
- EPSS: 2.637%, percentile 86.065%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (reference)

## Affected

- alpine apk-tools (Alpine Linux): \< 2.10.7-r0 \| \< 2.12.6-r0
- freebsd libfetch: \< 2021-07-26

## 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>
- <https://security.alpinelinux.org/vuln/CVE-2021-36159>

---

Data as of 2026-12-05T11:40:40.326Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
