Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-46817 PoC — Lua library commands may lead to integer overflow and potential RCE

Source
Associated Vulnerability
Title:Lua library commands may lead to integer overflow and potential RCE (CVE-2025-46817)
Description:Redis is an open source, in-memory database that persists on disk. Versions 8.2.1 and below allow an authenticated user to use a specially crafted Lua script to cause an integer overflow and potentially lead to remote code execution The problem exists in all versions of Redis with Lua scripting. This issue is fixed in version 8.2.2.
Description
CVE-2025-46817 – Redis Lua unpack Integer Overflow (Potential RCE)
Readme
# CVE-2025-46817 – Redis Lua `unpack` Integer Overflow (Potential RCE)

Redis Lua `unpack` integer overflow PoC causing stack blow-up and crash on 8.2.1.

## Overview

Redis 8.2.1 ships Lua 5.1 with an `unpack` implementation that computes the result count using signed integers. Carefully chosen start/end indices wrap the arithmetic, bypass `lua_checkstack`, and force Lua to push billions of results. Combined with table index wrapping, this can corrupt heap memory and lead to RCE.

## Environment

- Redis server 8.2.1 (or any vulnerable release before 8.2.2)
- `redis-cli`
- Local network access to the Redis instance

## Files

- [`CVE-2025-46817.lua`](/CVE-2025-46817.lua) – calls `unpack` with a range that overflows signed arithmetic.

## Usage

```bash
redis-cli -h localhost -p 6379 --eval CVE-2025-46817.lua
```

**Expected result:**

On 8.2.1 the server typically terminates the connection or crashes from excessive stack growth. Redis 8.2.2 (commit [fc9abc775e308374f667fdf3e723ef4b7eb0e3ca](https://github.com/redis/redis/commit/fc9abc775e308374f667fdf3e723ef4b7eb0e3ca)) rejects the call with "ERR Error running script (too many results to unpack)".

## Mitigation

Upgrade to Redis 8.2.2 or later, which hardens `luaB_unpack` and `luaH_getnum`, or disable Lua scripting for untrusted users.
File Snapshot

[4.0K] /data/pocs/17c5b5238e8743510bd5c7d2ab56f7eef185fd3b ├── [ 500] CVE-2025-46817.lua └── [1.3K] README.md 1 directory, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →