🔍 CVE-2026-80047

7.8
CVSS Score
HIGH
2026-09-01
2026-09-23 18:17
✅ 완료

🇰🇷 한글 설명

Hugging Face Transformers의 특정 버전에서 GenerativePreTrainedModel.load_custom_generate() 함수 사용 시 원격 파이썬 파일이 사용자 동의 없이 로컬 디스크에 저장되는 취약점이 발견되었습니다. 이 취약점은 신뢰 확인 절차 이전에 파일을 먼저 캐시하기 때문에 발생하며, 공격자가 제어하는 코드가 사용자 디렉토리에 영구적으로 남을 수 있습니다.

💡 쉬운 설명

사용자가 '위험한 코드를 실행할까요?'라는 질문에 '아니오'라고 답해도, 공격자가 만든 악성 파일이 컴퓨터에 몰래 저장되는 문제입니다. 이렇게 저장된 파일은 나중에 다른 정상적인 작업을 할 때 갑자기 실행될 위험이 있습니다.

🇺🇸 원문 (English)

A vulnerability in Hugging Face Transformers (versions 4.57.0 to 5.16.1) allows remote Python files to be written to local disk without user consent when using GenerativePreTrainedModel.load_custom_generate(). The function fetches and caches a remote module file before performing the required trust_remote_code consent check, inverting the security model enforced by other code-loading paths (such as AutoConfig, AutoModel, and AutoTokenizer). As a result, attacker‑controlled Python code from custom_generate/generate.py is copied into the user’s ~/.cache/huggingface/modules directory even if the user declines the trust prompt. Although execution is correctly gated, the file write is not reversible and can persist across sessions. This can lead to persistent, unauthorized files on disk and stale cache collisions where cached attacker code may later be executed during trusted model loads. The issue stems from an unconditional file write in dynamic_module_utils.py prior to any trust verification.

📍 영향받는 시스템

Hugging Face Transformers versions 4.57.0 to 5.16.1

⚔️ 공격 벡터

원격 서버의 악성 파이썬 파일을 로컬 캐시 디렉토리(~/.cache/huggingface/modules)에 강제로 쓰기

🛡️ 대응 방법

Transformers 라이브러리를 최신 버전으로 업데이트하거나 해당 함수 사용 시 주의가 필요함

🔧 검증 코드

출력된 버전이 4.57.0 이상 5.16.1 이하 범위에 해당하면 취약한 상태임

Shell / Script
pip show transformers | grep Version

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Python