CVE-2024-12720
HIGH 7.5CVSS 3.1Transformers Regular Expression Denial of Service (ReDoS) vulnerability
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).
- Published
- 20 Mar 2025
- Last modified
- 13 Aug 2026
- Assigned by
- security@huntr.dev
- NVD status
- Analyzed
- Weakness
- CWE-1333
- Also known as
- GHSA-6rvg-6v2m-4j46PYSEC-2026-1982
- Sources
- NVDJSONOSV GHSA-6rvg-6v2m-4j46JSONOSV PYSEC-2026-1982JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | security@huntr.dev (Secondary) | CVSS 3.0 | MEDIUM 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| OSV | GitHub | CVSS 3.0 | MEDIUM 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| OSV | PyPA | CVSS 3.0 | MEDIUM 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | huggingface | transformerscpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:* |
< 4.48.0 | 4.48.0 |
| OSV | PyPI | transformers | < 4.48.0 | 4.48.0 |
References
- https://github.com/huggingface/transformers/commit/deac971c469bcbb182c2e52da0b82fb3bf54cccf · Patch, WEB
- https://huntr.com/bounties/4bed1214-7835-4252-a853-22bbad891f98 · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-12720 · ADVISORY
- https://github.com/huggingface/transformers · PACKAGE
- https://pypi.org/project/transformers · PACKAGE
- https://github.com/advisories/GHSA-6rvg-6v2m-4j46 · ADVISORY
History
- 25 Nov 2026 20:57 UTC · NVD: first stored (published 20 Mar 2025)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 7 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 20 Mar 2025)