CVE-2025-2099: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
A vulnerability in the preprocessstring() function of the transformers.testingutils module in huggingface/transformers version v4.48.3 allows for a Regular Expression Denial of Service (ReDoS) attack. The regular expression used to process code blocks in docstrings contains nested quantifiers, leading to exponential backtracking when processing input with a large number of newline characters. An attacker can exploit this by providing a specially crafted payload, causing high CPU usage and potential application downtime, effectively resulting in a Denial of Service (DoS) scenario.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2025-2099?
The severity of CVE-2025-2099 is classified as moderate due to its potential for causing a Denial of Service through regular expressions.
How do I fix CVE-2025-2099?
To fix CVE-2025-2099, update the Hugging Face transformers library to a version that patches the vulnerability.
Which version of Hugging Face transformers is affected by CVE-2025-2099?
CVE-2025-2099 affects Hugging Face transformers version v4.48.3.
What type of attack does CVE-2025-2099 allow?
CVE-2025-2099 allows for a Regular Expression Denial of Service (ReDoS) attack.
Where is the vulnerable function located in Hugging Face transformers for CVE-2025-2099?
The vulnerable function for CVE-2025-2099 is located in the `preprocess_string()` function of the `transformers.testing_utils` module.