CVE-2021-21309: Integer overflow on 32-bit systems

Published Feb 22, 2021
·
Updated

An integer overflow was found in Redis. Redis 4.0 or newer uses a configurable limit for the maximum supported bulk input size. The default size is 512MB which is a safe value for all platforms. Authenticated Redis users could increase the bulk input size by changing the "proto-max-bulk-len" configuration parameter, leading to heap corruption and potentially remote code execution.

Other sources

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.

Reference: https://groups.google.com/g/redis-db/c/fV7cI3GSgoQ/m/ocwV-MlzAgAJ

Red Hat

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 Software

5 affected componentsFixes available
redhat/redis<5.0.11
5.0.11
redhat/redis<6.0.11
6.0.11
redhat/redis<6.2
6.2
Redislabs Redis>=4.0<5.0.11
Redislabs Redis>=6.0.0<6.0.11

Remediation

Information

As recommended in the upstream advisory, this issue can be mitigated by preventing 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.

Event History

Feb 22, 2021
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 26, 2021
CVE Published
via MITRE·09:50 PM
Data Sourced
via MITRE·09:50 PM
DescriptionSeverityWeakness

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-21309?

CVE-2021-21309 is an integer overflow vulnerability found in Redis versions 4.0 or newer.

2

How can the CVE-2021-21309 vulnerability be exploited?

The CVE-2021-21309 vulnerability can be exploited to corrupt the heap and potentially result in remote code execution.

3

Which versions of Redis are affected by CVE-2021-21309?

Redis versions 4.0 or newer are affected by CVE-2021-21309.

4

What is the severity of CVE-2021-21309?

CVE-2021-21309 has a severity rating of 8.8 (high).

5

How do I fix the CVE-2021-21309 vulnerability?

To fix the CVE-2021-21309 vulnerability, update Redis to version 5.0.11 if using version 5.0.x, or update to version 6.0.11 if using version 6.0.x. Alternatively, update to version 6.2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203