{"id":"CVE-2021-32765","published":"2021-10-04T00:00:00Z","modified":"2024-08-03T23:33:55Z","title":"Integer Overflow to Buffer Overflow in Hiredis","vendor":"redis","product":"hiredis","tier":"tail","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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02055,"percentile":0.81415,"provenance":"source"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"},{"id":"CWE-680","name":"Integer Overflow to Buffer Overflow"}],"references":[{"url":"https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2","tags":[]},{"url":"https://github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e","tags":[]},{"url":"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","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html","tags":["mailing-list"]},{"url":"https://security.netapp.com/advisory/ntap-20211104-0003/","tags":[]},{"url":"https://security.gentoo.org/glsa/202210-32","tags":["vendor-advisory"]}],"priority":{"score":22.4,"factors":[{"name":"EPSS percentile","points":16.28},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"redis","affectedVersions":[{"vendor":"redis","product":"hiredis","versions":["< 1.0.1"]}],"euvd":{"id":"EUVD-2021-19533","exploited":false,"provenance":"source"}}