CVE-2025-5197 Details
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.
A Regular Expression Denial-of-Service (ReDoS) vulnerability has been identified in the Hugging Face Transformers library, specifically in the 'convert_tf_weight_name_to_pt_weight_name()' function. This function, which converts TensorFlow weight names to PyTorch format, is vulnerable to catastrophic backtracking due to a regex pattern that can be exploited with crafted input strings. The vulnerability affects versions of the Transformers library prior to 4.51.3 and has been fixed in version 4.53.0. Exploiting this vulnerability can lead to excessive CPU consumption, causing service disruptions and resource exhaustion, particularly in environments that handle model conversion between TensorFlow and PyTorch.
Users can upgrade to Hugging Face Transformers version 4.53.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Aug 6, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf | CISA-ADP | ExploitIssue TrackingPatchThird Party Advisory |
| https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0b | [email protected] | Patch |
| https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf | [email protected] | ExploitIssue TrackingPatchThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1333 | Inefficient Regular Expression Complexity | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| huggingface transformers | < 4.53.0 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 21, 2025 | Initial Analysis | [email protected] |
| Aug 6, 2025 | CVE Modified | CISA-ADP |
| Aug 6, 2025 | New CVE Received | [email protected] |