CVE-2021-32765
Integer 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 context option to a value small enough that no overflow is possible.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.8
Integer 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 context option to a value small enough that no overflow is possible.
- Record
CVE-2021-32765- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-190, CWE-680
- Updated
- 2026-11-02
EUVDEUVD-2021-19533
8.8
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 context option to a value small enough that no overflow is possible.
- Record
EUVD-2021-19533- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
NVD
8.8
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 context option to a value small enough that no overflow is possible.
- Record
CVE-2021-32765- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.5 Medium
AV:N/AC:L/Au:S/C:P/I:P/A:P - Weakness
- CWE-190, CWE-680
- Updated
- 2026-11-02
OSV
8.8
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 context option to a value small enough that no overflow is possible.
- Record
CVE-2021-32765- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-32765
8.8
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 context option to a value small enough that no overflow is possible.
- Record
DEBIAN-CVE-2021-32765- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVOESA-2021-1390
8.8
hiredis security update
Hiredis is a minimalistic C client library for the Redis database. It is minimalistic because it just adds minimal support for the protocol, but at the same time it uses a high level printf-alike API in order to make it much higher level than otherwise suggested by its minimal code base and the lack of explicit bindings for every Redis command.
Security Fix(es):
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 context option to a value small enough that no overflow is possible.(CVE-2021-32765)
- Record
OESA-2021-1390- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVUBUNTU-CVE-2021-32765
8.8
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 context option to a value small enough that no overflow is possible.
- Record
UBUNTU-CVE-2021-32765- CVSS 3.1
- 8.8 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2021-0562 No score
Updated hiredis packages fix security vulnerability
Updated hiredis packages fix security vulnerability:
It was discovered that there was an integer-overflow vulnerability in hiredis, a C client library for communicating with Redis databases. This occurred within the handling and parsing of 'multi-bulk' replies (CVE-2021-32765).
- Record
MGASA-2021-0562- Updated
- 2026-11-02
OSVopenSUSE-SU-2021:1536-1 No score
Security update for hiredis
This update for hiredis fixes the following issues:
- CVE-2021-32765: Fix integer/buffer (boo#1191331)
- Record
openSUSE-SU-2021:1536-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2021:1550-1 No score
Security update for hiredis
This update for hiredis fixes the following issues:
- CVE-2021-32765: Fix integer/buffer (boo#1191331)
This update was imported from the openSUSE:Leap:15.2:Update update project.
- Record
openSUSE-SU-2021:1550-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11561-1 No score
hiredis-1.0.2-1.1 on GA media
These are all security issues fixed in the hiredis-1.0.2-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11561-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
hiredisDebian:12 |
before 0.14.1-2 | 0.14.1-2 |
hiredisDebian:13 |
before 0.14.1-2 | 0.14.1-2 |
hiredisDebian:14 |
before 0.14.1-2 | 0.14.1-2 |
hiredisMageia:8 |
before 0.13.3-6.1.mga8 | 0.13.3-6.1.mga8 |
hiredisopenEuler:20.03-LTS-SP1 |
before 1.0.2-1.oe1 | 1.0.2-1.oe1 |
hiredisopenEuler:20.03-LTS-SP2 |
before 1.0.2-1.oe1 | 1.0.2-1.oe1 |
hiredisUbuntu:16.04:LTS |
All versions, plus listed versions 0.13.1-20.13.3-10.13.3-2 |
None known |
hiredisSUSE:Package Hub 15 SP3 |
before 0.13.3-bp153.2.3.1 | 0.13.3-bp153.2.3.1 |
hiredisopenSUSE:Leap 15.2 |
before 0.13.3-bp153.2.3.1 | 0.13.3-bp153.2.3.1 |
hiredisopenSUSE:Leap 15.3 |
before 0.13.3-bp153.2.3.1 | 0.13.3-bp153.2.3.1 |
hiredisSUSE:Package Hub 15 SP2 |
before 0.13.3-bp152.4.3.1 | 0.13.3-bp152.4.3.1 |
hiredisopenSUSE:Tumbleweed |
before 1.0.2-1.1 | 1.0.2-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-32765 is a high vulnerability (CVSS 8.8) in Redis Hiredis, published October 4, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.05%, the 81st percentile. Fixed in hiredis 0.14.1-2.
References
github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2
github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e
wiki.sei.cmu.edu/confluence/display/c/MEM07-C.+Ensure+that+the+arguments+to+calloc%28%29%2C+when+multiplied%2C+do+not+wrap
lists.debian.org/debian-lts-announce/2021/10/msg00007.html
security.netapp.com/advisory/ntap-20211104-0003
security.gentoo.org/glsa/202210-32
Show 12 moreShow less
security-tracker.debian.org/tracker/CVE-2021-32765
advisories.mageia.org/MGASA-2021-0562.html
bugs.mageia.org/show_bug.cgi?id=29549
debian.org/lts/security/2021/dla-2783
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2021-1390
nvd.nist.gov/vuln/detail/CVE-2021-32765
ubuntu.com/security/CVE-2021-32765
cve.org/CVERecord?id=CVE-2021-32765
lists.opensuse.org/archives/list/[email protected]/thread/A2J7PHNSWD2ZHOSNIVUJTW2HJ34RJDBG
bugzilla.suse.com/1191331
suse.com/security/cve/CVE-2021-32765
lists.opensuse.org/archives/list/[email protected]/thread/4GSAQE3UZIYGFDEEFR46DV63XWSGJDN3