CVE-2024-12720
JSON

5.3medium

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Severity
5.3medium CVSS:3.0 by @huntr_ai
Exploit likelihood
0.75% (higher than 56% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
@huntr_ai
Also known as
GHSA-6rvg-6v2m-4j46PYSEC-2026-1982

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

Product or packageVersionsReported by
huggingface huggingface/transformersfrom unspecified before 4.48.0CVE List
transformers (PyPI)before 4.48.0GitHub Advisory Database, PyPA Advisory Database
huggingface transformersbefore 4.48.0NVD

All scores

@huntr_ai5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory Database5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

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

GitHub Advisory Database

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.

NVD (es)

Se identificó una vulnerabilidad de denegación de servicio por expresión regular (ReDoS) en la librería huggingface/transformers, concretamente en el archivo tokenization_nougat_fast.py. La vulnerabilidad se produce en la función post_process_single(), donde una expresión regular procesa una entrada especialmente manipulada. El problema se debe a que la expresión regular presenta una complejidad temporal exponencial en determinadas condiciones, lo que provoca un retroceso excesivo. Esto puede resultar en un uso de CPU significativamente alto y un posible tiempo de inactividad de la aplicación, creando así un escenario de denegación de servicio (DoS). La versión afectada es la v4.46.3 (última versión).

References

Sources

SourceRecordLicence
CVE ListCVE-2024-12720 changed 2025-03-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-6rvg-6v2m-4j46 changed 2026-08-13CC-BY-4.0
NVDCVE-2024-12720 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1982 changed 2026-07-07CC-BY-4.0