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

- Severity: Medium 5.3 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.45%, higher than 40% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-08-06T11:53:37.232Z
- Modified: 2026-09-10T03:50:26.988Z
- Also known as: GHSA-9356-575x-2w9m, PYSEC-2026-1983
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- huggingface huggingface/transformers: from unspecified before 4.53.0
- transformers (PyPI): before 4.53.0
- huggingface transformers: before 4.53.0

## Every score

- @huntr_ai: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- PyPA Advisory Database: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf> (exploit, issue-tracking, patch, third-party-advisory, web)
- <https://github.com/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0b> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-5197> (advisory)
- <https://github.com/huggingface/transformers/commit/701caef704e356dc2f9331cc3fd5df0eccb4720a> (web)
- <https://github.com/huggingface/transformers> (package)
- <https://pypi.org/project/transformers> (package)
- <https://github.com/advisories/GHSA-9356-575x-2w9m> (advisory)

## Sources

- CVE List: [CVE-2025-5197](https://www.cve.org/CVERecord?id=CVE-2025-5197), CVE Terms of Use, modified 2025-08-06
- GitHub Advisory Database: [GHSA-9356-575x-2w9m](https://github.com/advisories/GHSA-9356-575x-2w9m), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-5197](https://nvd.nist.gov/vuln/detail/CVE-2025-5197), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1983](https://osv.dev/vulnerability/PYSEC-2026-1983), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-5197 · Whole record: https://cve.day/CVE-2025-5197.json · Rebuilt by cve.day 2026-11-25T22:59:02.149Z
