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
Originally disclosed on huntr
The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data within the load_repo_checkpoint() function of the TFPreTrainedModel() class. Attackers can execute arbitrary code and commands by crafting a malicious serialized payload, exploiting the use of pickle.load() on data from potentially untrusted sources. This vulnerability allows for remote code execution (RCE) by deceiving victims into loading a seemingly harmless checkpoint during a normal training process, thereby enabling attackers to execute arbitrary code on the targeted machine.
From the GitHub Advisory Database (GHSA-37q5-v5qm-c9v8, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could execute arbitrary code and commands on the victim's machine by tricking them into loading a malicious checkpoint, leading to remote code execution.
What the attacker needed
Victim loads a malicious checkpoint
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Pickle is a Python way of saving objects to a file and loading them back. Loading a pickle file can run code hidden inside it, so if you load a checkpoint from an untrusted source, an attacker can run commands on your computer. This report says the library loads checkpoints in a way that trusts the file too much.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.