Denial of Service Vulnerability in Hugging Face Transformers Library
CVE-2025-3262
5.3MEDIUM
What is CVE-2025-3262?
A Denial of Service vulnerability has been identified in the Hugging Face Transformers library, specifically in version 4.49.0. The root cause lies in the inefficient regular expression patterns defined in the SETTING_RE
variable located in the transformers/commands/chat.py
file. This issue arises due to the presence of repetition groups and poorly optimized quantifiers, which can lead to severe performance degradation through exponential backtracking when processing 'almost matching' payloads. Maliciously crafted input strings can exploit this vulnerability, resulting in a Denial-of-Service condition. This issue has been addressed in version 4.51.0.
Affected Version(s)
huggingface/transformers < 4.51.0