5.3
Medium
CVE-2025-2099 A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` module in…
Description
A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` 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 products and versions
| Product | Affected versions | Fixed in |
|---|---|---|
| huggingface/transformers 4.50 | earliest → < 4.50.0 | 4.50.0 |
References
- huntr.com huntr.com
- github.com github.com
Timeline
- Published
- Last modified
Other CVEs of huggingface/transformers
The 20 CVEs of huggingface/transformers →
CVE-2026-9856
A vulnerability in huggingface/transformers…
7.1
High
CVE-2026-5241
A vulnerability in the LightGlue model loading path of huggingface/transformers version 5.2.0 allows an…
8.0
High
CVE-2026-4372
A critical remote code execution vulnerability exists in all versions of the HuggingFace transformers library prior to…
7.8
High
CVE-2026-1839
A vulnerability in the HuggingFace Transformers library, specifically in the `Trainer` class, allows for arbitrary…
6.5
Medium