CVE-2021-32626
JSON

7.5high

Lua scripts can overflow the heap-based Lua stack in Redis

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
15.6% (higher than 96% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
BIT-KEYDB-2021-32626BIT-REDIS-2021-32626BIT-VALKEY-2021-32626GHSA-p486-xggp-782c

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

Product or packageVersionsReported by
redis redis>= 6.2.0, < 6.2.6, >= 6.0.0, < 6.0.16, >= 2.6.0, < 5.0.14, from 2.6 before 5.0.14, from 6.0.0 before 6.0.16, from 6.2.0 before 6.2.6CVE List, NVD
fedoraproject fedora33, 34, 35NVD
netapp management_services_for_element_softwareNot specifiedNVD
netapp management_services_for_netapp_hciNot specifiedNVD
debian debian_linux10.0, 11.0NVD
oracle communications_operations_monitor4.3, 4.4, 5.0NVD
keydb (Bitnami)from 2.6.0 before 5.0.14, from 6.0.0 before 6.0.16, from 6.2.0 before 6.2.6Bitnami Vulnerability Database
redis (Bitnami)from 2.6.0 before 5.0.14, from 6.0.0 before 6.0.16, from 6.2.0 before 6.2.6Bitnami Vulnerability Database
valkey (Bitnami)from 2.6.0 before 5.0.14, from 6.0.0 before 6.0.16, from 6.2.0 before 6.2.6Bitnami Vulnerability Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD6.5medium CVSS:2.0AV:N/AC:L/Au:S/C:P/I:P/A:P
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

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.

NVD (es)

Redis es una base de datos en memoria de código abierto que persiste en el disco. En las versiones afectadas, los scripts de Lua especialmente diseñados que se ejecutan en Redis pueden causar el desbordamiento de la pila de Lua en la región heap de la memoria, debido a las comprobaciones incompletas de esta condición. Esto puede resultar en una corrupción de la pila y potencialmente en una ejecución de código remota . Este problema se presenta en todas las versiones de Redis con soporte para scripts Lua, a partir de la 2.6. El problema es corregido en las versiones 6.2.6, 6.0.16 y 5.0.14. Para usuarios que no puedan actualizar una solución adicional para mitigar el problema sin parchear el ejecutable del servidor Redis es evitar que los usuarios ejecuten scripts Lua. Esto puede hacerse usando ACL para restringir los comandos EVAL y EVALSHA

References

https://github.com/redis/redis/security/advisories/GHSA-p486-xggp-782cadvisory, third-party-advisory, web
https://github.com/redis/redis/commit/666ed7facf4524bf6d19b11b20faa2cf93fdf591advisory, patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VL5KXFN3ATM7IIM7Q4O4PWTSRGZ5744Z/vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HTYQ5ZF37HNGTZWVNJD3VXP7I6MEEF42/vendor-advisory, web
https://lists.apache.org/thread.html/r75490c61c2cb7b6ae2c81238fd52ae13636c60435abcd732d41531a0%40%3Ccommits.druid.apache.org%3Emailing-list, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WR5WKJWXD4D6S3DJCZ56V74ESLTDQRAB/vendor-advisory, web
https://www.debian.org/security/2021/dsa-5001advisory, third-party-advisory, vendor-advisory, web
https://www.oracle.com/security-alerts/cpuapr2022.htmladvisory, patch, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20211104-0003/advisory, third-party-advisory, web
https://security.gentoo.org/glsa/202209-17advisory, third-party-advisory, vendor-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2021-32626web

Sources

SourceRecordLicence
CVE ListCVE-2021-32626 changed 2024-08-03CVE Terms of Use
NVDCVE-2021-32626 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-KEYDB-2021-32626 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-REDIS-2021-32626 changed 2026-09-08Apache-2.0
Bitnami Vulnerability DatabaseBIT-VALKEY-2021-32626 changed 2026-07-08Apache-2.0