CVE-2021-32765
Integer Overflow to Buffer Overflow in Hiredis
Reported by github_m · Published October 4, 2021
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| hiredis | Arch Linux | 1.0.1-1 |
| hiredis | redis | 1.0.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| redis | hiredis | < 1.0.1 |
| arch | hiredis | 0 |
| redis | hiredis | 0 |
Timeline
- Oct 4, 2021 CVE Published
- Oct 5, 2021 EPSS Score (30 in total, the first dated here)
- Aug 3, 2024 CVE Updated
- Mar 10, 2026 Security Advisory (3 in total, the first dated here)
- Aug 1, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-32765
vulnetix vdb fixes CVE-2021-32765
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-32765/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- [debian-lts-announce] 20211012 [SECURITY] [DLA 2783-1] hiredis security update mailing-list
- GLSA-202210-32 vendor-advisory