{"id":"CVE-2021-32626","published":"2021-10-04T17:30:11Z","modified":"2024-08-03T23:25:30Z","title":"Lua scripts can overflow the heap-based Lua stack in Redis","vendor":"redis","product":"redis","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.15601,"percentile":0.96915,"provenance":"source"},"cwes":[{"id":"CWE-122","name":"Heap-based Buffer Overflow"},{"id":"CWE-787","name":"Out-of-bounds Write"}],"references":[{"url":"https://github.com/redis/redis/security/advisories/GHSA-p486-xggp-782c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/redis/redis/commit/666ed7facf4524bf6d19b11b20faa2cf93fdf591","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VL5KXFN3ATM7IIM7Q4O4PWTSRGZ5744Z/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HTYQ5ZF37HNGTZWVNJD3VXP7I6MEEF42/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.apache.org/thread.html/r75490c61c2cb7b6ae2c81238fd52ae13636c60435abcd732d41531a0%40%3Ccommits.druid.apache.org%3E","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WR5WKJWXD4D6S3DJCZ56V74ESLTDQRAB/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://www.debian.org/security/2021/dsa-5001","tags":["vendor-advisory","x_refsource_DEBIAN"]},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20211104-0003/","tags":["x_refsource_CONFIRM"]},{"url":"https://security.gentoo.org/glsa/202209-17","tags":["vendor-advisory","x_refsource_GENTOO"]}],"priority":{"score":24.6,"factors":[{"name":"EPSS percentile","points":19.38},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"redis","affectedVersions":[{"vendor":"redis","product":"redis","versions":[">= 6.2.0, < 6.2.6",">= 6.0.0, < 6.0.16",">= 2.6.0, < 5.0.14"]}],"summary":{"text":"The flaw is a heap-based Lua stack overflow in Redis, caused by incomplete bounds checking when Redis executes Lua scripts, and it affects Redis versions with Lua scripting support. An attacker who can get specially crafted Lua scripts run inside Redis, which requires network access and low-privilege authentication, could corrupt the heap and potentially achieve remote code execution, with attack complexity noted as high.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:36:22Z"},"euvd":{"id":"EUVD-2021-19457","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-redis-cve-2021-32626","children":[{"from":"CVE-2021-32626","to":"CVE-2021-32672","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/scripting.c"],"commits":["https://github.com/redis/redis/commit/666ed7facf4524bf6d19b11b20faa2cf93fdf591","https://github.com/redis/redis/commit/6ac3c0b7abd35f37201ed2d6298ecef4ea1ae1dd"],"basis":"rarely changed file"}]}]}}