CVE-2025-3262

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

Published Jul 7, 2025 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2025-20217 Transformers vulnerable to ReDoS attack through its SETTING_RE variable
Github GHSA Github GHSA GHSA-489j-g2vx-39wf Transformers vulnerable to ReDoS attack through its SETTING_RE variable
History
Type Values Removed Values Added
CPEs cpe:2.3:a: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'}

Type Values Removed Values Added
Metrics epss

{'score': 0.00042}

epss

{'score': 0.00055}

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Description A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.
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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
@huntr_ai
Published
Updated
Jul 7, 2025, 3:19 PM
Reserved
Apr 4, 2025, 12:40 PM
Status
Analyzed
Published
Jul 7, 2025, 10:15 AM
Modified
Jun 17, 2026, 9:19 AM
Severity
Moderate
Public date
Jul 7, 2025, 9:54 AM