CVE-2025-5197: huggingface/transformers · ReDoS
Affects huggingface/transformersSource CVE Database V5
Not known to be exploited · CVSS 5.3 Medium · fixed in 4.53.0 : update huggingface/transformers when convenient.
Data as of 22 Nov 2026, 21:14 UTC
- EPSS
- 0.4% chance of exploitation in 30 days – higher than 39% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.53.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LExploitation evidence
Disclosed: evidence found.
CVE published 6 Aug 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 22 Nov 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| huggingface huggingface/transformers | Affected
| Fixed in– |
AI-suggested
To mitigate CVE-2025-5197, European organizations should: 1) Immediately upgrade the huggingface/transformers library to version 4.53.0 or later, where the inefficient regex pattern has been fixed. 2) Implement input validation and sanitization on any user-supplied or external inputs that influence model weight names or conversion parameters to prevent maliciously crafted strings triggering the regex vulnerability. 3) Monitor CPU usage and performance metrics of services performing model conversions to detect anomalous spikes indicative of exploitation attempts. 4) Employ rate limiting and request throttling on APIs or services that accept model conversion requests to reduce the risk of denial of service. 5) For critical AI pipelines, consider isolating model conversion processes in sandboxed or containerized environments to contain resource exhaustion impacts. 6) Engage with vendors or third-party AI service providers to confirm they have applied the patch or mitigations if their platforms use the affected library. 7) Maintain up-to-date inventories of AI/ML software dependencies to rapidly identify and remediate vulnerable components. These targeted actions go beyond generic advice by focusing on the specific function and context of the vulnerability, emphasizing proactive patching, input control, and operational monitoring.
Description
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library, specifically in the `convert_tf_weight_name_to_pt_weight_name()` function. This function, responsible for converting TensorFlow weight names to PyTorch format, uses a regex pattern `/[^/]*___([^/]*)/` that can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. The vulnerability affects versions up to 4.51.3 and is fixed in version 4.53.0. This issue can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting model conversion processes between TensorFlow and PyTorch formats.