🇰🇷 한글 설명
PyTorch-Lightning 2.6.0 이하에서 체크포인트 로드 시 weights_only=True 설정 없이 torch.load()를 호출하여 Pickle 역직렬화 취약점이 발생합니다. 악의적으로 조작된 체크포인트 파일을 로드하면 임의의 Python 코드 실행이 가능합니다.
💡 쉬운 설명
PyTorch-Lightning에서 저장된 모델 파일을 불러올 때, 검증 없이 로드하도록 되어 있습니다. 해킹된 모델 파일을 불러오면 공격자가 원하는 코드를 실행할 수 있습니다.
🇺🇸 원문 (English)
PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism. The LightningModule.load_from_checkpoint() method, which is commonly used to load saved model states, internally calls torch.load() without setting the security-restrictive weights_only=True parameter. This default behavior allows the deserialization of arbitrary Python objects via the Pickle module. A remote attacker can exploit this by providing a maliciously crafted checkpoint file, leading to arbitrary code execution on the victim's system when the file is loaded.
📍 영향받는 시스템
PyTorch-Lightning 버전 2.6.0 이하
⚔️ 공격 벡터
원격 공격자가 악의적으로 조작된 .ckpt 체크포인트 파일을 배포하고 사용자가 LightningModule.load_from_checkpoint()로 로드하도록 유도
🛡️ 대응 방법
PyTorch-Lightning을 2.6.1 이상으로 업그레이드하거나, 로드 전 신뢰할 수 있는 출처의 파일만 사용
🔧 검증 코드
Version 필드가 2.6.1 이상이면 안전함. 2.6.0 이하이거나 미설치 상태면 업그레이드 필요
pip show pytorch-lightning 2>/dev/null | grep Version || echo 'Not installed'