{"id":"CVE-2021-32765","state":"PUBLISHED","title":"Integer Overflow to Buffer Overflow in Hiredis","description":"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.","publishedAt":"2021-10-04T00:00:00.000Z","updatedAt":"2024-08-03T23:33:55.893Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"GitHub_M"},"assigner":"GitHub_M","products":["redis hiredis"],"affected":[{"vendor":"redis","product":"hiredis","versions":[{"version":"< 1.0.1","status":"affected"}]}],"references":["https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2","https://github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e","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","https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html","https://security.netapp.com/advisory/ntap-20211104-0003/","https://security.gentoo.org/glsa/202210-32"],"weaknesses":["CWE-190","CWE-680"],"ingestedAt":"2026-10-29T19:48:33.225Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/32xxx/CVE-2021-32765.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2021-32765","state":"PUBLISHED","datePublished":"2021-10-04T00:00:00.000Z","dateUpdated":"2024-08-03T23:33:55.893Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2021-05-12T00:00:00.000Z"},"containers":{"cna":{"title":"Integer Overflow to Buffer Overflow in Hiredis","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"redis","product":"hiredis","versions":[{"version":"< 1.0.1","status":"affected"}]}],"references":[{"url":"https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2"},{"url":"https://github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e"},{"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"},{"url":"https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html","name":"[debian-lts-announce] 20211012 [SECURITY] [DLA 2783-1] hiredis security update","tags":["mailing-list"]},{"url":"https://security.netapp.com/advisory/ntap-20211104-0003/"},{"url":"https://security.gentoo.org/glsa/202210-32","name":"GLSA-202210-32","tags":["vendor-advisory"]}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseScore":8.8,"baseSeverity":"HIGH"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-190","type":"CWE","lang":"en","description":"CWE-190: Integer Overflow or Wraparound"}]},{"descriptions":[{"cweId":"CWE-680","type":"CWE","lang":"en","description":"CWE-680: Integer Overflow to Buffer Overflow"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2022-10-31T00:00:00.000Z"},"source":{"advisory":"GHSA-hfm9-39pp-55p2","discovery":"UNKNOWN"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://github.com/redis/hiredis/security/advisories/GHSA-hfm9-39pp-55p2","tags":["x_transferred"]},{"url":"https://github.com/redis/hiredis/commit/76a7b10005c70babee357a7d0f2becf28ec7ed1e","tags":["x_transferred"]},{"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":["x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html","name":"[debian-lts-announce] 20211012 [SECURITY] [DLA 2783-1] hiredis security update","tags":["mailing-list","x_transferred"]},{"url":"https://security.netapp.com/advisory/ntap-20211104-0003/","tags":["x_transferred"]},{"url":"https://security.gentoo.org/glsa/202210-32","name":"GLSA-202210-32","tags":["vendor-advisory","x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-03T23:33:55.893Z"}}]}}}