CVEfocus › CVE database › CVE-2021-32765

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

CVSS 8.8 HighEPSS 2.1% (higher than 82% of CVEs)Published 2021-10-04Updated 2024-08-03Assigner: GitHub_M

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.

CWE-190CWE-680

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

3Fixed
1Fix pending
5Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04hiredisNot affected
vulnerable_code_not_present
Ubuntu 25.10hiredisNot affected
vulnerable_code_not_present
Ubuntu 24.04hiredisNot affected
vulnerable_code_not_present
Ubuntu 22.04hiredisNot affected
vulnerable_code_not_present
Ubuntu 20.04hiredisNot affected
vulnerable_code_not_present
Ubuntu 16.04hiredisFix pendingUBUNTU-CVE-2021-32765
Debian 14hiredisFixed0.14.1-2DEBIAN-CVE-2021-32765
Debian 13hiredisFixed0.14.1-2DEBIAN-CVE-2021-32765
Debian 12hiredisFixed0.14.1-2DEBIAN-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.

Vendor advisories:

References

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.