# CVE-2021-32765: Integer Overflow to Buffer Overflow in Hiredis

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2021-10-04 · Modified: 2024-08-03
- Aliases: MGASA-2021-0562, openSUSE-SU-2021:1536-1, openSUSE-SU-2021:1550-1, UBUNTU-CVE-2021-32765, DEBIAN-CVE-2021-32765, openSUSE-SU-2024:11561-1
- Record: https://cvemate.com/vulnerability/CVE-2021-32765 · JSON: https://cvemate.com/vulnerability/CVE-2021-32765/json

## Description

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

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.055%, percentile 81.935%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian hiredis (Debian): \< 0.14.1-2
- ubuntu hiredis (Ubuntu): All versions (No fix recorded)
- debian debian\_linux: 9.0
- mageia hiredis (Mageia): \< 0.13.3-6.1.mga8
- netapp management\_services\_for\_element\_software\_and\_netapp\_hci: na
- redis hiredis: \< 1.0.1
- opensuse hiredis&distro=openSUSE Leap 15.2 (openSUSE): \< 0.13.3-bp153.2.3.1
- opensuse hiredis&distro=openSUSE Leap 15.3 (openSUSE): \< 0.13.3-bp153.2.3.1
- opensuse hiredis&distro=openSUSE Tumbleweed (openSUSE): \< 1.0.2-1.1
- suse hiredis&distro=SUSE Package Hub 15 SP2 (SUSE Linux Enterprise): \< 0.13.3-bp152.4.3.1
- suse hiredis&distro=SUSE Package Hub 15 SP3 (SUSE Linux Enterprise): \< 0.13.3-bp153.2.3.1

## 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>
- <https://advisories.mageia.org/MGASA-2021-0562.html>
- <https://bugs.mageia.org/show_bug.cgi?id=29549>
- <https://www.debian.org/lts/security/2021/dla-2783>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/A2J7PHNSWD2ZHOSNIVUJTW2HJ34RJDBG/>
- <https://bugzilla.suse.com/1191331>
- <https://www.suse.com/security/cve/CVE-2021-32765>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/4GSAQE3UZIYGFDEEFR46DV63XWSGJDN3/>
- <https://ubuntu.com/security/CVE-2021-32765>
- <https://www.cve.org/CVERecord?id=CVE-2021-32765>
- <https://security-tracker.debian.org/tracker/CVE-2021-32765>

---

Data as of 2026-12-05T08:49:50.227Z. 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
