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.
History

Wed, 21 May 2025 18:00:00 +0000

Type Values Removed Values Added
First Time appeared Huggingface
Huggingface transformers
CPEs cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*
Vendors & Products Huggingface
Huggingface transformers
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Tue, 20 May 2025 02:30:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 19 May 2025 19:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 19 May 2025 11:30:00 +0000

Type Values Removed Values Added
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.
Title Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Weaknesses CWE-1333
References
Metrics cvssV3_0

{'score': 5.3, 'vector': 'CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L'}


cve-icon MITRE

Status: PUBLISHED

Assigner: @huntr_ai

Published: 2025-05-19T11:22:36.908Z

Updated: 2025-05-19T13:45:13.385Z

Reserved: 2025-03-07T17:39:16.856Z

Link: CVE-2025-2099

cve-icon Vulnrichment

Updated: 2025-05-19T13:39:29.149Z

cve-icon NVD

Status : Analyzed

Published: 2025-05-19T12:15:19.640

Modified: 2025-05-21T17:43:15.080

Link: CVE-2025-2099

cve-icon Redhat

Severity : Moderate

Publid Date: 2025-05-19T11:22:36Z

Links: CVE-2025-2099 - Bugzilla