Bug 2397617 (CVE-2025-6921) - CVE-2025-6921 transformers: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Summary: CVE-2025-6921 transformers: Regular Expression Denial of Service (ReDoS) in h...
Keywords:
Status: NEW
Alias: CVE-2025-6921
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-09-23 14:01 UTC by OSIDB Bzimport
Modified: 2025-09-23 16:56 UTC (History)
38 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-09-23 14:01:28 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.