7.5

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

Analyzed
AliasesGHSA-4w7r-h757-3r74PYSEC-2026-1980openSUSE-SU-2026:11499-1
Published 23-09-2025Last modified 23-09-2025

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.

Priority
Routine

Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
7.5/10
010
High · v3.1 (NVD)
EPSS score
0.51%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits1reference

Advisory lineage

Upstream 0 · Downstream 0 · Related 2

Timeline

  1. 23-09-2025
    PublishedVulnerability first disclosed.
  2. 23-09-2025
    Last 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

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

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • referenceUnverified

    Exploit Reference (huntr.com)

    Maturity: unknown

Weaknesses

CWE · root cause

Affected systems

Version check

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
Opensuse1 product
  • python-transformers&distro=openSUSE Tumbleweed< 5.15.0-1.1
PyPI1 product
  • transformers< 4.53.0

4 vendors · 10 products

References

9 links