CVE-2024-12720: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Vulnerability summary
CVE-2024-12720 is a high (CVSS 7.5) vulnerability in huggingface huggingface/transformers. EPSS estimates a 0.75% chance of exploitation in the next 30 days, higher than 54.9% of scored vulnerabilities.
Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 0 · Related 2Timeline
- 20-03-2025PublishedVulnerability first disclosed.
- 20-03-2025Last modifiedVulnerability information updated.
Description
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file tokenization_nougat_fast.py. The vulnerability occurs in the post_process_single() function, where a regular expression processes specially crafted input. The issue stems from the regex exhibiting exponential time complexity under certain conditions, leading to excessive backtracking. This can result in significantly high CPU usage and potential application downtime, effectively creating a Denial of Service (DoS) scenario. The affected version is v4.46.3 (latest).
CVSS metrics
4 scores · 3 sources · 2 versions- OSV · PypiEcosystem advisory · calculated5.3MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- NVDNIST5.3MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS trend
Probability
0.75%
Chance of exploitation in the next 30 days
Percentile
55%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 0.73% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Huggingface2 products
- huggingface/transformers≥ unspecified, < 4.48.0
- transformers< 4.48.0
PyPI1 product
- transformers< 4.48.0
2 vendors · 3 products