it doesn't get worse than this (CVSS 10.0)
Quick Overview
A critical vulnerability, a CVE with a severity score of 10.0, exists in Redis due to a use-after-free in the Lua sandbox escape mechanism caused by improper garbage collection tracking of T-string objects within Redis's custom Lua interpreter.
Key Points: The vulnerability is a severity 10.0 CVE, which is the most severe rating possible, stemming from a use-after-free in Lua leading to code execution inside Redis. Redis utilizes a custom version of the Lua interpreter, and the bug occurs in how the Lua parser handles T-string objects; it creates the object but fails to immediately add it to the garbage collector (GC) root. This failure allows the GC to incorrectly free the object while the user still holds a pointer, leading to a classic type confusion via use-after-free when the memory is reallocated for a new structure. The speaker questions the CVSS base metrics, specifically noting that 'attack complexity low' and 'privileges required low' are confusing because the exploit requires the attacker to be authenticated to the Redis instance. The vulnerability enables a sandbox escape from Lua, which is significant because Redis allows users to upload Lua scripts for automation. Manual memory management languages like C offer finite control but are dangerous, whereas garbage-collected languages like Lua are safer but still susceptible to vulnerabilities since the GC itself is code. Technically, a language like Rust, with its ownership model enforced by the borrow checker, would prevent use-after-free vulnerabilities like this one, although Lua is not written in Rust.
Context: The video discusses a severe vulnerability (CVE 10.0) found in Redis, which is commonly used as an in-memory key-value store and caching layer between a backend application and a traditional database to improve query efficiency. The core issue lies within the execution environment of user-uploaded Lua scripts inside Redis, specifically exploiting how Lua manages memory through its garbage collector, leading to a sandbox escape and potential code execution.