PT-2025-21933 · Hugging Face · Transformers

Rocketknight1

·

Published

2025-05-19

·

Updated

2025-05-19

·

CVE-2025-2099

CVSS v3.1

7.5

High

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Name of the Vulnerable Software and Affected Versions huggingface/transformers version v4.48.3
Description A vulnerability in the preprocess string() function of the transformers.testing utils module 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.
Recommendations As a temporary workaround, consider disabling the preprocess string() function until a patch is available. Restrict access to the transformers.testing utils module to minimize the risk of exploitation. Avoid using the preprocess string() function in the affected API endpoint until the issue is resolved. At the moment, there is no information about a newer version that contains a fix for this vulnerability.

Exploit

DoS

Weakness Enumeration

Related Identifiers

CVE-2025-2099
GHSA-QQ3J-4F4F-9583
PYSEC-2025-40

Affected Products

Transformers