Vulnerability · Published Oct 4, 2021 · Assigned by GitHub_M

CVE-2021-32626Lua scripts can overflow the heap-based Lua stack in Redis

High 7.5

In plain English

A high-severity heap buffer overflow in redis from redis. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 16.2% (higher than 97% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)16.2%top 3.0% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

Redis is an open source, in-memory database that persists on disk. In affected versions specially crafted Lua scripts executing in Redis can cause the heap-based Lua stack to be overflowed, due to incomplete checks for this condition. This can result with heap corruption and potentially remote code execution. This problem exists in all versions of Redis with Lua scripting support, starting from 2.6. The problem is fixed in versions 6.2.6, 6.0.16 and 5.0.14. For users unable to update an additional workaround to mitigate the problem without patching the redis-server executable is to prevent users from executing Lua scripts. This can be done using ACL to restrict EVAL and EVALSHA commands.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8redis5.0.3-5.module_el8.4.0+2583+b9845322ALSA-2021:3918
AlmaLinux:8redis5.0.3-5.module_el8.5.0+66+fc19ec12ALSA-2021:3918
AlmaLinux:8redis6.0.9-5.module_el8.5.0+67+a3c431d9ALSA-2021:3945
AlmaLinux:8redis6.0.9-5.module_el8.4.0+2584+1bb0d2aaALSA-2021:3945
AlmaLinux:8redis-devel6.0.9-5.module_el8.4.0+2584+1bb0d2aaALSA-2021:3945
AlmaLinux:8redis-devel6.0.9-5.module_el8.5.0+67+a3c431d9ALSA-2021:3945
AlmaLinux:8redis-devel5.0.3-5.module_el8.5.0+66+fc19ec12ALSA-2021:3918
AlmaLinux:8redis-devel5.0.3-5.module_el8.4.0+2583+b9845322ALSA-2021:3918
AlmaLinux:8redis-doc5.0.3-5.module_el8.4.0+2583+b9845322ALSA-2021:3918
AlmaLinux:8redis-doc6.0.9-5.module_el8.4.0+2584+1bb0d2aaALSA-2021:3945
Alpine:v3.20redis6.2.6-r0ALPINE-CVE-2021-32626
Alpine:v3.21redis6.2.6-r0ALPINE-CVE-2021-32626
Alpine:v3.22redis6.2.6-r0ALPINE-CVE-2021-32626
Alpine:v3.23redis6.2.6-r0ALPINE-CVE-2021-32626
Alpine:v3.24redis6.2.6-r0ALPINE-CVE-2021-32626
Debian:12redis5:6.0.16-1DEBIAN-CVE-2021-32626
Debian:13redis5:6.0.16-1DEBIAN-CVE-2021-32626
Debian:14redis5:6.0.16-1DEBIAN-CVE-2021-32626
Rocky Linux:8redis0:6.0.9-5.module+el8.4.0+660+a8447b97RLSA-2021:3945
Rocky Linux:8redis0:6.0.9-5.module+el8.5.0+658+72172854RLSA-2021:3945
Rocky Linux:8redis0:5.0.3-5.module+el8.4.0+659+cf535ef1RLSA-2021:3918
Rocky Linux:8redis0:5.0.3-5.module+el8.5.0+657+2674830eRLSA-2021:3918

Affected products (as reported)

VendorProductVersions
redis redis >= 6.2.0, < 6.2.6>= 6.0.0, < 6.0.16>= 2.6.0, < 5.0.14

Weakness: CWE-122, CWE-787 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

References