Integer Overflow to Buffer Overflow in Hiredis
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-190 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Redis | hiredis | before 1.0.1 | 1.0.1 | Patch available | CNA |
- hiredis VendorRedis Affected before 1.0.1 Fixed in 1.0.1 Patch available CNA
CPE configurations NVD · 3
Remediation
- Fix · CNA hiredis (redis) Fixed in 1.0.1
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
Not affected: 2 products
- Red Hat Ansible Automation Platform 1.2
- Red Hat Ansible Tower 3
Timeline
- 2026-10-02 Threatist record created from CVE-2021-32765
References
Advisory 5
- https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2
- 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
- [debian-lts-announce] 20211012 [SECURITY] [DLA 2783-1] hiredis security update
- https://security.netapp.com/advisory/ntap-20211104-0003/
- GLSA-202210-32
Sources
- CVE-2021-32765 · CVE Program
- CVE-2021-32765 · NVD
- FIRST EPSS
- CVE-2021-32765 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences