CVE-2025-6921

HIGH CVSS 3.1: 7.5 EPSS 0.51%
Updated Oct 11, 2026
Huggingface
Parameter Value
CVSS 7.5 (HIGH)
Affected Versions before 4.53.0
Fixed In 4.53.0
Type CWE-400 (Uncontrolled Resource Consumption)
Vendor Huggingface
Public PoC No

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.

Attack Parameters

Attack Vector
Network
Can be exploited remotely
Attack Complexity
Low
Easy to exploit
Privileges Required
None
No privileges needed
User Interaction
None
No user interaction needed

Impact Assessment

Confidentiality
None
No data leak
Integrity
None
No data modification
Availability
High
Complete denial of service

CVSS Vector v3.1

Vulnerable Products 1

Configuration From (including) Up to (excluding)
Huggingface Transformers
cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*
— 4.53.0