Skip to content
OpenAdvisories
Medium · 5.4 CVE-2021-21309 EUVD-2021-8663

Integer overflow on 32-bit systems

Published Feb 26, 2021 · Updated Aug 3, 2024 · Assigned by GitHub_M

Description

Redis is an open-source, in-memory database that persists on disk. In affected versions of Redis an integer overflow bug in 32-bit Redis version 4.0 or newer could be exploited to corrupt the heap and potentially result with remote code execution. Redis 4.0 or newer uses a configurable limit for the maximum supported bulk input size. By default, it is 512MB which is a safe value for all platforms. If the limit is significantly increased, receiving a large request from a client may trigger several integer overflow scenarios, which would result with buffer overflow and heap corruption. We believe this could in certain conditions be exploited for remote code execution. By default, authenticated Redis users have access to all configuration parameters and can therefore use the “CONFIG SET proto-max-bulk-len” to change the safe default, making the system vulnerable. **This problem only affects 32-bit Redis (on a 32-bit system, or as a 32-bit executable running on a 64-bit system).** The problem is fixed in version 6.2, and the fix is back ported to 6.0.11 and 5.0.11. Make sure you use one of these versions if you are running 32-bit Redis. An additional workaround to mitigate the problem without patching the redis-server executable is to prevent clients from directly executing `CONFIG SET`: Using Redis 6.0 or newer, ACL configuration can be used to block the command. Using older versions, the `rename-command` configuration directive can be used to rename the command to a random string unknown to users, rendering it inaccessible. Please note that this workaround may have an additional impact on users or operational systems that expect `CONFIG SET` to behave in certain ways.

Affected products

VendorProductAffectedFixed
redis redis < 5.0.11, >= 6.0.0, < 6.0.11 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 redis 5:6.0.11-1 —
Debian 13 redis 5:6.0.11-1 —
Debian 12 redis 5:6.0.11-1 —
Debian 9 redis 3:3.2.6-3+deb9u4 DLA-2576-1
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS redis 5:5.0.7-2ubuntu0.1+esm1 USN-5221-1
Ubuntu Pro 18.04 LTS redis 5:4.0.9-1ubuntu0.2+esm3 USN-5221-1
Ubuntu Pro 16.04 LTS redis 2:3.0.6-1ubuntu0.4+esm1 USN-5221-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 14.04 LTS redis 2:2.8.4-2ubuntu0.2+esm2 USN-5221-1
ReleasePackageFixed inAdvisory
SLES 15 SP3 redis 6.0.13-1.10.1 SUSE-SU-2021:1652-1
SLES 15 SP2 redis 6.0.13-1.10.1 SUSE-SU-2021:1652-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed redis 6.2.5-1.2 openSUSE-SU-2024:11299-1
openSUSE Leap 15.2 redis 6.0.13-lp152.2.3.1 openSUSE-SU-2021:0682-1
ReleasePackageFixed inAdvisory
Alpine v3.24 redis 6.2.0-r0 —
Alpine v3.23 redis 6.2.0-r0 —
Alpine v3.22 redis 6.2.0-r0 —
Alpine v3.21 redis 6.2.0-r0 —
Alpine v3.20 redis 6.2.0-r0 —
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 redis 6.2.0-r0 —
Alpine v3.18 redis 6.2.0-r0 —
Alpine v3.17 redis 6.2.0-r0 —
Alpine v3.16 redis 6.2.0-r0 —
Alpine v3.15 redis 6.2.0-r0 —
Alpine v3.14 redis 6.2.0-r0 —
Alpine v3.13 redis 6.0.11-r0 —
Alpine v3.12 redis 5.0.11-r0 —
Alpine v3.11 redis 5.0.11-r0 —
Alpine v3.10 redis 5.0.11-r0 —

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) redis 5.0.5-7 —

Advisories 5

References