CVE-2025-2099 Details
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.
A Regular Expression Denial-of-Service (ReDoS) vulnerability has been identified in the `preprocess_string()` function of the `transformers.testing_utils` module in Hugging Face Transformers version 4.48.3. The vulnerability arises from a regular expression used to process code blocks in docstrings, which contains nested quantifiers. This structure can lead to exponential backtracking when the input includes a large number of newline characters. An attacker could exploit this by sending specially crafted payloads, causing significant CPU usage and potential application downtime, thereby creating a Denial-of-Service scenario.
Users can upgrade to Hugging Face Transformers version 4.50.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 19, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57 | [email protected] | Patch |
| https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4 | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1333 | Inefficient Regular Expression Complexity | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| huggingface transformers | <= 4.48.3 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 21, 2025 | Initial Analysis | [email protected] |
| May 19, 2025 | New CVE Received | [email protected] |