🇰🇷 한글 설명
HuggingFace transformers 라이브러리의 config.json 파일 역직렬화 취약점으로, 공격자가 _attn_implementation_internal 필드에 악의적인 저장소 ID를 삽입하면 피해자가 모델을 로드할 때 임의 코드가 실행된다. trust_remote_code 보안 메커니즘을 우회하며 표준 API 사용 패턴에서 발생하여 매우 위험하다.
💡 쉬운 설명
HuggingFace에서 AI 모델을 다운로드할 때 악의적인 설정 파일을 몰래 넣으면 해커의 프로그램이 자동으로 실행된다. 5.3.0 이전 버전에서 이 문제가 발생한다.
🇺🇸 원문 (English)
A critical remote code execution vulnerability exists in all versions of the HuggingFace transformers library prior to version 5.3.0. The vulnerability allows an attacker to craft a malicious `config.json` file containing the `_attn_implementation_internal` field set to an attacker-controlled HuggingFace Hub repository ID. When a victim loads this model using the standard `AutoModelForCausalLM.from_pretrained()` API, the library downloads and executes arbitrary Python code from the attacker's repository with the victim's full OS privileges. This issue arises due to unfiltered deserialization of configuration attributes, insufficient sanitization of internal fields, and unsandboxed execution of downloaded kernels. The vulnerability bypasses the `trust_remote_code` security mechanism, is invisible to the victim, and exploits the standard documented usage pattern, making it particularly severe. Users are advised to upgrade to version 5.3.0 or later to mitigate this issue.
📍 영향받는 시스템
HuggingFace transformers library < 5.3.0의 모든 버전
⚔️ 공격 벡터
악의적인 config.json 파일이 포함된 모델을 AutoModelForCausalLM.from_pretrained()로 로드할 때 자동 실행
🛡️ 대응 방법
HuggingFace transformers를 버전 5.3.0 이상으로 업그레이드
🔧 검증 코드
'Patched' 출력 시 취약점 해결됨, 'Vulnerable' 출력 시 업그레이드 필요
python3 -c "import transformers; print(transformers.__version__)" | grep -qE '^5\.[3-9]|^[6-9]\.' && echo 'Patched' || echo 'Vulnerable'