CVE-2025-5197
mediumpriority · track · 0EPSS 0.004 · 36 %ileEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
advisories (2)
Vendor and ecosystem advisories describing this.
- GHSA-9356-575x-2w9mHugging Face Transformers Regular Expression Denial of Service (ReDoS) vulnerability2025-08-06ghsa · osvUS
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.
- PYSEC-2026-1983Hugging Face Transformers Regular Expression Denial of Service (ReDoS) vulnerability2026-07-07vendor · osvUS
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.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (8)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2025-5197cnnvd
- https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0bcnnvd
- https://github.com/huggingface/transformers/releasesPatchcnnvd
- https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bfcnnvd
- https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0benisa_euvd
- https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bfenisa_euvd
- https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0bPatchnvd
- https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bfExploitIssue TrackingPatchThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan