CVE-2025-6638
5.3medium
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
- Severity
- 5.3medium CVSS:3.0 by @huntr_ai
- Exploit likelihood
- 0.70% (higher than 49% of CVEs)
- Published
- Last changed
- Assigned by
- @huntr_ai
- Also known as
- GHSA-59p9-h35m-wg4gPYSEC-2026-1981
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
| Product or package | Versions | Reported by |
|---|---|---|
| huggingface huggingface/transformers | from unspecified before 4.53.0 | CVE List |
| transformers (PyPI) | before 4.53.0 | GitHub Advisory Database, PyPA Advisory Database |
| huggingface transformers | 4.52.4 | NVD |
All scores
| @huntr_ai | 5.3medium CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 5.3medium CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 5.3medium CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-6638 changed 2025-09-12 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-59p9-h35m-wg4g changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-6638 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1981 changed 2026-07-07 | CC-BY-4.0 |