🔍 CVE-2026-31214

9.8
CVSS Score
CRITICAL
2026-05-12
2026-05-13 15:51
✅ 완료

🇰🇷 한글 설명

ml-engineering 프로젝트의 torch-checkpoint-shrink.py 스크립트가 weights_only=True 파라미터 없이 torch.load()를 사용하여 insecure deserialization 취약점을 야기합니다. 공격자가 악의적인 PyTorch 체크포인트 파일을 제공하면 pickle 모듈을 통해 임의의 Python 객체가 역직렬화되어 코드 실행을 초래합니다.

💡 쉬운 설명

PyTorch 파일을 안전하지 않은 방식으로 불러오기 때문에, 악의적인 파일을 열면 해커 코드가 자동으로 실행됩니다. 신뢰할 수 없는 출처에서 받은 .pt 파일을 실행하면 컴퓨터가 완전히 장악될 수 있습니다.

🇺🇸 원문 (English)

The torch-checkpoint-shrink.py script in the ml-engineering project in commit 0099885db36a8f06556efe1faf552518852cb1e0 (2025-20-27) contains an insecure deserialization vulnerability (CWE-502). The script uses torch.load() to process PyTorch checkpoint files (.pt) without enabling the security-restrictive weights_only=True parameter. This oversight 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 in the context of the user running the script.

📍 영향받는 시스템

ml-engineering 프로젝트 torch-checkpoint-shrink.py (commit 0099885db36a8f06556efe1faf552518852cb1e0)

⚔️ 공격 벡터

악의적으로 조작된 PyTorch 체크포인트 파일(.pt)을 제공하여 스크립트 실행 중 pickle 역직렬화를 통한 임의 코드 실행 유도

🛡️ 대응 방법

torch.load() 호출에 weights_only=True 파라미터 추가하여 pickle 역직렬화 비활성화

🔧 검증 코드

결과가 출력되면 취약한 torch.load() 호출이 존재합니다. 아무것도 출력되지 않으면 모든 호출이 weights_only=True로 보호됩니다.

Shell / Script
grep -n 'torch\.load' torch-checkpoint-shrink.py | grep -v 'weights_only=True'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Python