5.3
Medium
CVE-2025-5197 A Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library,…
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.
Affected products and versions
| Product | Affected versions | Fixed in |
|---|---|---|
| huggingface/transformers 4.53 | earliest → < 4.53.0 | 4.53.0 |
References
- huntr.com huntr.com
- github.com github.com
Timeline
- Published
- Last modified
Other CVEs of huggingface/transformers
The 20 CVEs of huggingface/transformers →
CVE-2026-9856
A vulnerability in huggingface/transformers…
7.1
High
CVE-2026-5241
A vulnerability in the LightGlue model loading path of huggingface/transformers version 5.2.0 allows an…
8.0
High
CVE-2026-4372
A critical remote code execution vulnerability exists in all versions of the HuggingFace transformers library prior to…
7.8
High
CVE-2026-1839
A vulnerability in the HuggingFace Transformers library, specifically in the `Trainer` class, allows for arbitrary…
6.5
Medium