Regular Expression Denial of Service in Hugging Face Transformers Library
CVE-2025-6638

5.3MEDIUM

Key Information:

Vendor
CVE Published:
12 September 2025

What is CVE-2025-6638?

A Regular Expression Denial of Service (ReDoS) vulnerability has been identified in the Hugging Face Transformers library, impacting the functionality of the MarianTokenizer's 'remove_language_code()' method. This flaw is triggered by inefficient regular expression processing, allowing an attacker to exploit the vulnerability using crafted input strings with malformed language code patterns. Such exploitation can lead to significant CPU resource exhaustion, resulting in potential denial of service for the application. The vulnerability is resolved in version 4.53.0, highlighting the importance of updating to the latest version to mitigate this risk.

Affected Version(s)

huggingface/transformers < 4.53.0

References

CVSS V3.0

Score:
5.3
Severity:
MEDIUM
Confidentiality:
None
Integrity:
None
Availability:
None
Attack Vector:
Network
Attack Complexity:
Low
Privileges Required:
None
User Interaction:
None
Scope:
Unchanged

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.
CVE-2025-6638 : Regular Expression Denial of Service in Hugging Face Transformers Library