Vulnerabilities

Vulnerability · 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.

Published Sep 23, 2025 · catalog updated Sep 23, 2025 · The huggingface/transformers library, versions

Last checked Oct 29, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2025-6921. EPSS is 0.51%. Act only if a listed version of The huggingface/transformers library, versions is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (The huggingface/transformers library, versions).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.

Same product and reporting

Severity
Medium5.3
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.51%
Remediation
Version ranges on file
Affected products
vendor huggingface huggingface/transformers unspecified <4.53.0

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 t

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • vendor huggingface huggingface/transformers unspecified <4.53.0unspecified <4.53.0

How to fix CVE-2025-6921

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2025-6921. EPSS is 0.51%. Act only if a listed version of The huggingface/transformers library, versions is installed.

Which versions are affected?

Compare what you have installed with huggingface huggingface/transformers unspecified <4.53.0 unspecified <4.53.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

No weakness class is stored. EPSS 0.51%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Sep 23, 2025 · EUVD

    Detected

    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 back

  2. Sep 23, 2025 · EUVD

    Updated

    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 back

Sources

  • CVE.orgVulnerability recordCVE-2025-6921

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2025-6921

    30-day exploitation probability 0.51%

    first.org
  • EUVDVulnerability recordEUVD-2025-30889

    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 th

    euvd.enisa.europa.eu

References

Freshness

Last verified in this catalog Oct 29, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSOct 29, 2026
  • CVE.orgOct 23, 2026
  • EUVDOct 23, 2026