
CVE-2026-22008의 개념 증명(PoC)으로, 신뢰할 수 없는 ARN을 통한 AWS Lambda 레이어 주입을 시연하며, 영향을 받는 함수에서 임의 코드 실행 및 자격 증명 탈취를 가능하게 합니다.
# deploy_vulnerable_lambda.py - Lambda function using a layer from untrusted account
import boto3
lambda_client = boto3.client('lambda')
# Attacker publishes a public layer containing malicious code
# Victim function references the layer ARN
response = lambda_client.create_function(
FunctionName='victim-func',
Runtime='python3.9',
Role='arn:aws:iam::123456789012:role/lambda-role',
Handler='index.handler',
Code={'ZipFile': open('function.zip','rb').read()},
Layers=['arn:aws:lambda:us-east-1:123456789012:layer:poisoned:1'] # public, but owned by attacker
)
print("Function created with malicious layer")
AWS Lambda 함수가 공개적으로 공유되었지만 신뢰할 수 없는 ARN의 Lambda 레이어를 포함합니다. 레이어의 코드는 함수의 실행 환경 내에서 실행되므로, 레이어 게시자는 자격 증명을 탈취하고, 데이터를 유출하며, 임의 코드를 실행할 수 있습니다.
취약한 스크립트를 사용하여 피해자 함수를 배포합니다 (AWS 샌드박스 필요):
python deploy_vulnerable_lambda.py
레이어의 핸들러는 각 요청 시 호출되어 공격자 서버로 접속합니다.