{"id":"CVE-2024-12720","published":"2025-03-20T10:11:15Z","modified":"2025-03-20T13:25:27Z","title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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).","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00806,"percentile":0.53644,"provenance":"source"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://huntr.com/bounties/4bed1214-7835-4252-a853-22bbad891f98","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/deac971c469bcbb182c2e52da0b82fb3bf54cccf","tags":[]}],"priority":{"score":14.4,"factors":[{"name":"EPSS percentile","points":10.73},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < 4.48.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-03-20T13:25:17.543430Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<4.48.0"],"patched":["4.48.0"],"from":["GHSA-6rvg-6v2m-4j46","PYSEC-2026-1982"],"provenance":"source"}],"summary":{"text":"A Regular Expression Denial of Service (ReDoS) flaw exists in the huggingface/transformers library, within the post_process_single() function of tokenization_nougat_fast.py, where a regular expression exhibits exponential backtracking when processing specially crafted input. An attacker able to supply such input over the network, without authentication or user interaction, can drive excessive CPU consumption and cause application unavailability.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:36:20Z"},"euvd":{"id":"EUVD-2025-7016","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-huggingface-transformers-cve-2024-12720","children":[{"from":"CVE-2024-12720","to":"CVE-2025-1194","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/transformers/models/nougat/tokenization_nougat_fast.py"],"commits":["https://github.com/huggingface/transformers/commit/deac971c469bcbb182c2e52da0b82fb3bf54cccf","https://github.com/huggingface/transformers/commit/92c5ca9dd70de3ade2af2eb835c96215cc50e815"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.59,"basis":"same product + CWE + description similarity"}]}]}}