CVE-2025-6921: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Vulnerability summary
CVE-2025-6921 is a high (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in huggingface huggingface/transformers. EPSS estimates a 0.51% chance of exploitation in the next 30 days, higher than 43.6% 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 2Timeline
- 23-09-2025PublishedVulnerability first disclosed.
- 23-09-2025Last modifiedVulnerability information updated.
Description
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. The vulnerability arises from the _do_use_weight_decay method, which processes user-controlled regular expressions in the include_in_weight_decay and exclude_from_weight_decay lists. Malicious regular expressions can cause catastrophic backtracking during the re.search call, leading to 100% CPU utilization and a denial of service. This issue can be exploited by attackers who can control the patterns in these lists, potentially causing the machine learning task to hang and rendering services unresponsive.
CVSS metrics
5 scores · 4 sources · 2 versions- 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.51%
Chance of exploitation in the next 30 days
Percentile
44%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.51% 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.
Chainguard6 products
- 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)
- text-generation-inference< 3.3.7-r8 | < 3.3.7-r9
Huggingface2 products
- huggingface/transformers≥ unspecified, < 4.53.0
- transformers< 4.53.0
Opensuse1 product
- python-transformers&distro=openSUSE Tumbleweed< 5.15.0-1.1
PyPI1 product
- transformers< 4.53.0
4 vendors · 10 products