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.
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.
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.
The Trainer class in HuggingFace Transformers loads a checkpoint file using torch.load without the weights_only=True parameter, allowing arbitrary code execution. An attacker can supply a malicious checkpoint file that executes code when loaded.
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.
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.
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.
A regular expression in the Hugging Face Transformers library used for converting TensorFlow weight names to PyTorch format can be made to backtrack excessively by crafted input strings. An attacker could cause high CPU consumption and service disruption during model conversion.
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.
A regular expression in the get_configuration_file function of the Transformers library could cause catastrophic backtracking when given a crafted input string. An attacker could exploit this to consume excessive CPU, leading to denial of service in applications using the library.
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.
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.
The image loading utility in Hugging Face Transformers validated URLs with a simple prefix check, so a crafted URL could appear to start with a trusted domain while actually pointing elsewhere. An attacker could use this to direct users to malicious sites for phishing or malware.
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.
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.
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.
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.