目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2022-24834 PoC — Redis 安全漏洞

来源
关联漏洞
标题: Redis 安全漏洞 (CVE-2022-24834)
Description:Redis Labs Redis是美国Redis Labs公司的一套开源的使用ANSI C编写、支持网络、可基于内存亦可持久化的日志型、键值(Key-Value)存储数据库,并提供多种语言的API。 Redis 7.0.12之前、6.2.13之前 和 6.0.20之前版本存在安全漏洞,该漏洞源于在 Redis 中执行的特制 Lua 脚本可能会触发 cjson 库中的堆溢出,并导致堆损坏和潜在的远程代码执行。
介绍
# Improvement of CVE-2022-24834 public exploit


## Author
Conviso Research Team

## Description

The team at Ricerca Security (@RicercaSec) discovered and successfully exploited a interesting vulnerability (CVE-2022-24834) in the Lua interpreter included with Redis. This vulnerability is a heap overflow in the cjson library, and a detailed writeup can be found [here](https://ricercasecurity.blogspot.com/2023/07/fuzzing-farm-4-hunting-and-exploiting-0.html).

We noticed some hard coded offsets [2] [3], which might pose a inconvenience for those who wish to test it, so we decided to remove them. The main goal was to make it more generic and learn a bit about Lua internals.

# Modifications we made

* We used a huge string to be able to read arbitrary memory addresses more easily;
* We used Lua coroutine to leak stack and libc addresses, this technique is [documented](https://saelo.github.io/posts/pwning-lua-through-load.html) by Saelo (@5aelo);
* We included a symbol resolution function (`local system_addr = resolve_symbol_gnu(libc_leak, "system")`)
* We included an auto gadget finder;
* We modified the original exploit.py to use pwntools
* We added a reverse shell handler to exploit.py


# Tests

* Redis 7.0.11 on Ubuntu 20.04 (via own compilation) - SUCCESS
* Redis 7.0.11 on Ubuntu 20.04 (via apt using Redis official repository) - SUCCESS
* Redis 7.0.11 on Ubuntu 20.04 (via docker image redis:7.0.11) - SUCCESS
* Redis 6.2.12 on Ubuntu 20.04 (via docker image redis:6.2.12) - SUCCESS
* Redis 7.0.11 on Debian 11    (via apt using Redis official repository) - SUCCESS
* Redis  5.0.7 on Ubuntu 20.04 (via apt) - CRASH



# Credits

* @RicercaSec - for the vuln, great writeup and initial exploit;
* @5aelo - for the coroutine technique.

# Demo

Version 6.2.12
![redis_6.2.12_docker.gif](imgs/redis_6.2.12_docker.gif)

Version 7.0.11
![redis_7.0.11_docker.gif](imgs/redis_7.0.11_docker.gif)

# References
[1] https://ricercasecurity.blogspot.com/2023/07/fuzzing-farm-4-hunting-and-exploiting-0.html

[2] https://github.com/RICSecLab/exploit-poc-public/blob/main/CVE-2022-24834/exploit.lua#L341

[3] https://github.com/RICSecLab/exploit-poc-public/blob/main/CVE-2022-24834/exploit.lua#L362-L365

[4] https://saelo.github.io/posts/pwning-lua-through-load.html
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →