What is Redis?
Redis is an open-source, in-memory data structure store widely used as a cache, message broker, and session store. Its Lua scripting capability (via EVAL/EVALSHA commands) allows operators to run server-side scripts atomically. Redis is deployed across millions of web applications, microservices, and cloud workloads — making it a high-value pivot point for attackers.
Overview
CVE-2022-0543 is a Debian- and Ubuntu-specific Lua sandbox escape that allows any Redis client with command execution access to break out of the scripting sandbox and execute arbitrary OS commands on the host. The vulnerability arises from a packaging quirk unique to Debian-derived distributions and carries a CVSS score of 10.0 (network, no auth, scope changed). Active exploitation in the wild prompted CISA to add it to the KEV catalog in March 2022.
Affected Versions
| Package | Vulnerable | Fixed |
|---|---|---|
| Redis (Debian/Ubuntu packages) | All versions before Debian-specific patch | redis / redis-server packages updated 2022-02-18 |
| Redis (upstream, non-Debian) | Not affected | N/A — issue is Debian-specific |
Technical Details
The root cause lies in how Debian packages Redis as a dynamically linked binary against the system liblua5.1 shared library, rather than embedding Lua statically as upstream Redis does. When Redis loads Lua for script execution, the dynamically linked liblua exposes the package global — including package.loadlib() — which is absent in upstream Redis's embedded Lua build.
package.loadlib() allows loading arbitrary shared libraries from the filesystem with loadlib(path, init_func). An attacker can use this to load any .so file and call its exported functions, effectively running arbitrary C code with the privileges of the Redis process.
The exploit pattern:
local io_l = package.loadlib("/usr/lib/x86_64-linux-gnu/liblua5.1.so.0", "luaopen_io")
local io = io_l()
io.popen("id"):read("*all")
Prerequisites: The attacker must be able to execute Redis EVAL or EVALSHA commands. This requires either (a) an unauthenticated Redis instance (common — Redis historically shipped with no authentication by default), or (b) a compromised Redis password/ACL entry.
Discovery
The vulnerability was discovered by Reginaldo Silva and disclosed via the Debian bug tracker in February 2022. Debian and Ubuntu issued security advisories and patched packages promptly.
Exploitation Context
Redis instances exposed to the internet without authentication are common. Scanning tools like Shodan regularly index tens of thousands of open Redis instances. Once an attacker finds an open Redis server on a Debian-based system, this vulnerability enables immediate privilege escalation to OS-level code execution with no further steps.
Exploitation chains seen in the wild include:
- Cryptomining malware planted via Redis command injection
- Persistence via authorized_keys writes (a long-standing Redis attack technique)
- Lateral movement using Redis as a springboard into internal networks
Remediation
- Patch immediately: Update to the patched
redisorredis-serverpackage on Debian/Ubuntu viaapt update && apt upgrade redis-server. - Enable authentication: Set a strong password via
requirepassinredis.confor use Redis ACLs (Redis 6+). - Bind to localhost: In
redis.conf, setbind 127.0.0.1to prevent external network access unless required. - Use protected mode: Ensure
protected-mode yesis set (default in modern Redis; prevents access from non-loopback IPs without authentication). - Firewall Redis ports: Restrict access to port 6379 (and 16379 for cluster) via firewall rules to trusted hosts only.
- Review running processes: If compromise is suspected, check for unauthorized cron jobs, new user accounts, and unfamiliar processes spawned from the Redis user.
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2022-0543 |
| Vendor / Product | Redis — Debian-specific Redis Servers |
| NVD Published | 2022-02-18 |
| NVD Last Modified | 2025-11-10 |
| CVSS 3.1 Score | 10 |
| CVSS 3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| Severity | CRITICAL |
| CWE | CWE-862 find similar ↗ |
| CISA KEV Added | 2022-03-28 |
| CISA KEV Deadline | 2022-04-18 |
| Known Ransomware Use | No |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2022-02-18 | CVE published |
| 2022-02-18 | Debian security advisory issued |
| 2022-03-28 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2022-04-18 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| NVD — CVE-2022-0543 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |
| Debian Bug Report #1005787 | Vendor Advisory |
| Redis Lua Sandbox Escape PoC | Security Research |