CVE-2025-2099: Hugging Face Transformers Regular Expression Denial of Service
5.3
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.22872%
CWE
Published
5/19/2025
Updated
5/19/2025
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
transformers | pip | < 4.50.0 | 4.50.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability description explicitly mentions the preprocess_string()
function in the transformers.testing_utils
module as being vulnerable due to a ReDoS attack vector in its regular expression. The provided commit patch directly modifies this function and the problematic regular expression. The patch changes the regex codeblock_pattern
and how it's used with re.split
, confirming that preprocess_string
is the function where the vulnerability existed and was subsequently fixed. The evidence is directly from the commit diff showing the regex change within this specific function.