huggingface Transformers up to 4.51.3 API Service convert_tf_weight_name_to_pt_weight_name redos
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 5.2 | $0-$5k | 0.00 |
Summary
A vulnerability was found in huggingface Transformers up to 4.51.3. It has been rated as problematic. The affected element is the function convert_tf_weight_name_to_pt_weight_name of the component API Service. This manipulation causes redos.
The identification of this vulnerability is CVE-2025-5197. It is possible to initiate the attack remotely. There is no exploit available.
Upgrading the affected component is advised.
Details
A vulnerability was found in huggingface Transformers up to 4.51.3. It has been declared as problematic. Affected by this vulnerability is the function convert_tf_weight_name_to_pt_weight_name of the component API Service. The manipulation with an unknown input leads to a redos vulnerability. The CWE definition for the vulnerability is CWE-1333. The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. As an impact it is known to affect availability. The summary by CVE is:
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.
It is possible to read the advisory at huntr.com. This vulnerability is known as CVE-2025-5197 since 05/26/2025. The exploitation appears to be easy. The attack can be launched remotely. The exploitation doesn't need any form of authentication. Technical details of the vulnerability are known, but there is no available exploit. The attack technique deployed by this issue is T1449.003 according to MITRE ATT&CK.
Upgrading to version 4.53.0 eliminates this vulnerability. Applying the patch 944b56000be5e9b61af8301aa340838770ad8a0b is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.
Be aware that VulDB is the high quality source for vulnerability data.
Product
Vendor
Name
Version
License
Website
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.3VulDB Meta Temp Score: 5.2
VulDB Base Score: 5.3
VulDB Temp Score: 5.1
VulDB Vector: 🔒
VulDB Reliability: 🔍
CNA Base Score: 5.3
CNA Vector (@huntr_ai): 🔒
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: RedosCWE: CWE-1333 / CWE-400 / CWE-404
CAPEC: 🔒
ATT&CK: 🔒
Physical: No
Local: No
Remote: Yes
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: Transformers 4.53.0
Patch: 944b56000be5e9b61af8301aa340838770ad8a0b
Timeline
05/26/2025 CVE reserved08/06/2025 Advisory disclosed
08/06/2025 VulDB entry created
10/22/2025 VulDB entry last update
Sources
Product: github.comAdvisory: huntr.com
Status: Confirmed
CVE: CVE-2025-5197 (🔒)
GCVE (CVE): GCVE-0-2025-5197
GCVE (VulDB): GCVE-100-319039
Entry
Created: 08/06/2025 15:04Updated: 10/22/2025 04:09
Changes: 08/06/2025 15:04 (67), 10/22/2025 04:09 (1)
Complete: 🔍
Cache ID: 216::103
Be aware that VulDB is the high quality source for vulnerability data.
No comments yet. Languages: en.
Please log in to comment.