🔍 CVE-2025-6921

7.5
CVSS Score
HIGH
2025-09-23
2026-10-11 20:10
✅ 완료

🇰🇷 한글 설명

huggingface/transformers 4.53.0 미만 버전의 AdamWeightDecay 옵티마이저에서 정규 표현식 서비스 거부(ReDoS) 취약점이 발견되었습니다. 사용자가 제어 가능한 include_in_weight_decay 및 exclude_from_weight_decay 리스트 내의 정규 표현식이 처리될 때 치명적인 백트래킹이 발생할 수 있습니다. 이로 인해 CPU 점유율이 100%로 상승하며 머신러닝 작업이 중단되거나 서비스가 응답 불능 상태가 될 수 있습니다.

💡 쉬운 설명

특수하게 조작된 정규 표현식을 입력하면 컴퓨터가 계산을 끝내지 못하고 무한 루프에 빠져 멈추게 만드는 취약점입니다. 공격자가 이 패턴을 이용하면 서버의 CPU를 완전히 점유하여 서비스를 마비시킬 수 있습니다.

🇺🇸 원문 (English)

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. The vulnerability arises from the _do_use_weight_decay method, which processes user-controlled regular expressions in the include_in_weight_decay and exclude_from_weight_decay lists. Malicious regular expressions can cause catastrophic backtracking during the re.search call, leading to 100% CPU utilization and a denial of service. This issue can be exploited by attackers who can control the patterns in these lists, potentially causing the machine learning task to hang and rendering services unresponsive.

📍 영향받는 시스템

huggingface/transformers library versions prior to 4.53.0

⚔️ 공격 벡터

사용자가 제어 가능한 옵티마이저 설정 리스트(include/exclude weight decay patterns)에 악의적인 정규 표현식 주입

🛡️ 대응 방법

huggingface/transformers 라이브러리를 4.53.0 버전 이상으로 업데이트

🔧 검증 코드

출력된 Version 값이 4.53.0 미만이면 취약한 버전이 설치된 상태입니다.

Shell / Script
pip show transformers | grep Version

📊 CVSS Vector String

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