Heap Overflow in cJSON via Lua Script in Redis <7.0.12 (Auth Required RCE)
CVE-2022-24834 Published on July 13, 2023
Heap overflow issue with the Lua cjson library used by Redis
Redis is an in-memory database that persists on disk. A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson library, and result with heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. The problem is fixed in versions 7.0.12, 6.2.13, and 6.0.20.
Vulnerability Analysis
CVE-2022-24834 is exploitable with local system access, and requires small amount of user privileges. This vulnerability is consided to have a high level of attack complexity. Public availability of a proof of concept (POC) exploit exists for CVE-2022-24834. The potential impact of an exploit of this vulnerability is considered to be very high.
Weakness Types
Heap-based Buffer Overflow
A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
Integer Overflow to Buffer Overflow
The product performs a calculation to determine how much memory to allocate, but an integer overflow can occur that causes less memory to be allocated than expected, leading to a buffer overflow.
Products Associated with CVE-2022-24834
You can be notified by email with stack.watch whenever vulnerabilities like CVE-2022-24834 are published in these products:
Affected Versions
redis:- Version >= 7.0.0, < 7.0.12 is affected.
- Version >= 6.2.0, < 6.2.13 is affected.
- Version >= 6.0.0, < 6.0.20 is affected.
- Version 7.0.0 and below 7.0.12 is affected.
- Version 6.2.0 and below 6.2.13 is affected.
- Version 6.0.0 and below 6.0.20 is affected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.