CVE-2025-6638: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Published Sep 12, 2025
·
Updated

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically affecting the MarianTokenizer's removelanguagecode() 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.

Affected Software

3 affected componentsFixes available
Hugging Face Transformers>=4.52.4<4.53.0
pip/transformers<4.53.0
4.53.0
huggingface transformers=4.52.4

Event History

Sep 12, 2025
CVE Published
via MITRE·10:46 AM
Data Sourced
via MITRE·10:46 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 AM
RemedyAffected Software
Advisory Published
via GitHub·12:30 PM
Data Sourced
via GitHub·12:30 PM
DescriptionSeverityWeaknessAffected Software
Aug 8, 57775
Event
via NVD·12:44 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-6638?

CVE-2025-6638 is classified as a high severity Regular Expression Denial of Service vulnerability.

2

How do I fix CVE-2025-6638?

To fix CVE-2025-6638, upgrade the Hugging Face Transformers library to version 4.53.0 or later.

3

Which versions of the Hugging Face Transformers library are affected by CVE-2025-6638?

CVE-2025-6638 affects versions 4.52.4 and earlier of the Hugging Face Transformers library.

4

What component of the Hugging Face Transformers library is impacted by CVE-2025-6638?

CVE-2025-6638 impacts the MarianTokenizer's remove_language_code() method in the Hugging Face Transformers library.

5

Is CVE-2025-6638 a code execution vulnerability?

No, CVE-2025-6638 is a Denial of Service vulnerability and does not allow for code execution.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203