Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2022-0543: Redis Lua Sandbox Escape in Debian and Ubuntu Packages

Published Feb 18, 2022 · Updated 9 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS10.0Critical · v3.1
EPSS85.6%100th percentile
CISA KEVYesAdded Mar 28, 2022
In the wildActivePer CISA KEV
Vendor
Redis
IdentifiersCVE-2022-0543CWE-94

CVE-2022-0543 is a Lua sandbox escape vulnerability caused by a packaging issue in certain Debian Redis packages and derived distributions, including Ubuntu. Affected packages dynamically link Redis's Lua interpreter against the system Lua library and leave the Lua package variable accessible within the scripting sandbox. An attacker able to execute Lua scripts through Redis EVAL can load otherwise restricted Lua functionality, including io.popen, and execute arbitrary operating-system commands with the privileges of the Redis process. The flaw is specific to affected distribution packaging rather than all Redis installations.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation compromises the confidentiality, integrity, and availability of resources accessible to the Redis service account. Attackers can execute commands, access or modify data, deploy malware, and disrupt services. P2PInfect has exploited the vulnerability for initial access and enrollment of compromised systems into its peer-to-peer botnet. Host-level impact depends on the Redis process's privileges and any container or operating-system isolation; exploitation does not inherently grant root privileges or escape a container.

Mitigation

If you can’t patch tonight, do this now.

Remove direct internet exposure and restrict Redis connectivity to trusted clients using firewall rules and, where applicable, Kubernetes network policies. Enforce authentication and least-privilege command access, restricting Lua scripting commands such as EVAL for clients that do not require them. Run Redis with minimal operating-system privileges and retain container isolation to limit impact. Monitor for Redis spawning shells or command-execution utilities and for unexpected outbound connections. These controls reduce exposure but do not replace installing corrected packages.

Remediation

Patch, then assume compromise.

Install the distribution-maintained Redis security update that fixes CVE-2022-0543, including updates to affected container images, and restart or redeploy Redis using the corrected packages. Verify the distribution package revision rather than relying only on the upstream Redis version, because the vulnerability originates in packaging. Specific fixed package versions are not available in the supplied vulnerability details.

Public exploits

Exploits

9 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
redis_debian_sandbox_escape.rbThis repository contains a single Metasploit module, 'redis_debian_sandbox_escape.rb', which exploits CVE-2022-0543—a Lua sandbox escape vulnerability in Debian/Ubuntu Redis packages. The exploit leverages insufficiently sanitized Lua environments to load arbitrary libraries and execute commands as the 'redis' user. The module supports both command execution and payload delivery (reverse shell or Meterpreter) on x86_64 Linux systems running vulnerable Redis versions (4.x to <6.1). It can authenticate to Redis if required and uses the default Redis port (6379). The exploit is operational, providing remote code execution, and is best used with stageless payloads due to systemd-imposed memory restrictions. The repository is structured as a single Ruby file within the Metasploit framework, with clear references to the CVE, affected products, and exploitation methodology.Disclosed Feb 18, 2022 · Framework: metasploit · ruby · networkWeaponizedCVE-2022-0543This repository contains a Python exploit script (CVE-2022-0543.py) targeting Redis servers vulnerable to CVE-2022-0543, a Lua sandbox escape vulnerability. The exploit connects to a specified Redis server (IP, port, and optional password), then allows the user to execute arbitrary shell commands on the server by injecting a malicious Lua script that loads the system's Lua IO library and uses it to run shell commands. The output of the command is returned and displayed to the user. The exploit is interactive, prompting the user for connection details and commands to execute. The README provides a brief description and usage instructions. The main fingerprintable endpoint is the file path to the Lua library used for the exploit. The attack vector is network-based, requiring access to the Redis server. The repository is straightforward, with one exploit script and a README.0x7eTeam · Disclosed Mar 16, 2022 · python · networkOperationalCVE-2022-0543This repository contains a Go-based exploit for CVE-2022-0543, a Redis Lua sandbox escape vulnerability. The main file, CVE-2022-0543.go, implements an interactive command shell that connects to a Redis server (default 127.0.0.1:6379, configurable via command-line flags), authenticates if necessary, and leverages a Lua payload to escape the sandbox and execute arbitrary system commands on the server. The exploit uses the Lua 'package.loadlib' function to load the system's Lua IO library and then runs attacker-supplied commands via 'io.popen', returning the output. The README provides usage instructions and a disclaimer. The exploit targets vulnerable Redis instances accessible over the network and requires knowledge of any authentication credentials if set. The repository is structured simply, with one Go exploit file and a README.z92g · Disclosed Jul 6, 2022 · go · networkOperationalCVE-2022-0543This repository contains a fully featured exploit for CVE-2022-0543, a critical Lua sandbox escape vulnerability in Redis. The main file, 'exploit.py', is a Python script that connects to a target Redis instance (defaulting to 127.0.0.1:6379) and leverages the vulnerability to execute arbitrary shell commands on the server. The exploit supports three main modes: (1) automatic reverse shell to an attacker-controlled host and port, (2) execution of a single specified command, and (3) an interactive shell for running arbitrary commands. The exploit works by injecting a Lua script that loads the system's Lua shared library and uses it to break out of the sandbox, allowing shell command execution. The script requires the target Redis server to be accessible and, if authentication is enabled, valid credentials must be provided. The repository also includes a README with usage instructions and a LICENSE file. No hardcoded external endpoints are present, but the exploit targets the Redis TCP service and the system's Lua library path.JacobEbben · Disclosed Sep 1, 2022 · python · networkOperationalCVE-2022-0543The repository contains three files: exploit.py, a standalone Python 3 exploit; README.md, documenting its modes and warning about false positives; and an MIT LICENSE. It targets CVE-2022-0543 by submitting Lua through Redis EVAL, loading the native Lua I/O library, and using io.popen to execute commands outside the sandbox. Exploitation runs with the Redis process's privileges and does not inherently grant root access. The script accepts a target address and port, optional username/password, a single command, reverse-shell callback settings, and a check flag. Every mode first executes whoami. Successful nonempty output is treated as evidence of vulnerability. Default mode provides a local command-entry loop, not a persistent remote terminal; reverse-shell mode launches interactive Bash over TCP. No persistence, file upload, fixed external command-and-control server, or exploit-framework integration is present. Important limitations include the hardcoded x86-64 Linux library path, unescaped insertion of commands into a Lua string, ASCII-only output decoding, and limited error handling. The initial connection-success message precedes the first actual Redis request because connection establishment is lazy. Check mode still performs real command execution. The code is a genuine exploit implementation, but successful operation was not independently tested. No repository URL, revision, or archive size was supplied; empty strings and zero represent unavailable repository metadata.fulxey · Disclosed Sep 5, 2022 · python · networkOperationalCVE-2022-0543Small standalone Python exploit repository for CVE-2022-0543 targeting Redis Lua sandbox escape. The repository contains only three files: an MIT LICENSE, a short README describing features, and the main exploit script exploit.py. The Python script uses the redis client library to connect to a target Redis server, optionally authenticate, and invoke EVAL with a crafted Lua payload. That payload calls package.loadlib on /usr/lib/x86_64-linux-gnu/liblua5.1.so.0, obtains the io library, and uses io.popen to execute arbitrary operating system commands on the Redis host. The exploit first performs a lightweight validation by running whoami and checking for output, then supports three operational modes: check-only (-c), single command execution (-x), and an interactive command loop. It also includes an automatic reverse shell mode using bash over /dev/tcp with attacker-supplied callback IP and port (-I/-P). The exploit is operational rather than a mere PoC because it includes working post-exploitation options, but it is not framework-based or heavily modularized. Fingerprintable indicators include the target Redis service on TCP 6379, the hardcoded Lua library path used for sandbox escape, and the reverse-shell callback mechanism.OpsCipher · Disclosed Sep 5, 2022 · python · markdown · network · webOperationalredisHackThis repository contains a Python script (redisHack.py) designed to detect and exploit vulnerabilities in Redis servers. The script provides two main capabilities: (1) it checks for unauthenticated access to Redis and attempts to brute-force authentication using a list of common weak passwords (pass.txt), and (2) it exploits CVE-2022-0543, a Lua sandbox escape vulnerability in Redis, to execute arbitrary shell commands on the server. The script interacts with the target over the network, requiring the attacker to specify the target IP and port. The payload for CVE-2022-0543 is a Lua script that loads the io library and executes attacker-supplied shell commands. The repository structure is simple, consisting of the main exploit script, a password list, and a README file describing its usage. The exploit is operational, providing real exploitation capabilities for vulnerable Redis instances.SiennaSkies · Disclosed May 10, 2023 · python · networkOperationalCVE-2022-0543Repository contains a single Python exploit script and a README. The Python file is the main entry point and implements both detection and exploitation for CVE-2022-0543, a Redis Lua sandbox escape affecting Debian/Ubuntu-packaged Redis. The script can expand single hosts or CIDR ranges, load targets from a file, scan them concurrently, and identify vulnerable Redis instances by sending a Lua EVAL probe that checks whether package.loadlib is exposed inside the Lua environment. If exploitation parameters are provided, it starts a local TCP listener, generates a Lua payload that loads the io library from a supplied shared library path, and executes a bash reverse shell using io.popen and /dev/tcp redirection. It then waits for the callback and provides an interactive shell session. The exploit is operational rather than just a PoC because it includes a working reverse-shell payload, listener management, and interactive post-exploitation handling. No external C2 infrastructure or hardcoded victim IPs are present; endpoints are operator-supplied target Redis hosts and attacker callback host/port.K3ysTr0K3R · Disclosed Jun 19, 2026 · markdown · python · networkOperationalvulhub-redis-cve-2022-0543This is a deliberately vulnerable Redis training environment with a valid, manually invoked CVE-2022-0543 exploit embedded in app/README.md and its Chinese translation, rather than a standalone exploit executable. The Lua payload loads luaopen_io from liblua through the exposed package global, runs id with io.popen, and returns stdout through EVAL. The flaw is specific to vulnerable distribution packaging, not every Redis 5.0.7 build. Execution inherits Redis process privileges and does not itself escape the container. The 31-file repository contains vendored Vulhub walkthroughs and Compose configuration under app/, an Ubuntu focal Redis package Dockerfile under base/, an authoritative Isoloom lab specification, five shell check scripts, seven Terraform configurations, one Ruby Vagrantfile, generated Docker/Kubernetes deployments, CTF metadata, provenance documentation, and GitHub validation/publication workflows. The code_files count of 14 covers standalone shell, Terraform, Ruby, and Dockerfile sources; Lua is embedded in Markdown and YAML deployment/workflow files are excluded from that count. Isoloom orchestrates the lab and is not an exploit framework. checks/redis.sh verifies unauthenticated INFO server output reporting Redis 5.0.7. Generated checks verify TCP reachability and blocked Internet access, but do not execute the exploit or establish that package.loadlib remains exposed. Docker uses a route-removal sidecar for isolation; Kubernetes uses egress NetworkPolicies, which require an enforcing network plugin. The original app Compose file publishes Redis without a loopback restriction, whereas generated local Docker defaults to loopback. Cloud deployments restrict inbound SSH and Redis access to allowed_cidr. Kubernetes exposes a LoadBalancer with Redis ingress permitted from all IPv4 sources, so external exposure deserves particular care. No reverse shell, persistence mechanism, fixed attacker callback, or automated secret-retrieval code is present. Destructive-looking commands in CI and Vagrant perform runner cleanup or replacement of the lab directory and are not evidence of a fake exploit. Runtime targets, isolation probes, and provisioning/download endpoints are distinguished in the endpoint inventory. Image tags are mutable, and rebuilding the vendored Dockerfile may fail because historical package sources may be unavailable. The analyzed repository URL, analyzed git reference, and archive size were not supplied; their fields are left empty or zero rather than substituting the documented upstream Vulhub URL and commit. Analysis is static; deployment and exploitation were not verified.CyberCTF · Disclosed Oct 8, 2026 · bash · terraform · networkOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
RedisRedisapplication
FAQ

Frequently asked questions

Is CVE-2022-0543 exploited in the wild?
Yes. As of Nov 19, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Mar 28, 2022.
Is there a public exploit for CVE-2022-0543?
Yes. Mallory tracks 9 public exploits or proofs of concept for CVE-2022-0543, the earliest disclosed Feb 18, 2022.
Is there a patch for CVE-2022-0543?
Install the distribution-maintained Redis security update that fixes CVE-2022-0543, including updates to affected container images, and restart or redeploy Redis using the corrected packages. Verify the distribution package revision rather than relying only on the upstream Redis version, because the vulnerability originates in packaging.
What products are affected by CVE-2022-0543?
Redis.
How severe is CVE-2022-0543?
CVE-2022-0543 has a CVSS v3.1 score of 10.0 (Critical) and an EPSS score of 85.6% (100th percentile) as of Nov 19, 2026.
Activity feed

Recent activity

16 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+8 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware10Malware families linked to this CVE, with evidence and IOCs.
Detection signatures6YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity4Community discussion across Reddit, Mastodon, and other social sources.