CVE-2025-6921
CVE-2025-6921 is a high-severity vulnerability in Huggingface Transformers with a CVSS 3.x base score of 7.5. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-400.
Key facts
- Severity: High (CVSS 3.x base score 7.5)
- EPSS exploit prediction: 0% (37th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2025-30889
- Weakness: CWE-400
- Affected product: Huggingface Transformers
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2025-6921?
- 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.
- How severe is CVE-2025-6921?
- CVE-2025-6921 has a CVSS 3.x base score of 7.5, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is none, integrity none, and availability high.
- Is CVE-2025-6921 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (37th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2025-6921?
- CVE-2025-6921 affects Huggingface Transformers. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2025-6921?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2025-6921 have an EU (EUVD) identifier?
- Yes. CVE-2025-6921 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2025-30889.
- When was CVE-2025-6921 published?
- CVE-2025-6921 was published on 2025-09-23 and last updated on 2026-06-17.
References
- https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be
- https://huntr.com/bounties/287d15a7-6e7c-45d2-8c05-11e305776f1f
Affected products (1)
- cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*
More vulnerabilities in Huggingface Transformers
- CVE-2026-5241 — Critical (CVSS 9.6): A vulnerability in the LightGlue model loading path of huggingface/transformers version 5.2.0 allows an…
- CVE-2024-3568 — Critical (CVSS 9.6): The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted…
- CVE-2024-11394 — High (CVSS 8.8): Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2024-11393 — High (CVSS 8.8): Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2024-11392 — High (CVSS 8.8): Hugging Face Transformers MobileViTV2 Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2023-6730 — High (CVSS 8.8): Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.
All CVEs affecting Huggingface Transformers →
Other CWE-400 (Uncontrolled Resource Consumption) vulnerabilities
- CVE-2026-46775 — Critical (CVSS 9.9): Vulnerability in Oracle REST Data Services (component: Core). Supported versions that are affected are 24.2.0-26.1.0.…
- CVE-2025-61303 — Critical (CVSS 9.8): Hatching Triage Sandbox Windows 10 build 2004 (2025-08-14) and Windows 10 LTSC 2021(2025-08-14) contains a…
- CVE-2025-43193 — Critical (CVSS 9.8): The issue was addressed with improved memory handling. This issue is fixed in macOS Sequoia 15.6, macOS Sonoma 14.7.7,…
- CVE-2025-24269 — Critical (CVSS 9.8): The issue was addressed with improved memory handling. This issue is fixed in macOS Sequoia 15.4. An app may be able to…
- CVE-2025-24264 — Critical (CVSS 9.8): The issue was addressed with improved memory handling. This issue is fixed in Safari 18.4, iOS 18.4 and iPadOS 18.4,…
- CVE-2025-24260 — Critical (CVSS 9.8): The issue was addressed with improved memory handling. This issue is fixed in macOS Sequoia 15.4, macOS Sonoma 14.7.5,…
Browse all CWE-400 (Uncontrolled Resource Consumption) vulnerabilities →