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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.23 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.22 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.21 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.20 | apk-tools | 2.12.6-r0 | — |
Show 10 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.18 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.17 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.16 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.15 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.14 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.13 | apk-tools | 2.12.6-r0 | — |
| Alpine v3.12 | apk-tools | 2.10.7-r0 | — |
| Alpine v3.11 | apk-tools | 2.10.7-r0 | — |
| Alpine v3.10 | apk-tools | 2.10.7-r0 | — |
References
- https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749
- https://github.com/freebsd/freebsd-src/commits/main/lib/libfetch
- [kafka-dev] 20210831 Security vulnerabilities in kafka:2.13-2.6.0/2.7.0 docker image mailing-list
- [kafka-users] 20210831 Security vulnerabilities in kafka:2.13-2.6.0/2.7.0 docker image mailing-list
- [kafka-users] 20210901 Re: [EXTERNAL] Re: Security vulnerabilities in kafka:2.13-2.6.0/2.7.0 docker image mailing-list
- [kafka-dev] 20210901 Re: [EXTERNAL] Re: Security vulnerabilities in kafka:2.13-2.6.0/2.7.0 docker image mailing-list