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 package | Versions | Reported 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.6 | CVE List, NVD |
| fedoraproject fedora | 33, 34, 35 | NVD |
| netapp management_services_for_element_software | Not specified | NVD |
| netapp management_services_for_netapp_hci | Not specified | NVD |
| debian debian_linux | 10.0, 11.0 | NVD |
| oracle communications_operations_monitor | 4.3, 4.4, 5.0 | NVD |
| 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.6 | Bitnami 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.6 | Bitnami 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.6 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 6.5medium CVSS:2.0 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
| Bitnami Vulnerability Database | high 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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-32626 changed 2024-08-03 | CVE Terms of Use |
| NVD | CVE-2021-32626 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-KEYDB-2021-32626 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-REDIS-2021-32626 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-VALKEY-2021-32626 changed 2026-07-08 | Apache-2.0 |