CVE-2025-5197 json
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
published 2025-08-06 15 mo ago modified 2026-09-10 1 mo ago also GHSA-9356-575x-2w9m , PYSEC-2026-1983 , EUVD-2025-23827
- cvss
- 5.3
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 39%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi transformers 4.53.0
- huggingface huggingface/transformers 4.53.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-5197 updated cvss 5.3
transformers: Transformers ReDoS Vulnerability
-
Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-service-api-rhel9, openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 Red Hat AI Inference Server rhaiis/vllm-rocm-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform-24/de-minimal-rhel8, ansible-automation-platform-24/de-minimal-rhel9, ansible-automation-platform-24/lightspeed-rhel8, ansible-automation-platform-25/de-minimal-rhel8, ansible-automation-platform-25/de-minimal-rhel9, ansible-automation-platform-25/lightspeed-rhel8, +9 more Red Hat Enterprise Linux AI (RHEL AI) rhelai1/gemma-2-9b-it, rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/gemma-2-9b-it-fp8, rhelai1/skills-adapter-v3, rhelai1/bootc-nvidia-rhel9, +24 more Red Hat OpenShift AI (RHOAI) rhoai/odh-rhel8-operator, rhoai/odh-rhel9-operator, rhoai/odh-dashboard-rhel8, rhoai/odh-modelmesh-rhel8, rhoai/odh-modelmesh-rhel9, rhoai/odh-mm-rest-proxy-rhel8, +40 moreaffected: workaround, no fix available “Fix deferred”
-
Red Hat AI Inference Server rhaiis/vllm-cuda-rhel9not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 15 mo ago
Exploit prediction
0.45% chance of exploitation in the next 30 days, higher than 39% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.com https://huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| OSV | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | transformers | <4.53.0 |
4.53.0 |
Affected products
- huggingface huggingface/transformers
Classification
- Weakness
-
- CWE-1333 Inefficient Regular Expression Complexity
References
-
github.com
/huggingface/transformers/commit/944b56000be5e9b61af8301aa340838770ad8a0b
web, patch
-
huntr.com
/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bf
exploit, web, issue-tracking, patch, third-party-advisory
-
github.com
/huggingface/transformers/commit/701caef704e356dc2f9331cc3fd5df0eccb4720a
web
-
nvd.nist.gov
/vuln/detail/CVE-2025-5197
advisory
-
github.com
/huggingface/transformers
package
-
pypi.org
/project/transformers
package
-
github.com
/advisories/GHSA-9356-575x-2w9m
advisory
Sources
- CVE List CVE-2025-5197
- GitHub Advisory GHSA-9356-575x-2w9m
- NVD CVE-2025-5197
- OSV PYSEC-2026-1983
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.