CVE-2025-5197: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Vulnerability summary
CVE-2025-5197 is a medium (CVSS 5.3) vulnerability in huggingface huggingface/transformers. EPSS estimates a 0.42% chance of exploitation in the next 30 days, higher than 36.2% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 0 · Related 3Timeline
- 06-08-2025PublishedVulnerability first disclosed.
- 06-08-2025Last modifiedVulnerability information updated.
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 metrics
4 scores · 4 sources · 1 version- OSV · PypiEcosystem advisory · calculated5.3MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- OSV · ChainguardEcosystem advisory · calculated5.3MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- NVDNIST5.3MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS trend
Probability
0.42%
Chance of exploitation in the next 30 days
Percentile
36%
Versus all other CVEs
30-day change
Increase +0.02 pp
From 0.40% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundExploit Reference (huntr.com)
Maturity: unknown
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Chainguard7 products
- nemo< 2.4.0-r5
- py3.10-transformers-4.51All versions (No fix recorded)
- py3.11-transformers-4.51All versions (No fix recorded)
- py3.12-transformers-4.51All versions (No fix recorded)
- py3.13-transformers-4.51All versions (No fix recorded)
Huggingface2 products
- huggingface/transformers≥ unspecified, < 4.53.0
- transformers< 4.53.0
PyPI1 product
- transformers< 4.53.0
3 vendors · 10 products
References
8 links- huntr.com/bounties/3f8b3fd0-166b-46e7-b60f-60dd9d2678bfWEBExploitIssue TrackingPatchThird Party Advisory