# CVE-2025-5197: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

> CVE-2025-5197: Regular Expression Denial of Service (ReDoS) in huggingface/transformers. CVSS 5.3 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2025-5197
Last updated: 2026-06-17T09:47:25Z

- Published: 2025-08-06 11:53 UTC · Updated: 2026-06-17 09:47 UTC · Assigner: @huntr\_ai
- CVSS: 5.3 (CVSS 3.1) · Severity: Medium · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- EPSS: 0.39%, 33th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-1333

## 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 vendors and products

- huggingface: huggingface/transformers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2025-5197)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2025-5197)
- [https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0b](https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0b)
- [https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf](https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2025-5197 · Markdown: https://rewindex.com/cve/CVE-2025-5197.md · JSON: https://rewindex.com/api/v1/cves/CVE-2025-5197 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:10:15.597Z
