🇰🇷 한글 설명
Hugging Face Transformers에서 발생하는 SEW convert_config 코드 인젝션 원격 코드 실행 취약점
💡 쉬운 설명
Hugging Face Transformers의 convert_config 함수에서 사용자 입력 문자열을 제대로 검증하지 않아 원격 공격자가 임의의 코드를 실행할 수 있는 취약점입니다. 이는 사용자와의 상호작용이 필요하며, 악의적인 체크포인트를 변환하여 취약점을 악용할 수 있습니다.
🇺🇸 원문 (English)
Hugging Face Transformers SEW convert_config Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers. User interaction is required to exploit this vulnerability in that the target must convert a malicious checkpoint.
The specific flaw exists within the convert_config function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-28251.
📍 영향받는 시스템
Hugging Face Transformers
⚔️ 공격 벡터
악의적인 체크포인트를 변환하여 원격 코드 실행
🛡️ 대응 방법
최신 버전의 Hugging Face Transformers로 업데이트하고, 사용자 입력 데이터의 유효성을 검사하는 것을 권장합니다.
🔧 검증 코드
Python이 설치된 로컬 시스템에서 실행할 수 있습니다. transformers 패키지의 버전을 확인하여 취약점 여부를 판단합니다.
import pkg_resources
version = pkg_resources.get_distribution('transformers').version
if version < '4.25.1':
print({"result": "취약", "reason": "Hugging Face Transformers 버전이 4.25.1 미만"})
else:
print({"result": "양호", "reason": "Hugging Face Transformers 버전이 4.25.1 이상"})