Skip to content
HighVulnerability

CVE-2025-6638: Hugging Face Transformers ReDoS in MarianTokenizer remove_language_code

Identifier
CVE-2025-6638
Published
Record updated
View JSON
Affected
  • transformers < 4.53.0
Fixed in
4.53.0
  • released June 26, 2025, 78 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.6%

Summary

CVE-2025-6638 is a Regular Expression Denial of Service (ReDoS) flaw in the Hugging Face Transformers library, affecting the MarianTokenizer's `remove_language_code()` method in version 4.52.4. Inefficient regex processing lets crafted input strings containing malformed language code patterns drive excessive CPU consumption, which can cause a denial of service. The weakness is classified as CWE-1333, and the fix is reported in version 4.53.0.

Mitigation

Fixed in 4.53.0.