🇰🇷 한글 설명
sentence-transformers 라이브러리의 import_module_class 헬퍼 함수 내 로직 결함으로 인해 보안 제어가 우회되는 취약점입니다. 공격자가 로컬 파일 시스템에 악성 파이썬 파일을 배치할 수 있는 경우, trust_remote_code=False 설정에도 불구하고 모델 로드 시 임의의 코드가 실행될 수 있습니다.
💡 쉬운 설명
모델을 불러올 때 '위험한 코드는 실행하지 마라'고 설정해도, 컴퓨터에 이미 저장된 악성 파일을 발견하면 이를 무시하고 실행해버리는 보안 구멍이 발견되었습니다. 이를 통해 해커가 사용자의 컴퓨터에서 몰래 명령을 실행할 수 있습니다.
🇺🇸 원문 (English)
sentence-transformers contains a security control bypass vulnerability that allows attackers to achieve arbitrary code execution by exploiting a logic flaw in the import_module_class helper within sentence_transformers/util/misc.py, where the guard condition includes an 'or os.path.exists(model_name_or_path)' clause that satisfies the trust gate whenever the supplied path exists on the local filesystem, regardless of the trust_remote_code=False argument. Attackers who can control or influence the contents of a model directory on disk can place malicious Python files such as modeling_*.py referenced via modules.json, causing the code to execute at import time when an application loads the model with SentenceTransformer(path, trust_remote_code=False), bypassing the documented security contract and achieving code execution within the loading process.
📍 영향받는 시스템
sentence-transformers (import_module_class 로직 결함이 포함된 버전)
⚔️ 공격 벡터
로컬 파일 시스템의 모델 디렉토리에 악성 파이썬 파일을 배치하여 모델 로드 시 코드 실행 유도
🛡️ 대응 방법
sentence-transformers 라이브러리를 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 Version 정보를 확인하여 취약점이 해결된 최신 버전인지 확인
pip show sentence-transformers