Vulnerability 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.
CVSS Score
HIGH
Affected Products
| Vendor | Product | Versions |
|---|---|---|
| Huggingface | Transformers | 4.52.4 |
Related Weaknesses (CWE)
References
- https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efbPatch
- https://huntr.com/bounties/6a6c933f-9ce8-4ded-8b3b-2c1444c61f36ExploitThird Party Advisory
FAQ
What is CVE-2025-6638?
CVE-2025-6638 is a vulnerability with a CVSS score of 7.5 (HIGH). 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...
How severe is CVE-2025-6638?
CVE-2025-6638 has been rated HIGH with a CVSS base score of 7.5/10. Review the CVSS metrics above for detailed severity breakdown.
Is there a patch for CVE-2025-6638?
Check the references section above for vendor advisories and patch information. Affected products include: Huggingface Transformers.