Breaking News: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials
Read the Report
Learn How MCP Is Bypassing a Decade of Cloud Security Best Practices
Read the Report
Are you exposed? Connect a repo in minutes.
Scan your repos free

CVE-2025-6921

transformers: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Overview

Published
23 Sep 2025
Modified
11 Oct 2026
High CVE
1 Registry packages
3 OS packages
2 Linux distributions
Yes Fix available

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.

Source: OX vulnerability database

Severity

7.5 · HIGH

CVSS 3.1 base score, scored by NVD.

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weakness: CWE-400

Affected packages · 1

Packages affected by CVE-2025-6921
EcosystemPackageVulnerableFixed in
PyPI transformers <4.53.0 4.53.0

Open a package to see all its vulnerabilities.

Operating systems · 2 fixes

chainguard 1 release · 1 package

fixed 1
text-generation-inference
chainguard fixes for CVE-2025-6921
ReleasePackageFixed in
text-generation-inference 3.3.7-r9

openSUSE 1 release · 1 package

fixed 1
python313-transformers
openSUSE fixes for CVE-2025-6921
ReleasePackageFixed inAdvisory
Tumbleweed python313-transformers +1 5.15.0-1.1 openSUSE-SU-2026:11499-1

References

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.