CVE DatabaseCVE-2022-0543
한국어 권고문 →
CVE-2022-054310.0/CRITICALCISA KEVCWE-862CWE-862

Redis Debian Packaging Defect Lua Sandbox Escape and Remote Code Execution (CVE-2022-0543) Analysis and Mitigation Guide

⚡ Jump to Patch
Affected Vendors
redis, debian, ubuntu
Affected Components
redis-server
Published Date
2022-02-18
CVSS v3.1
10.0
CRITICAL
EPSS (30d)
99.4%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Redis server instances installed via package managers (apt) on Debian, Ubuntu, and derived Linux distributions

Impact

Unauthenticated remote attackers can bypass the Lua scripting sandbox to execute arbitrary system commands with the privileges of the Redis process (CVSS 10.0, CISA KEV Listed)

Mitigation

Apply official OS package updates immediately, or disable EVAL/EVALSHA commands and restrict network access to localhost

Affected Products & Version Scope

Redis packages installed via apt on Debian Bullseye (11), Buster (10), Ubuntu 18.04, 20.04, 21.10, and other Debian-derived distributions

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

Update the Redis packages to the latest patched versions provided by Debian/Ubuntu security advisories.

bash
# Update package lists and upgrade Redis server and tools
sudo apt-get update
sudo apt-get --only-upgrade install redis-server redis-tools -y

# Restart the service and verify status
sudo systemctl restart redis-server
sudo systemctl status redis-server

2. Temporary Workaround & Hardening Configuration

If immediate patching is not feasible, disable the vulnerable EVAL and EVALSHA commands in the Redis configuration and restrict network exposure.

bash
# Append the following lines to /etc/redis/redis.conf
# 1. Disable vulnerable Lua execution commands
rename-command EVAL ''
rename-command EVALSHA ''

# 2. Bind to localhost and enable protected mode
bind 127.0.0.1 ::1
protected-mode yes

# Restart Redis to apply changes
sudo systemctl restart redis-server

3. Log Audit & IoC Verification Commands

Use the following commands to test for the vulnerability and inspect logs for potential exploitation attempts.

bash
# 1. Test vulnerability via Redis CLI (If command output is returned successfully, the system is vulnerable)
redis-cli EVAL "local io_l = package.loadlib('/usr/lib/x86_64-linux-gnu/liblua5.1.so.0', 'luaopen_io'); local io = io_l(); local f = io.popen('id', 'r'); local l = f:read('*a'); f:close(); return l" 0

# 2. Audit Redis logs for suspicious EVAL executions
sudo grep -i 'EVAL' /var/log/redis/redis-server.log
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
SentinelOne Singularity AI EDR
Immediately upgrade Redis packages via apt-get on all Debian/Ubuntu-based systems and ensure Redis is not exposed to the public internet.

Block Kernel Privilege Escalation & Ransomware Payloads Before You Can Reboot

Protect unpatched Windows, Linux, and macOS workloads against in-memory exploitation and lateral movement with autonomous EDR.

100% MITRE ATT&CK Detection · 1-Click Rollback

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2022-0543) is not a flaw in the upstream Redis source code, but rather a packaging issue specific to Debian and Ubuntu distributions. The Debian package maintainers integrated dynamic library support for the Redis Lua scripting environment by loading lua-bitop and lua-cjson modules. During this integration, the initialization process failed to properly sanitize and isolate the Lua environment, leaving the global package library exposed within the sandbox. This exposure allows the Lua engine to load arbitrary external shared libraries, breaking the sandbox boundary.

2. Exploitation Mechanics & Attack Scenario

An attacker establishes a connection to the target Redis server using the Redis Serialization Protocol (RESP) or redis-cli. By executing the EVAL command, the attacker injects a malicious Lua script. In a secure Redis environment, the Lua sandbox restricts access to OS-level functions like os.execute. However, due to this packaging flaw, the attacker can invoke package.loadlib to dynamically load the standard C library (libc.so.6). Once loaded, the attacker binds the system function and executes arbitrary shell commands under the context of the running Redis process.

3. Infrastructure & Business Impact

With a CVSS score of 10.0, this vulnerability is highly critical and has been actively exploited in the wild by botnets and cryptojacking campaigns, leading to its inclusion in the CISA KEV catalog. Even if Redis is deployed internally as a cache, attackers can leverage Server-Side Request Forgery (SSRF) or lateral movement to exploit this vulnerability, leading to full host compromise and potential lateral movement across the enterprise network.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2022-0543)

FAQ

Q1. How critical is CVE-2022-0543 and is it actively exploited in the wild?

CVE-2022-0543 is rated CVSS 10.0 (CRITICAL) with a 30-day EPSS exploitation probability of 99.4%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2022-0543?

Primary impacted vendors include redis, debian, ubuntu across redis-server. Scope summary: Redis packages installed via apt on Debian Bullseye (11), Buster (10), Ubuntu 18.04, 20.04, 21.10, and other Debian-derived distributions

Q3. What temporary mitigations or workarounds exist for CVE-2022-0543 before patching?

[Mitigation] Apply official OS package updates immediately, or disable EVAL/EVALSHA commands and restrict network access to localhost Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2022-0543

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (redis)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2022-0543 Redis Debian Packaging Defect Lua Sandbox Escape and Remote Code Execution (CVE-2022-0543) Analysis and Mitigation Guide (CVSS 10.0) - Patch & Workaround | CVE Pulse