CVE-2024-12720
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Reported by @huntr_ai · Published March 20, 2025
transformers is fixed in 4.48.0 (PyPI)
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).
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| transformers | PyPI | 4.48.0 |
| tritonserver-backend-tensorrtllm-24.04 | Chainguard | 0.9.0-r4 |
| transformers | huggingface | 4.48.0 |
| huggingface/transformers | huggingface | 4.48.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| huggingface | huggingface/transformers | unspecified |
| huggingface | huggingface/transformers | * |
Timeline
- Mar 20, 2025 CVE Published
- Mar 20, 2025 EPSS Score (30 in total, the first dated here)
- Mar 27, 2025 Coalition ESS Score (20 in total, the first dated here)
- Mar 10, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-12720
vulnetix vdb fixes CVE-2024-12720
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-12720/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart