🇰🇷 한글 설명
huggingface/transformers 5.2.0 버전의 LightGlue 모델 로딩 경로에서 발생하는 취약점으로, 공격자가 제어하는 모델 저장소를 통해 모델 초기화 과정 중 임의 코드가 실행될 수 있습니다. 사용자가 trust_remote_code를 False로 설정하더라도, 신뢰할 수 없는 config.json 파일의 설정값이 이를 덮어써서 원격 코드 실행을 허용하게 됩니다. 이로 인해 API 서버, 연구용 노트북, CI/CD 파이프라인 등에서 자격 증명 탈취나 백도어 설치와 같은 심각한 피해가 발생할 수 있습니다.
💡 쉬운 설명
모델을 불러올 때 보안 설정을 꺼두어도, 모델 파일 안에 숨겨진 가짜 설정값이 보안 설정을 강제로 다시 켜버리는 문제입니다. 이로 인해 해커가 만든 악성 코드가 사용자의 컴퓨터에서 자동으로 실행될 수 있습니다.
🇺🇸 원문 (English)
A vulnerability in the LightGlue model loading path of huggingface/transformers version 5.2.0 allows an attacker-controlled model repository to execute arbitrary code during model initialization. The issue arises because the `trust_remote_code` parameter, intended to prevent remote code execution, is overridden by untrusted serialized configuration data in a nested code path. Specifically, when loading a LightGlue model using `AutoModel.from_pretrained()` with `trust_remote_code=False`, the `LightGlueConfig` reads the `trust_remote_code` value from the untrusted `config.json` file and propagates it into nested `AutoConfig.from_pretrained()` calls. This results in the execution of attacker-provided Python modules, even when the victim explicitly disables remote code execution. The vulnerability poses a high risk for environments such as API inference servers, research notebooks, CI/CD pipelines, and model evaluation workers, potentially leading to credential theft, lateral movement, or persistence/backdoor deployment.
📍 영향받는 시스템
huggingface/transformers version 5.2.0 (LightGlue 모델 사용 시)
⚔️ 공격 벡터
악의적으로 조작된 config.json 파일이 포함된 모델 저장소를 AutoModel.from_pretrained()로 로드할 때 발생
🛡️ 대응 방법
transformers 라이브러리를 최신 보안 패치가 적용된 버전으로 업데이트하거나, 신뢰할 수 없는 모델 저장소의 로드를 금지함
🔧 검증 코드
출력된 버전이 5.2.0인지 확인하여 해당 취약점에 노출되었는지 판단함
pip show transformers | grep -E 'Version'