
CVE-2026-23007 서버리스 콜드 스타트 메모리 잔존을 시뮬레이션하며, Lambda 호출 간 지속되는 전역 상태가 실행 사이에 비밀 정보를 유출할 수 있는 방식을 보여줍니다.
# lambda_remanence.py - Simulated Lambda environment reuse
import os, secrets
def first_invocation():
# Simulates storing a secret in a global variable
global SECRET
SECRET = secrets.token_hex(16)
return "Initialized"
def second_invocation():
# Another function in same container? Actually, separate invocations share memory.
# Here we just read the global if it exists
global SECRET
return SECRET if 'SECRET' in globals() else "No secret"
print("Cold start: ", first_invocation())
print("Warm start: ", second_invocation())
서버리스 플랫폼은 전역 메모리를 초기화하지 않은 채 실행 환경(컨테이너)을 함수 호출 간에 재사용합니다. 동일한 기본 호스트(또는 동일한 계정)를 공유하는 공격자의 함수는 이전 실행의 잔존 데이터에 접근하여 비밀을 유출할 수 있습니다.
실행:
python lambda_remanence.py
두 번째 호출은 첫 번째 호출에서 설정된 비밀을 읽습니다.