Vulnerability · Published Sep 12, 2025 · Assigned by @huntr_ai
CVE-2025-6638Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Medium 5.3
In plain English
A medium-severity regular-expression denial of service in huggingface/transformers from huggingface. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 46% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | transformers | 4.53.0 | GHSA-59p9-h35m-wg4g |
| PyPI | transformers | 4.53.0 | PYSEC-2026-1981 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| huggingface | huggingface/transformers | unspecified – before 4.53.0 |
Weakness: CWE-1333 · Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L