🇰🇷 한글 설명
whichllm 0.5.16 미만 버전의 run 및 snippet 명령에서 코드 주입 취약점이 발견되었습니다. 공격자가 HuggingFace 저장소를 제어할 수 있다면, 특수 문자가 포함된 악성 GGUF 파일명을 통해 사용자 기기에서 임의의 코드를 실행할 수 있습니다. 이는 cli.py의 스크립트 생성 함수가 HuggingFace API에서 가져온 파일명을 적절한 이스케이프 처리 없이 파이썬 소스 코드에 직접 삽입하기 때문에 발생합니다.
💡 쉬운 설명
해커가 조작한 파일 이름을 가진 모델을 다운로드하려고 하면, 컴퓨터가 파일 이름 자체를 명령어로 착각하여 실행하게 됩니다. 이로 인해 사용자의 컴퓨터가 해커의 의도대로 조작될 위험이 있습니다.
🇺🇸 원문 (English)
whichllm before 0.5.16 contains a code injection vulnerability in the run and snippet commands that allows a remote attacker who controls a HuggingFace repository to achieve arbitrary code execution by crafting a malicious GGUF filename containing double quotes or other special characters. The script generation function in cli.py interpolates HuggingFace-derived values, including GGUF variant filenames from the Hub API siblings rfilename field, directly into Python source code without escaping, allowing the crafted filename to break out of the generated string literal and execute injected code on the user's machine before any model download occurs.
📍 영향받는 시스템
whichllm version < 0.5.16
⚔️ 공격 벡터
HuggingFace 저장소의 GGUF 파일명에 특수 문자를 삽입하여 CLI 스크립트 실행 시 코드 주입
🛡️ 대응 방법
whichllm을 0.5.16 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 0.5.16보다 낮으면 취약한 상태입니다.
pip show whichllm 2>/dev/null | grep Version