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.

Severity (CVSS 3.0)5.3Medium
Exploit odds (30 days)0.6%top 53.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
PyPItransformers4.53.0GHSA-59p9-h35m-wg4g
PyPItransformers4.53.0PYSEC-2026-1981

Affected products (as reported)

VendorProductVersions
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

References