Monday, September 14, 2026

Critical Redis Vulnerability Could Let Attackers Execute Code and Hijack Servers

A critical vulnerability in Redis, tracked as CVE-2026-23631 and dubbed “DarkReplica,” exposes authenticated deployments to remote code execution (RCE) through a complex use-after-free (UAF) condition in the replication subsystem. Discovered by security researcher Yoni Sherez during the ZeroDay.

In the Cloud 2025 competition, the flaw demonstrates how Redis’s internal Lua execution model and replication logic can be chained together to achieve full server compromise.

Critical Redis Vulnerability

The vulnerability specifically targets Redis deployments where attackers already possess valid authentication credentials. By abusing the SLAVEOF command, an attacker can coerce a target Redis instance into becoming a replica of a malicious controller server.

This sets the stage for exploitation by manipulating the synchronization process and triggering unsafe memory handling within Redis’s Lua functions engine.

Redis supports two Lua execution models: the legacy scripting engine (EVAL/EVALSHA) and the newer functions engine (FUNCTION LOAD/FCALL). The latter is central to this vulnerability.

Functions registered through this engine are persistent and synchronized across cluster nodes, making them a powerful attack surface. While Redis enforces sandboxing and execution constraints, its single-threaded architecture introduces edge cases when handling long-running scripts.

To prevent blocking, Redis uses a Lua hook mechanism that periodically checks for timeouts and processes pending events via processEventsWhileBlocked().

This mechanism allows limited command execution even while a script is running. However, a critical oversight exists: while most client commands are restricted during this state, replication traffic from a controller server is still processed without validating whether a Lua function is actively executing.

This creates a race condition. An attacker can execute a deliberately slow Lua function, such as an infinite loop, and then trigger a FULLRESYNC from the malicious master.

During synchronization, Redis clears existing function contexts using functionsLibCtxClearCurrent(), which ultimately frees the global lua_State object:

void functionsLibCtxClearCurrent(int async) {
    functionsLibCtxFree(curr_functions_lib_ctx);
    dictRelease(engines); // Frees lua_State
    functionsInit();
}

Once control returns to the still-running Lua function, it continues execution using a freed lua_State, resulting in a classic use-after-free condition. This primitive enables attackers to corrupt memory and eventually gain arbitrary code execution.

Exploitation requires careful heap manipulation because Redis uses jemalloc. Attackers leverage Lua primitives such as tostring() to leak heap addresses and controlled allocations to reclaim freed memory regions. For example, a coroutine object can be freed and replaced with attacker-controlled data:

local a = coroutine.create(function() end)
local addr = tostring(a)
a = nil
collectgarbage("collect")
a = "AAAAAA..." -- Reallocates at same address

To stabilize execution, attackers pivot to a separate Lua state using coroutines, allowing them to operate in a controlled environment. From there, they construct arbitrary read/write primitives by abusing Lua table internals, ultimately enabling manipulation of critical function pointers.

One reliable exploitation path involves overwriting the lua_State->l_G->frealloc pointer, which acts as a custom memory allocator. By redirecting this pointer to system() and controlling its argument, attackers achieve command execution:

write(fake_l_G + offsetof(global_State, frealloc), system);
write(fake_l_G + offsetof(global_State, ud), command_payload_addr);
coroutine.resume(co); // Triggers system()

Redis addressed the vulnerability on May 5, 2026, releasing patches across all supported versions. Affected versions include Redis 7.2.0 through 7.2.13, 7.4.0 through 7.4.8, 8.2.0 through 8.2.5, 8.4.0 through 8.4.2, and 8.6.0 through 8.6.2. Fixed versions are 7.2.14, 7.4.9, 8.2.6, 8.4.3, and 8.6.3.

Organizations running Redis in production environments should prioritize patching immediately. Additionally, restricting replication configuration, turning off unnecessary Lua functionality, and enforcing strict authentication controls can reduce exposure.

Given Redis’s widespread use in cloud-native and microservices architectures, this vulnerability poses significant risk for lateral movement and infrastructure compromise if left unaddressed.

Follow us on Google NewsLinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

ATM Penetration Testing – Advanced Testing Methods to Find The Vulnerabilities

ATM Penetration testing, Hackers have found different approaches to...

Casbaneiro Banking Trojan Uses Distributed C2 Servers to Evade Detection and Target Bank Users

A Casbaneiro banking Trojan campaign targeting users across Latin...

AsyncRAT Malware Abuses AutoIt and PowerShell to Hide Inside Legitimate Windows Process

A five-stage AsyncRAT campaign that chains a socially engineered...

Threat Actors Use Claude AI Agents to Automate Cyberattacks and Steal Sensitive Data

Threat actors are increasingly using Claude-based AI workflows to...

China-Linked Hackers Chain Chrome Zero-Day With Windows Kernel Flaw in Attacks

China-linked threat actors UTA0560 and JungleBamboo chained a Google...

New Phishing Campaign Abuses Windows Mshta.exe to Steal Credentials and Secrets

A newly identified phishing campaign is abusing the legitimate...

CISA Warns of Critical GitLab Vulnerability Exploited in Attacks

The U.S. Cybersecurity and Infrastructure Security Agency (CISA) has...

Researchers Uncover 10,000+ Malware Loaders Behind YouTube and SEO Poisoning Campaign

A long-running pay-per-install (PPI) operation that used YouTube gaming...

Related Articles

Recent News