Bug 1191331 (CVE-2021-32765) - VUL-0: CVE-2021-32765: hiredis: integer overflow if provided maliciously crafted or corrupted `RESP` `mult-bulk` protocol data
Summary: VUL-0: CVE-2021-32765: hiredis: integer overflow if provided maliciously craf...
Status: RESOLVED FIXED
Alias: CVE-2021-32765
Product: openSUSE Distribution
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Leap 15.3
Hardware: Other Other
: P3 - Medium : Major (vote)
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/311708/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-05 12:23 UTC by Alexander Bergmann
Modified: 2023-01-02 14:58 UTC (History)
1 user (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bergmann 2021-10-05 12:23:08 UTC
CVE-2021-32765

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.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-32765
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32765
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
Comment 1 Andreas Stieger 2021-10-07 08:13:01 UTC
https://build.opensuse.org/request/show/923651
Comment 3 Paul Fee 2021-11-23 18:22:12 UTC
Fixed in hiredis v1.0.2, which is available for openSUSE Tumbleweed.

Leap 15.3 ships with hiredis 0.13.3, the fix is not available for that version of hiredis.

The server:database repo contains hiredis 1.0.2 built for Leap 15.2.
https://software.opensuse.org/package/hiredis
Comment 4 Andreas Stieger 2021-11-23 21:22:37 UTC
(In reply to Paul Fee from comment #3)
> Leap 15.3 ships with hiredis 0.13.3, the fix is not available for that
> version of hiredis.

This is not in line with our security maintenance policy. Create a backport against 0.13.3. Do not close the issue but re-assign to security-team@suse.de when you are done. Set a needinfo request on them if unable.

Here is the debian backport to help you get started:

https://lists.debian.org/debian-lts-announce/2021/10/msg00007.html
https://salsa.debian.org/lamby/pkg-hiredis/-/commit/e210141d449659042f00fad71e8bef7caea53c67
Comment 5 Andreas Stieger 2021-11-23 21:41:06 UTC
proposed maintenance update:
https://build.opensuse.org/request/show/933345

Paul please review and accept the review on the request. Then re-assign bug to security-team@suse.de for processing.
Comment 6 OBSbugzilla Bot 2021-11-23 23:40:06 UTC
This is an autogenerated message for OBS integration:
This bug (1191331) was mentioned in
https://build.opensuse.org/request/show/933347 15.2+Backports:SLE-15-SP3 / hiredis
Comment 7 Paul Fee 2021-11-24 20:35:29 UTC
https://build.opensuse.org/request/show/933347 Accepted.
Assigning to security-team@suse.de as requested by Andreas.
Comment 8 Swamp Workflow Management 2021-12-06 17:42:55 UTC
openSUSE-SU-2021:1536-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1191331
CVE References: CVE-2021-32765
JIRA References: 
Sources used:
openSUSE Leap 15.2 (src):    hiredis-0.13.3-lp152.4.3.1
openSUSE Backports SLE-15-SP3 (src):    hiredis-0.13.3-bp153.2.3.1
Comment 9 Swamp Workflow Management 2021-12-09 20:17:14 UTC
openSUSE-SU-2021:1550-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1191331
CVE References: CVE-2021-32765
JIRA References: 
Sources used:
openSUSE Backports SLE-15-SP2 (src):    hiredis-0.13.3-bp152.4.3.1
Comment 10 Andreas Stieger 2023-01-02 14:58:43 UTC
done