🇰🇷 한글 설명
Python tarfile 모듈의 extraction filter 검증 우회 취약점으로, 악의적인 tar 아카이브가 심볼릭 링크를 통해 목적지 외부 파일에 접근하고 메타데이터를 조작할 수 있습니다. Python 3.14부터 기본 필터값이 'data'로 변경되어 명시적으로 안전한 필터를 지정하지 않으면 자동으로 영향받습니다.
💡 쉬운 설명
압축 파일(tar)을 풀 때 안전 검사를 우회하는 취약점입니다. 공격자의 악의적인 압축 파일이 중요한 시스템 파일을 손상시키거나 접근할 수 있습니다.
🇺🇸 원문 (English)
Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata.
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 모듈 사용 시, 특히 extractall()/extract()에서 filter='data' 또는 filter='tar' 사용, Python 3.14+ 기본값 사용
⚔️ 공격 벡터
악의적인 tar 아카이브 배포 → TarFile.extractall() 추출 → 심볼릭 링크로 목적지 외부 파일 접근/메타데이터 조작
🛡️ 대응 방법
Python 업그레이드 및 tarfile 사용 시 filter='fully_trusted_tar' 또는 명시적 검증 필터 사용, 신뢰할 수 없는 tar 아카이브 추출 금지
🔧 검증 코드
Python 버전이 3.14 이상이고 DEFAULT_FILTER가 'data'로 출력되면 취약점 영향 상태, 명시적 필터 사용 확인 필요
python3 -c "import tarfile, sys; print(f'Python {sys.version_info.major}.{sys.version_info.minor}'); print('DEFAULT_FILTER:', getattr(tarfile, 'DEFAULT_FILTER', 'None'))"