CVE-2025-6638

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

Published Sep 12, 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 Hugging Face Transformers library, specifically affecting the MarianTokenizer's `remove_language_code()` method. This vulnerability is present in version 4.52.4 and has been fixed in version 4.53.0. The issue arises from inefficient regex processing, which can be exploited by crafted input strings containing malformed language code patterns, leading to excessive CPU consumption and potential denial of service.

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-29032 Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer
Github GHSA Github GHSA GHSA-59p9-h35m-wg4g Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer
History
Type Values Removed Values Added
CPEs cpe:2.3:a:huggingface:transformers:4.52.4:*:*:*:*:*:*:*
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
First Time appeared Huggingface
Huggingface transformers
Vendors & Products Huggingface
Huggingface transformers
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 Hugging Face Transformers library, specifically affecting the MarianTokenizer's `remove_language_code()` method. This vulnerability is present in version 4.52.4 and has been fixed in version 4.53.0. The issue arises from inefficient regex processing, which can be exploited by crafted input strings containing malformed language code patterns, leading to excessive CPU consumption and potential denial of service.
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
Sep 12, 2025, 11:52 AM
Reserved
Jun 25, 2025, 2:07 PM
Status
Analyzed
Published
Sep 12, 2025, 11:15 AM
Modified
Jun 17, 2026, 10:02 AM
Severity
Moderate
Public date
Sep 12, 2025, 10:46 AM