CVE-2025-6921
published medium CVSS 3.0 · 5.3Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| huggingface | — | huggingface/transformersunspecified to < 4.53.0 | Affected | Not stated | @huntr_ai |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-transformersaarch64 | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-transformersppc64le | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-transformerss390x | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-transformersx86_64 | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-transformersaarch64 | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-transformersppc64le | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-transformerss390x | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
Show 1 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-transformersx86_64 | Advisory build | 5.15.0-1.1 | OPENSUSE-SU-2026:11499-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.0
- Base score
- 5.3 / 10
- Severity
- medium
- Provider
- @huntr_ai · cna
- Vector string
- CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| huggingface | huggingface/transformers | unspecified to < 4.53.0 (affected · custom) | @huntr_ai · cna |
Weaknesses
1- CWE-400 CWE-400 Uncontrolled Resource Consumption
References
2Provider assertions
2@huntr_ai · cna
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 7218bca8451e03e4739a057039ea19b92993dd55d685e17d955bc53b11d04d5c
- Ingested
- 23 Sep 2026, 08:57:58 UTC
- Source record
- Official CVE record