CVE-2025-6638
JSON

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 packageVersionsReported by
huggingface huggingface/transformersfrom unspecified before 4.53.0CVE List
transformers (PyPI)before 4.53.0GitHub Advisory Database, PyPA Advisory Database
huggingface transformers4.52.4NVD

All scores

@huntr_ai5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory Database5.3medium CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-6638 changed 2025-09-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-59p9-h35m-wg4g changed 2026-09-10CC-BY-4.0
NVDCVE-2025-6638 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1981 changed 2026-07-07CC-BY-4.0