Skip to main content
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Redis Lua sandbox escape RCE in Debian/Ubuntu packages

IdentifiersCVE-2022-0543CWE-94

CVE-2022-0543 is a Debian-specific packaging flaw affecting Redis in which the embedded Lua interpreter was dynamically linked against the system Lua library, breaking Redis's intended Lua sandbox restrictions. As a result, an attacker able to execute Lua code through Redis scripting functionality (for example via EVAL) can escape the sandbox and access unsafe Lua functionality such as io.popen, leading to arbitrary command execution on the underlying host. The issue is described as affecting Debian/Ubuntu packaged Redis rather than upstream Redis generally, and has been observed as an exploitation vector in the wild, including by Redis-targeting malware such as P2Pinfect.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

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

Successful exploitation results in full remote code execution in the security context of the Redis process on vulnerable Debian/Ubuntu Redis instances. This enables attackers to run shell commands, deploy malware, establish persistence, load additional tooling, pivot further into the environment, and potentially compromise containers or hosts running exposed Redis services. In observed campaigns, the flaw has been used to enroll systems into botnets and support follow-on payload delivery such as cryptominers or ransomware.

Mitigation

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

Do not expose Redis directly to the internet. Restrict network access to trusted clients only, require authentication where applicable, and disable or tightly control access to scripting functionality if operationally feasible. Use container/runtime and host monitoring to detect suspicious Redis EVAL activity or unexpected child process execution. In production, also restrict dangerous Redis features not required by the deployment and audit for persistence artifacts or unauthorized outbound connections.

Remediation

Patch, then assume compromise.

Remediate by applying the vendor/distribution security updates for Redis packages that correct the Debian/Ubuntu packaging issue and restore proper sandboxing behavior. If Redis was installed from affected Debian or Ubuntu repositories, upgrade to the fixed package versions provided by the distribution. After patching, review the host for signs of compromise because this vulnerability has been exploited in the wild.
PUBLIC EXPLOITS

Exploits

4 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (2 hidden).

VALID 4 / 6 TOTALView more in app
CVE-2022-0543MaturityPoCVerified exploit

Small 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.

OpsCipherDisclosed Sep 5, 2022pythonmarkdownnetworkweb
CVE-2022-0543MaturityPoCVerified exploit

This 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.

0x7eTeamDisclosed Mar 16, 2022pythonnetwork
CVE-2022-0543MaturityPoCVerified exploit

This 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.

JacobEbbenDisclosed Sep 1, 2022pythonnetwork
CVE-2022-0543MaturityPoCVerified exploit

This 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.

z92gDisclosed Jul 6, 2022gonetwork
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

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

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, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware4

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity4

Community discussion across Reddit, Mastodon, and other social sources.