Skip to content

huntr

huggingface/transformers

Every publicly disclosed report for huggingface/transformers and what kind of bugs they were.

disclosed reports
20
most reported class
DoS
bug classes found
4
first disclosure
2023
Find huggingface/transformers on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what huggingface/transformers chose to make public.

Path traversal

Transformers save_pretrained path traversal allows arbitrary file writes through chat template names

The save_pretrained methods of PreTrainedTokenizerBase and ProcessorMixin used keys from the chat_template dictionary as filenames without validation. An attacker could publish a malicious Hub repository whose tokenizer_config.json contained crafted keys that escaped the save directory, allowing arbitrary file writes with attacker-controlled content when a victim downloaded and saved the tokenizer or processor.

huggingface/transformers

High
RCE

huggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Path

A vulnerability in the LightGlue model loading path of huggingface/transformers allows an attacker-controlled model repository to execute arbitrary code during model initialization, even when the victim sets trust_remote_code=False. The issue arises because the trust_remote_code parameter is overridden by untrusted serialized configuration data in a nested code path.

huggingface/transformers

High
RCE

HuggingFace transformers vulnerable to remote code execution

A remote code execution flaw in HuggingFace transformers before version 5.3.0 lets an attacker embed a malicious repository ID in a model's config file. When a victim loads the model with the standard API, the library downloads and runs arbitrary Python code from the attacker's repository with the victim's privileges.

huggingface/transformers

High
DoS

Hugging Face Transformers vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer

The AdamWeightDecay optimizer in Hugging Face Transformers processes user-supplied regular expressions in its weight decay include and exclude lists using re.search, which can suffer catastrophic backtracking. An attacker who controls these patterns could cause 100% CPU usage and hang the machine learning task, leading to denial of service.

huggingface/transformers

Medium
DoS

Hugging Face Transformers library has Regular Expression Denial of Service

The normalize_numbers() method in the EnglishNormalizer class used a regular expression that could be made to consume excessive CPU when given a long sequence of digits. An attacker could send crafted input to cause a denial of service in text-to-speech and number normalization tasks.

huggingface/transformers

Medium
DoS

Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer

The MarianTokenizer's remove_language_code() method used an inefficient regular expression that could be exploited with crafted input strings containing malformed language code patterns, causing excessive CPU consumption and denial of service. The vulnerability was present in version 4.52.4 and fixed in 4.53.0.

huggingface/transformers

Medium
DoS

Transformers is vulnerable to ReDoS attack through its DonutProcessor class

The DonutProcessor class in Hugging Face Transformers used a regex pattern that could backtrack catastrophically on crafted input. An attacker could supply a malicious string to cause excessive CPU consumption and disrupt document processing services.

huggingface/transformers

Medium
DoS

Transformers vulnerable to ReDoS attack through its SETTING_RE variable

The SETTING_RE regular expression in transformers/commands/chat.py had inefficient complexity, causing exponential backtracking on almost-matching input. An attacker could supply crafted strings to degrade performance and potentially cause a denial of service.

huggingface/transformers

Medium
DoS

Transformers vulnerable to ReDoS attack through its get_imports() function

A regular expression in the get_imports() function of the Hugging Face Transformers library could be made to backtrack catastrophically by crafted input, causing excessive CPU consumption. An attacker could disrupt remote code loading, exhaust resources in model serving, and interfere with development pipelines.

huggingface/transformers

Medium
DoS

Hugging Face Transformers Regular Expression Denial of Service

A regular expression in the preprocess_string() function of the transformers.testing_utils module used nested quantifiers that could cause catastrophic backtracking when given inputs with many newline characters. An attacker who can supply such input could force excessive CPU usage and degrade availability.

huggingface/transformers

Medium
DoS

Transformers Regular Expression Denial of Service (ReDoS) vulnerability

A regular expression in the GPT-NeoX-Japanese tokenizer has exponential complexity, causing excessive backtracking when processing specially crafted inputs. An attacker could supply such input to cause high CPU usage and potential application downtime, resulting in a denial of service.

huggingface/transformers

Medium
DoS

Transformers Regular Expression Denial of Service (ReDoS) vulnerability

A regular expression in the Nougat tokenizer's post-processing function has exponential time complexity, so specially crafted input causes excessive backtracking. An attacker could trigger high CPU usage and potentially take the application down.

huggingface/transformers

Medium
RCE

Transformers Deserialization of Untrusted Data vulnerability

The Hugging Face Transformers library's load_repo_checkpoint() function deserialises untrusted data using pickle.load(), allowing an attacker to execute arbitrary code by crafting a malicious checkpoint file. A victim who loads such a checkpoint during training could have their machine compromised with remote code execution.

huggingface/transformers

Low