🔍 CVE-2025-4517

9.4
CVSS Score
CRITICAL
2025-06-03
2026-07-31 14:16
✅ 완료

🇰🇷 한글 설명

Python tarfile 모듈에서 filter='data' 또는 'tar' 매개변수 사용 시 신뢰할 수 없는 tar 아카이브로부터 추출 디렉토리 외부로의 임의 파일 시스템 쓰기가 가능한 취약점. Python 3.14 이후 버전에서 기본 filter 값이 'data'로 변경되어 별도 설정 없이도 영향을 받을 수 있다.

💡 쉬운 설명

특수하게 조작된 tar 파일을 추출할 때 시스템의 다른 폴더에 파일을 만들거나 수정할 수 있다. 신뢰할 수 없는 tar 파일을 Python으로 풀 때 이 문제가 발생한다.

🇺🇸 원문 (English)

Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter  for more information. Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected. Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.

📍 영향받는 시스템

Python 3.x tarfile 모듈을 사용하는 모든 버전 (특히 Python 3.14+ 기본값으로 영향)

⚔️ 공격 벡터

신뢰할 수 없는 tar 아카이브를 TarFile.extractall() 또는 TarFile.extract()로 추출할 때 경로 조작 공격

🛡️ 대응 방법

filter 매개변수를 명시적으로 'fully_trusted' 지정하거나 신뢰할 수 있는 원본의 tar 파일만 추출

🔧 검증 코드

Python 버전이 3.14 이상이고 DEFAULT_FILTER가 'data'이면 취약점의 영향을 받을 수 있다.

Shell / Script
python3 -c "import tarfile, sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}'); print(f'DEFAULT_FILTER: {getattr(tarfile, \"DEFAULT_FILTER\", \"not set\")}')"

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Python