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

Published Mar 20, 2025
·
Updated

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file tokenizationnougatfast.py. The vulnerability occurs in the postprocesssingle() 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 Software

3 affected componentsFixes available
Hugging Face Transformers
pip/transformers<4.48.0
4.48.0
huggingface transformers<4.48.0

Event History

Mar 20, 2025
CVE Published
via MITRE·10:11 AM
Data Sourced
via MITRE·10:11 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:15 AM
RemedyAffected Software
Advisory Published
via GitHub·12:32 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-12720?

CVE-2024-12720 is classified as a Regular Expression Denial of Service (ReDoS) vulnerability.

2

How do I fix CVE-2024-12720?

To fix CVE-2024-12720, update the huggingface/transformers library to the latest version where the vulnerability has been addressed.

3

What specific function is affected by CVE-2024-12720?

CVE-2024-12720 affects the post_process_single() function in the tokenization_nougat_fast.py file.

4

What library is impacted by CVE-2024-12720?

CVE-2024-12720 impacts the huggingface/transformers library.

5

What type of attack can be executed due to CVE-2024-12720?

CVE-2024-12720 allows attackers to perform a Denial of Service (DoS) by exploiting the vulnerable regular expression.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203