CVE-2024-46981 Redis' Lua library commands may lead to remote code execution

High 7.0 Published Updated

An authenticated user can execute remote code by exploiting a use-after-free vulnerability in Redis Lua script handling.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-46981?

CVE-2024-46981 is a high-severity use after free vulnerability in Debian Debian Linux, published on 6 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

Redis is an open source, in-memory database that persists on disk. An authenticated user may use a specially crafted Lua script to manipulate the garbage collector and potentially lead to remote code execution. The problem is fixed in 7.4.2, 7.2.7, and 6.2.17. 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.

Weakness: CWE-416

Which versions are affected by CVE-2024-46981?

3 open source packages ship an affected version, including keydb, redis and valkey. It affects 2 products.

PackageAffectedFixed in
keydb BitnamiAll versions6.3.4
redis BitnamiAll versions6.2.17, 7.2.8, 7.4.2
valkey BitnamiAll versions8.0.2
Linux distribution packages (37)
redis Red Hat:rhel_aus:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-debuginfo Red Hat:rhel_aus:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-debugsource Red Hat:rhel_aus:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-devel Red Hat:rhel_aus:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-doc Red Hat:rhel_aus:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis Red Hat:rhel_aus:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-debuginfo Red Hat:rhel_aus:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-debugsource Red Hat:rhel_aus:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-devel Red Hat:rhel_aus:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-doc Red Hat:rhel_aus:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis Red Hat:rhel_e4s:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-debuginfo Red Hat:rhel_e4s:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-debugsource Red Hat:rhel_e4s:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-devel Red Hat:rhel_e4s:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis-doc Red Hat:rhel_e4s:8.4::appstreamAll versions0:6.0.9-5.module+el8.4.0+22739+cf3cc450.1
redis Red Hat:rhel_e4s:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-debuginfo Red Hat:rhel_e4s:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-debugsource Red Hat:rhel_e4s:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-devel Red Hat:rhel_e4s:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis-doc Red Hat:rhel_e4s:8.6::appstreamAll versions0:6.0.9-5.module+el8.6.0+22735+5bedcf81.1
redis Red Hat:rhel_e4s:9.0::appstreamAll versions0:6.2.6-1.el9_0.1
redis-debuginfo Red Hat:rhel_e4s:9.0::appstreamAll versions0:6.2.6-1.el9_0.1
redis-debugsource Red Hat:rhel_e4s:9.0::appstreamAll versions0:6.2.6-1.el9_0.1
redis-devel Red Hat:rhel_e4s:9.0::appstreamAll versions0:6.2.6-1.el9_0.1
redis-doc Red Hat:rhel_e4s:9.0::appstreamAll versions0:6.2.6-1.el9_0.1
redis Red Hat:rhel_eus:8.8::appstreamAll versions0:6.2.7-1.module+el8.8.0+22725+e1c935f8.1
redis-debuginfo Red Hat:rhel_eus:8.8::appstreamAll versions0:6.2.7-1.module+el8.8.0+22725+e1c935f8.1
redis-debugsource Red Hat:rhel_eus:8.8::appstreamAll versions0:6.2.7-1.module+el8.8.0+22725+e1c935f8.1
redis-devel Red Hat:rhel_eus:8.8::appstreamAll versions0:6.2.7-1.module+el8.8.0+22725+e1c935f8.1
redis-doc Red Hat:rhel_eus:8.8::appstreamAll versions0:6.2.7-1.module+el8.8.0+22725+e1c935f8.1
redis Red Hat:rhel_eus:9.2::appstreamAll versions0:6.2.7-1.el9_2.1
redis-debuginfo Red Hat:rhel_eus:9.2::appstreamAll versions0:6.2.7-1.el9_2.1
redis-debugsource Red Hat:rhel_eus:9.2::appstreamAll versions0:6.2.7-1.el9_2.1
redis-devel Red Hat:rhel_eus:9.2::appstreamAll versions0:6.2.7-1.el9_2.1
redis-doc Red Hat:rhel_eus:9.2::appstreamAll versions0:6.2.7-1.el9_2.1
redis Red Hat:rhel_eus:9.4::appstreamAll versions0:6.2.7-1.el9_4.1
redis Red Hat:rhel_eus:9.4::appstreamAll versions0:7.0.12-1.module+el9.4.0+22724+5f7cf862.2

Products include Debian Debian Linux, Redis Redis.

How do I fix CVE-2024-46981?

Upgrade keydb to 6.3.4 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2024-46981 being exploited?

There is no known exploitation of CVE-2024-46981 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2024-46981, AZL-54969, AZL-55286, BELL-CVE-2024-46981, BIT-keydb-2024-46981, BIT-redis-2024-46981 and 16 more.

Is CVE-2024-46981 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free