Skip to main content

Transformers

21 CVEs product

Monthly

CVE-2026-80047 Sep 01, 13:40 PyPI HIGH GHSA This Week

Write-before-consent in Hugging Face Transformers' GenerativePreTrainedModel.load_custom_generate() allows attacker-controlled Python files to be silently written to ~/.cache/huggingface/modules/ even when the user declines the trust prompt. Affected versions span 4.49.0 through 5.8.1. While immediate execution is blocked by the trust gate, the persisted cache file creates a stale-cache collision risk: subsequent loads of unrelated trusted models may inadvertently execute the previously cached, attacker-supplied Python code. No public exploit has been identified at time of analysis.

Authentication Bypass Python Red Hat Transformers
NVD GitHub VulDB
CVSS 3.1
7.8
EPSS
0.1%
CVE-2026-5241 Jun 03, 14:16 PyPI CRITICAL PATCH GHSA Act Now

Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explicit trust_remote_code=False safeguard when loading a LightGlue model via AutoModel.from_pretrained(). The LightGlueConfig deserializes the trust_remote_code flag from the untrusted config.json and propagates the attacker-controlled value into a nested AutoConfig.from_pretrained() call, enabling execution of arbitrary attacker-supplied Python during model initialization. Rated CVSS 9.6 (AV:N/AC:L/PR:N/UI:R) with publicly available exploit code exists via the Huntr disclosure, though EPSS is currently 0.07% (22th percentile) and the CVE is not on CISA KEV.

RCE Python Transformers Hugging Face
NVD GitHub VulDB
CVSS 3.1
9.6
EPSS
0.1%
CVE-2026-75104 Aug 17, 20:36 MEDIUM This Month

Arbitrary file read in Hugging Face Transformers allows an attacker who controls a model checkpoint index file to exfiltrate files from the host filesystem outside the intended model directory. The library fails to sanitize shard filenames in checkpoint index files before joining them to directory paths, meaning maliciously crafted entries containing parent-directory sequences or absolute paths resolve to unintended locations. Any user or automated pipeline that loads an attacker-supplied checkpoint - for example, by downloading a model from an untrusted Hub repository - can have host files disclosed without code execution. No public exploit has been identified at time of analysis, and the vulnerability is not listed in CISA KEV.

Path Traversal Transformers Hugging Face Checkpoint
NVD GitHub
CVSS 4.0
6.8
EPSS
0.2%
CVE-2025-6921 Sep 23, 14:15 PyPI HIGH POC PATCH This Week

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub VulDB
CVSS 3.1
7.5
EPSS
0.0%
CVE-2025-6051 Sep 14, 17:15 PyPI MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the `normalize_numbers()` method of the `EnglishNormalizer`. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub VulDB
CVSS 3.0
5.3
EPSS
0.0%
CVE-2025-6638 Sep 12, 11:15 PyPI HIGH POC PATCH This Month

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. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat AI / ML Transformers Hugging Face
NVD GitHub
CVSS 3.1
7.5
EPSS
0.0%
CVE-2025-5197 Aug 06, 12:15 PyPI MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library, specifically in the `convert_tf_weight_name_to_pt_weight_name()` function. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat AI / ML Pytorch Transformers +3
NVD GitHub
CVSS 3.0
5.3
EPSS
0.0%
CVE-2025-3933 Jul 11, 10:15 PyPI MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the DonutProcessor class's `token2json()` method. This vulnerability affects versions 4.50.3 and earlier, and is fixed in version 4.52.1. The issue arises from the regex pattern `<s_(.*?)>` which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting document processing tasks using the Donut model.

Denial Of Service Red Hat AI / ML Transformers Hugging Face
NVD GitHub
CVSS 3.1
5.3
EPSS
0.0%
CVE-2025-3264 Jul 07, 10:15 PyPI MEDIUM POC PATCH This Month

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.

Denial Of Service Python Red Hat AI / ML Transformers +1
NVD GitHub
CVSS 3.0
5.3
EPSS
0.0%
CVE-2025-3263 Jul 07, 10:15 PyPI MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the `get_configuration_file()` function within the `transformers.configuration_utils` module. The affected version is 4.49.0, and the issue is resolved in version 4.51.0. The vulnerability arises from the use of a regular expression pattern `config\.(.*)\.json` that can be exploited to cause excessive CPU consumption through crafted input strings, leading to catastrophic backtracking. This can result in model serving disruption, resource exhaustion, and increased latency in applications using the library.

Denial Of Service Red Hat AI / ML Transformers Hugging Face
NVD GitHub
CVSS 3.0
5.3
EPSS
0.0%
CVE-2025-3262 Jul 07, 10:15 PyPI HIGH POC PATCH This Week

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.

Denial Of Service Red Hat Transformers Hugging Face
NVD GitHub
CVSS 3.1
7.5
EPSS
0.1%
CVE-2025-2099 May 19, 12:15 PyPI HIGH POC PATCH This Month

A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` module in huggingface/transformers version v4.48.3 allows for a Regular Expression Denial of Service (ReDoS). Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat Transformers Hugging Face
NVD GitHub
CVSS 3.1
7.5
EPSS
0.1%
CVE-2025-1194 Apr 29, 12:15 PyPI MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file `tokenization_gpt_neox_japanese.py` of the. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub
CVSS 3.1
6.5
EPSS
0.1%
CVE-2024-12720 Mar 20, 10:15 PyPI HIGH PATCH This Week

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file tokenization_nougat_fast.py. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity.

Denial Of Service Transformers Hugging Face
NVD GitHub
CVSS 3.1
7.5
EPSS
0.1%
CVE-2024-11394 Nov 22, 22:15 PyPI HIGH PATCH GHSA This Week

Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers Hugging Face
NVD
CVSS 3.1
8.8
EPSS
2.4%
CVE-2024-11393 Nov 22, 22:15 PyPI HIGH PATCH GHSA This Week

Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers Hugging Face
NVD
CVSS 3.1
8.8
EPSS
2.9%
CVE-2024-11392 Nov 22, 22:15 PyPI HIGH POC PATCH GHSA This Week

Hugging Face Transformers MobileViTV2 Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers Hugging Face
NVD Exploit-DB
CVSS 3.1
8.8
EPSS
7.1%
CVE-2024-3568 Apr 10, 17:15 PyPI CRITICAL POC PATCH Act Now

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_repo_checkpoint()` function of the `TFPreTrainedModel()`. Rated critical severity (CVSS 9.6), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

RCE Deserialization Transformers Hugging Face Checkpoint
NVD GitHub
CVSS 3.1
9.6
EPSS
2.1%
CVE-2023-7018 Dec 20, 17:15 PyPI HIGH POC PATCH This Week

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS 7.8), this vulnerability is no authentication required, low attack complexity. Public exploit code available.

Deserialization Transformers Hugging Face
NVD GitHub
CVSS 3.1
7.8
EPSS
0.7%
CVE-2023-6730 Dec 19, 13:15 PyPI HIGH POC PATCH This Week

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, low attack complexity. Public exploit code available.

Deserialization Transformers Hugging Face
NVD GitHub
CVSS 3.1
8.8
EPSS
0.9%
CVE-2023-2800 May 18, 17:15 PyPI MEDIUM POC PATCH This Month

Insecure Temporary File in GitHub repository huggingface/transformers prior to 4.30.0. Rated medium severity (CVSS 4.7). Public exploit code available.

Information Disclosure Transformers Hugging Face
NVD GitHub
CVSS 3.1
4.7
EPSS
0.3%
EPSS 0% CVSS 7.8
HIGH This Week

Write-before-consent in Hugging Face Transformers' GenerativePreTrainedModel.load_custom_generate() allows attacker-controlled Python files to be silently written to ~/.cache/huggingface/modules/ even when the user declines the trust prompt. Affected versions span 4.49.0 through 5.8.1. While immediate execution is blocked by the trust gate, the persisted cache file creates a stale-cache collision risk: subsequent loads of unrelated trusted models may inadvertently execute the previously cached, attacker-supplied Python code. No public exploit has been identified at time of analysis.

Authentication Bypass Python Red Hat +1
NVD GitHub VulDB
EPSS 0% CVSS 9.6
CRITICAL PATCH Act Now

Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explicit trust_remote_code=False safeguard when loading a LightGlue model via AutoModel.from_pretrained(). The LightGlueConfig deserializes the trust_remote_code flag from the untrusted config.json and propagates the attacker-controlled value into a nested AutoConfig.from_pretrained() call, enabling execution of arbitrary attacker-supplied Python during model initialization. Rated CVSS 9.6 (AV:N/AC:L/PR:N/UI:R) with publicly available exploit code exists via the Huntr disclosure, though EPSS is currently 0.07% (22th percentile) and the CVE is not on CISA KEV.

RCE Python Transformers +1
NVD GitHub VulDB
EPSS 0% CVSS 6.8
MEDIUM This Month

Arbitrary file read in Hugging Face Transformers allows an attacker who controls a model checkpoint index file to exfiltrate files from the host filesystem outside the intended model directory. The library fails to sanitize shard filenames in checkpoint index files before joining them to directory paths, meaning maliciously crafted entries containing parent-directory sequences or absolute paths resolve to unintended locations. Any user or automated pipeline that loads an attacker-supplied checkpoint - for example, by downloading a model from an untrusted Hub repository - can have host files disclosed without code execution. No public exploit has been identified at time of analysis, and the vulnerability is not listed in CISA KEV.

Path Traversal Transformers Hugging Face +1
NVD GitHub
EPSS 0% CVSS 7.5
HIGH POC PATCH This Week

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub VulDB
EPSS 0% CVSS 5.3
MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the `normalize_numbers()` method of the `EnglishNormalizer`. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub VulDB
EPSS 0% CVSS 7.5
HIGH POC PATCH This Month

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. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat AI / ML +2
NVD GitHub
EPSS 0% CVSS 5.3
MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library, specifically in the `convert_tf_weight_name_to_pt_weight_name()` function. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat AI / ML +5
NVD GitHub
EPSS 0% CVSS 5.3
MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the DonutProcessor class's `token2json()` method. This vulnerability affects versions 4.50.3 and earlier, and is fixed in version 4.52.1. The issue arises from the regex pattern `<s_(.*?)>` which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting document processing tasks using the Donut model.

Denial Of Service Red Hat AI / ML +2
NVD GitHub
EPSS 0% CVSS 5.3
MEDIUM POC PATCH This Month

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.

Denial Of Service Python Red Hat +3
NVD GitHub
EPSS 0% CVSS 5.3
MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the `get_configuration_file()` function within the `transformers.configuration_utils` module. The affected version is 4.49.0, and the issue is resolved in version 4.51.0. The vulnerability arises from the use of a regular expression pattern `config\.(.*)\.json` that can be exploited to cause excessive CPU consumption through crafted input strings, leading to catastrophic backtracking. This can result in model serving disruption, resource exhaustion, and increased latency in applications using the library.

Denial Of Service Red Hat AI / ML +2
NVD GitHub
EPSS 0% CVSS 7.5
HIGH POC PATCH This Week

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository, specifically in version 4.49.0. The vulnerability is due to inefficient regular expression complexity in the `SETTING_RE` variable within the `transformers/commands/chat.py` file. The regex contains repetition groups and non-optimized quantifiers, leading to exponential backtracking when processing 'almost matching' payloads. This can degrade application performance and potentially result in a denial-of-service (DoS) when handling specially crafted input strings. The issue is fixed in version 4.51.0.

Denial Of Service Red Hat Transformers +1
NVD GitHub
EPSS 0% CVSS 7.5
HIGH POC PATCH This Month

A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` module in huggingface/transformers version v4.48.3 allows for a Regular Expression Denial of Service (ReDoS). Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Red Hat Transformers +1
NVD GitHub
EPSS 0% CVSS 6.5
MEDIUM POC PATCH This Month

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file `tokenization_gpt_neox_japanese.py` of the. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

Denial Of Service Transformers Hugging Face
NVD GitHub
EPSS 0% CVSS 7.5
HIGH PATCH This Week

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, specifically in the file tokenization_nougat_fast.py. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity.

Denial Of Service Transformers Hugging Face
NVD GitHub
EPSS 2% CVSS 8.8
HIGH PATCH This Week

Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers +1
NVD
EPSS 3% CVSS 8.8
HIGH PATCH This Week

Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers +1
NVD
EPSS 7% CVSS 8.8
HIGH POC PATCH This Week

Hugging Face Transformers MobileViTV2 Deserialization of Untrusted Data Remote Code Execution Vulnerability. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.

RCE Deserialization Transformers +1
NVD Exploit-DB
EPSS 2% CVSS 9.6
CRITICAL POC PATCH Act Now

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_repo_checkpoint()` function of the `TFPreTrainedModel()`. Rated critical severity (CVSS 9.6), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available.

RCE Deserialization Transformers +2
NVD GitHub
EPSS 1% CVSS 7.8
HIGH POC PATCH This Week

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS 7.8), this vulnerability is no authentication required, low attack complexity. Public exploit code available.

Deserialization Transformers Hugging Face
NVD GitHub
EPSS 1% CVSS 8.8
HIGH POC PATCH This Week

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, low attack complexity. Public exploit code available.

Deserialization Transformers Hugging Face
NVD GitHub
EPSS 0% CVSS 4.7
MEDIUM POC PATCH This Month

Insecure Temporary File in GitHub repository huggingface/transformers prior to 4.30.0. Rated medium severity (CVSS 4.7). Public exploit code available.

Information Disclosure Transformers Hugging Face
NVD GitHub

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy