CVE-2025-2099
May 19, 2025
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 Packages
transformers (CONDA):
Affected version(s) >=2.1.1 <4.50.0Fix Suggestion:
Update to version 4.50.0https://github.com/huggingface/transformers.git (GITHUB):
Affected version(s) Fix Suggestion:
Update to version v4.50.0transformers (PYTHON):
Affected version(s) >=0.1 <4.50.0Fix Suggestion:
Update to version 4.50.0Related Resources (6)
Do you need more information?
Contact UsCVSS v4
Base Score:
6.9
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
NONE
Vulnerable System Integrity
NONE
Vulnerable System Availability
LOW
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.5
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Weakness Type (CWE)
Inefficient Regular Expression Complexity
EPSS
Base Score:
0.1