CVE-2025-2099CWE-1333

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Medium · published May 19, 2025

CVSS v3.0
5.3
EPSS
1%
Percentile
48.4
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.0
5.3 · MEDIUM
Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS v4.0
Not supplied
EPSS
0.00608 · 48.4th percentile
Weakness
CWE-1333 · Inefficient Regular Expression Complexity
Published
2025-05-19T11:22Z
EPSS history
Timeline
  • 19 MAY 11:22Z
    Regular Expression Denial of Service (ReDoS) in huggingface/transformers
    cvelistv5