CVE-2021-32765Integer Overflow to Buffer Overflow in Hiredis
Hiredis is a minimalistic C client library for the Redis database. In affected versions Hiredis is vulnurable to integer overflow if provided maliciously crafted or corrupted `RESP` `mult-bulk` protocol data. When parsing `multi-bulk` (array-like) replies, hiredis fails to check if `count * sizeof(redisReply*)` can be represented in `SIZE_MAX`. If it can not, and the `calloc()` call doesn't itself make this check, it would result in a short allocation and subsequent buffer overflow. Users of hiredis who are unable to update may set the [maxelements](https://github.com/redis/hiredis#reader-max-array-elements) context option to a value small enough that no overflow is possible.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
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 |
|---|---|---|---|---|
| Ubuntu 26.04 | hiredis | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | hiredis | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | hiredis | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | hiredis | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | hiredis | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | hiredis | Fix pending | UBUNTU-CVE-2021-32765 | |
| Debian 14 | hiredis | Fixed | 0.14.1-2 | DEBIAN-CVE-2021-32765 |
| Debian 13 | hiredis | Fixed | 0.14.1-2 | DEBIAN-CVE-2021-32765 |
| Debian 12 | hiredis | Fixed | 0.14.1-2 | DEBIAN-CVE-2021-32765 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- redis hiredis: affected: < 1.0.1
Vendor advisories:
- https://security.gentoo.org/glsa/202210-32 (vendor-advisory)
References
- https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2
- https://github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e
- https://wiki.sei.cmu.edu/confluence/display/c/MEM07-C.+Ensure+that+the+arguments+to+calloc%28%29%2C+when+multiplied%2C+do+not+wrap
- https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html
- https://security.netapp.com/advisory/ntap-20211104-0003/
- https://security.gentoo.org/glsa/202210-32
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.