Skip to content
Fencer Vulns
medium 5.3

CVE-2025-6638 json

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

published 2025-09-12 13 mo ago modified 2026-09-10 1 mo ago also GHSA-59p9-h35m-wg4g , PYSEC-2026-1981 , EUVD-2025-29032

cvss
5.3
version 3.0, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 46%
public exploits
0
none known

Summary

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.

Patch / fix

  • pypi transformers 4.53.0
  • huggingface huggingface/transformers 4.53.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2025-6638 updated cvss 5.3

transformers: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

  • Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-ocp-rag-rhel9, openshift-lightspeed/lightspeed-service-api-rhel9, openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 Red Hat AI Inference Server rhaiis/vllm-tpu-rhel9, rhaiis/vllm-cuda-rhel9, rhaiis/vllm-rocm-rhel9, rhaiis/vllm-spyre-rhel9, rhaiis/model-opt-cuda-rhel9, rhaiis-preview/vllm-cuda-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform-24/de-minimal-rhel8, ansible-automation-platform-24/ee-minimal-rhel8, ansible-automation-platform-24/de-supported-rhel8, ansible-automation-platform-24/ee-supported-rhel8, cloudservices/insights-automation-analytics-frontend, ansible-automation-platform-25/ansible-dev-tools-rhel8, +4 more Red Hat Enterprise Linux AI (RHEL AI) rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/bootc-nvidia-rhel9, rhelai1/bootc-azure-amd-rhel9, rhelai1/instructlab-amd-rhel9, rhelai1/bootc-aws-nvidia-rhel9, +4 more Red Hat Enterprise Linux AI (RHEL AI) 3 rhelai3/bootc-cuda-rhel9, rhelai3/bootc-aws-cuda-rhel9, rhelai3/bootc-gcp-cuda-rhel9, rhelai3/disk-image-cuda-rhel9, rhelai3/bootc-azure-cuda-rhel9 Red Hat OpenShift AI (RHOAI) rhoai/odh-vllm-cpu-rhel9, rhoai/odh-vllm-cuda-rhel9, rhoai/odh-vllm-rocm-rhel9, rhoai/odh-caikit-nlp-rhel9, rhoai/odh-vllm-gaudi-rhel9, rhoai/odh-ta-lmes-job-rhel9, +22 more
    affected: workaround, no fix available

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
yes
Technical impact
partial
Assessed
13 mo ago

Exploit prediction

0.56% chance of exploitation in the next 30 days, higher than 46% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • huntr.com https://huntr.com/bounties/6a6c933f-9ce8-4ded-8b3b-2c1444c61f36 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.0 5.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub 3.0 5.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
OSV 3.0 5.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Affected packages

ecosystem package affected fixed in
pypi transformers
<4.53.0
4.53.0

Affected products

  • huggingface huggingface/transformers

Classification

Weakness
  • CWE-1333 Inefficient Regular Expression Complexity

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.