🇰🇷 한글 설명
Hugging Face Transformers의 SEW-D convert_config에서 발생하는 원격 코드 실행 취약점입니다. 이 취약점을 이용하면 공격자는 영향을 받는 시스템에서 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
Hugging Face Transformers의 특정 함수에서 사용자 입력을 제대로 검증하지 않아 원격 공격자가 임의의 코드를 실행할 수 있습니다. 사용자는 악의적인 체크포인트를 변환해야만 이 취약점을 이용할 수 있습니다.
🇺🇸 원문 (English)
Hugging Face Transformers SEW-D 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-28252.
📍 영향받는 시스템
Hugging Face Transformers
⚔️ 공격 벡터
사용자 입력을 통한 원격 코드 실행
🛡️ 대응 방법
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 버전이 낮습니다."})
else:
print({"result": "양호", "reason": "Hugging Face Transformers 버전이 최신입니다."})