CVE-2025-5197
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-08-06

Last updated on: 2025-10-21

Assigner: huntr.dev

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-08-06
Last Modified
2025-10-21
Generated
2026-05-07
AI Q&A
2025-08-06
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
huggingface transformers to 4.53.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-1333 The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability is a Regular Expression Denial of Service (ReDoS) in the Hugging Face Transformers library. It occurs in the function convert_tf_weight_name_to_pt_weight_name(), which converts TensorFlow weight names to PyTorch format. The function uses a regex pattern that can be exploited with crafted input strings to cause excessive CPU usage due to catastrophic backtracking, leading to potential service disruption.


How can this vulnerability impact me? :

The vulnerability can cause excessive CPU consumption, leading to resource exhaustion and service disruption. It may affect API services involved in model conversion between TensorFlow and PyTorch formats, potentially making these services unavailable or degraded.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, upgrade the Hugging Face Transformers library to version 4.53.0 or later, where the issue is fixed. Avoid processing untrusted or crafted input strings that could trigger the ReDoS vulnerability until the upgrade is applied.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart