# CVE-2024-12720: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

> CVE-2024-12720: Regular Expression Denial of Service (ReDoS) in huggingface/transformers. CVSS 5.3 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2024-12720
Last updated: 2026-06-17T07:00:20Z

- Published: 2025-03-20 10:11 UTC · Updated: 2026-06-17 07:00 UTC · Assigner: @huntr\_ai
- CVSS: 5.3 (CVSS 3.1) · Severity: Medium · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- EPSS: 0.75%, 55th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-1333

## 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).

## Affected vendors and products

- huggingface: huggingface/transformers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2024-12720)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2024-12720)
- [https://github.com/huggingface/transformers/commit/deac971c469bcbb182c2e52da0b82fb3bf54cccf](https://github.com/huggingface/transformers/commit/deac971c469bcbb182c2e52da0b82fb3bf54cccf)
- [https://huntr.com/bounties/4bed1214-7835-4252-a853-22bbad891f98](https://huntr.com/bounties/4bed1214-7835-4252-a853-22bbad891f98)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2024-12720 · Markdown: https://rewindex.com/cve/CVE-2024-12720.md · JSON: https://rewindex.com/api/v1/cves/CVE-2024-12720 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T02:16:22.602Z
