Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Published Jul 7, 2025
5.3
MEDIUMCVSS 3.0
EPSS 0.46%
Description
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the `get_imports()` function within `dynamic_module_utils.py`. This vulnerability affects versions 4.49.0 and is fixed in version 4.51.0. The issue arises from a regular expression pattern `\s*try\s*:.*?except.*?:` used to filter out try/except blocks from Python code, which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to remote code loading disruption, resource exhaustion in model serving, supply chain attack vectors, and development pipeline disruption.
Affected products
-
- Version unspecifiedStatusaffectedConstraints<4.51.0
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Huggingface | Huggingface/transformers | n/a |
|
- ≥ 4.49.0 · < 4.51.0
No data.
OpenShift Lightspeed
openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9
Not affected
OpenShift Lightspeed
openshift-lightspeed/lightspeed-service-api-rhel9
Not affected
Red Hat AI Inference Server
rhaiis/vllm-cuda-rhel9
Not affected
Red Hat AI Inference Server
rhaiis/vllm-rocm-rhel9
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-24/de-minimal-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-24/de-minimal-rhel9
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-24/ee-supported-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-24/ee-supported-rhel9
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/aap-cloud-metrics-collector-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/ansible-dev-tools-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/de-minimal-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/de-minimal-rhel9
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/ee-supported-rhel8
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/ee-supported-rhel9
Not affected
Red Hat Ansible Automation Platform 2
ansible-automation-platform-25/lightspeed-chatbot-rhel8
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-amd-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-aws-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-azure-amd-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-azure-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-gcp-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-intel-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/bootc-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/disk-image-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/gemma-2-9b-it
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/gemma-2-9b-it-fp8
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/granite-3.1-8b-lab-v2.1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/granite-3.1-8b-starter-v2.1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/instructlab-amd-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/instructlab-intel-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/instructlab-nvidia-rhel9
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/knowledge-adapter-v3
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/mixtral-8x7b-instruct-v0-1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-gemma-2-9b-it
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-gemma-2-9b-it-fp8
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-granite-3-1-8b-lab-v2
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-granite-3-1-8b-lab-v2-1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-granite-3-1-8b-starter-v2
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-granite-3-1-8b-starter-v2-1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-knowledge-adapter-v3
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-mixtral-8x7b-instruct-v0-1
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-prometheus-8x7b-v2-0
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-skills-adapter-v3
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/modelcar-snowflake-arctic-embed-l-v2.0
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/prometheus-8x7b-v2-0
Not affected
Red Hat Enterprise Linux AI (RHEL AI)
rhelai1/skills-adapter-v3
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-codeflare-operator-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-data-science-pipelines-operator-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-kf-notebook-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-kuberay-operator-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-kueue-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-ml-pipelines-runtime-generic-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-mlmd-grpc-server-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-mm-rest-proxy-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-model-registry-operator-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-model-registry-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-modelmesh-serving-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-notebook-controller-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-training-operator-rhel8
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-training-operator-rhel9
Not affected
Red Hat OpenShift AI (RHOAI)
rhoai/odh-trustyai-service-operator-rhel9
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| OpenShift Lightspeed | openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 | Not affected | n/a |
| OpenShift Lightspeed | openshift-lightspeed/lightspeed-service-api-rhel9 | Not affected | n/a |
| Red Hat AI Inference Server | rhaiis/vllm-cuda-rhel9 | Not affected | n/a |
| Red Hat AI Inference Server | rhaiis/vllm-rocm-rhel9 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/de-minimal-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/de-minimal-rhel9 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/ee-supported-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/ee-supported-rhel9 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/aap-cloud-metrics-collector-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/ansible-dev-tools-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/de-minimal-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/de-minimal-rhel9 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/ee-supported-rhel8 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/ee-supported-rhel9 | Not affected | n/a |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/lightspeed-chatbot-rhel8 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-amd-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-aws-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-amd-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-gcp-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-intel-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/disk-image-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/gemma-2-9b-it | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/gemma-2-9b-it-fp8 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/granite-3.1-8b-lab-v2.1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/granite-3.1-8b-starter-v2.1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-amd-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-intel-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-nvidia-rhel9 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/knowledge-adapter-v3 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/mixtral-8x7b-instruct-v0-1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-gemma-2-9b-it | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-gemma-2-9b-it-fp8 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-granite-3-1-8b-lab-v2 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-granite-3-1-8b-lab-v2-1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-granite-3-1-8b-starter-v2 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-granite-3-1-8b-starter-v2-1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-knowledge-adapter-v3 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-mixtral-8x7b-instruct-v0-1 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-prometheus-8x7b-v2-0 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-skills-adapter-v3 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/modelcar-snowflake-arctic-embed-l-v2.0 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/prometheus-8x7b-v2-0 | Not affected | n/a |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/skills-adapter-v3 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-codeflare-operator-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-data-science-pipelines-operator-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-kf-notebook-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-kuberay-operator-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-kueue-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-runtime-generic-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-mlmd-grpc-server-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-mm-rest-proxy-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-model-registry-operator-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-model-registry-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-modelmesh-serving-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-notebook-controller-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-training-operator-rhel8 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-training-operator-rhel9 | Not affected | n/a |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-trustyai-service-operator-rhel9 | Not affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
References (9)
- https://access.redhat.com/security/cve/CVE-2025-3264 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2376768 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-20214 Advisory
- https://github.com/advisories/GHSA-jjph-296x-mrcr Advisory
- https://github.com/huggingface/transformers/commit/0720e206c6ba28887e4d60ef60a6a089f6c1cc76 Patch
- https://github.com/huggingface/transformers/commit/126abe3461762e5fc180e7e614391d1b4ab051ca
- https://huntr.com/bounties/3c6f7822-9992-476d-8cf0-b0b1623427df ExploitThird Party Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2025-3264
- https://www.cve.org/CVERecord?id=CVE-2025-3264
Change history (0)
No recorded changes yet.