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

- Severity: Medium 5.3 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.56%, higher than 47% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-09-12T10:46:07.934Z
- Modified: 2026-09-10T03:50:58.113Z
- Also known as: GHSA-59p9-h35m-wg4g, PYSEC-2026-1981
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- huggingface huggingface/transformers: from unspecified before 4.53.0
- transformers (PyPI): before 4.53.0
- huggingface transformers: 4.52.4

## Every score

- @huntr_ai: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://huntr.com/bounties/6a6c933f-9ce8-4ded-8b3b-2c1444c61f36> (exploit, third-party-advisory, web)
- <https://github.com/huggingface/transformers/commit/47c34fba5c303576560cb29767efb452ff12b8be> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-6638> (advisory)
- <https://github.com/huggingface/transformers/commit/d37f7517972f67e3f2194c000ed0f87f064e5099> (web)
- <https://github.com/huggingface/transformers> (package)
- <https://pypi.org/project/transformers> (package)
- <https://github.com/advisories/GHSA-59p9-h35m-wg4g> (advisory)

## Sources

- CVE List: [CVE-2025-6638](https://www.cve.org/CVERecord?id=CVE-2025-6638), CVE Terms of Use, modified 2025-09-12
- GitHub Advisory Database: [GHSA-59p9-h35m-wg4g](https://github.com/advisories/GHSA-59p9-h35m-wg4g), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-6638](https://nvd.nist.gov/vuln/detail/CVE-2025-6638), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1981](https://osv.dev/vulnerability/PYSEC-2026-1981), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-6638 · Whole record: https://cve.day/CVE-2025-6638.json · Rebuilt by cve.day 2026-11-25T22:59:04.597Z
