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.
Published: 2025-05-19
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

No vendor fix or workaround currently provided.

Additional remediation guidance may be available on OpenCVE Cloud.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
EUVD EUVD EUVD-2025-15691 Hugging Face Transformers Regular Expression Denial of Service
Github GHSA Github GHSA GHSA-qq3j-4f4f-9583 Hugging Face Transformers Regular Expression Denial of Service
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'}


Subscriptions

Huggingface Transformers
cve-icon MITRE

Status: PUBLISHED

Assigner: @huntr_ai

Published:

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

cve-icon OpenCVE Enrichment

No data.

Weaknesses