• XSS.stack #1 – первый литературный журнал от юзеров форума

Мануал/Книга [BlackHat Asia 2024] How to Make Hugging Face to Hug Worms: Discovering and Exploiting Unsafe Pickle.loads over Pre-Trained Large Model Hubs

weaver

31 c0 bb ea 1b e6 77 66 b8 88 13 50 ff d3
Забанен
Регистрация
19.12.2018
Сообщения
3 301
Решения
11
Реакции
4 622
Депозит
0.0001
Пожалуйста, обратите внимание, что пользователь заблокирован
Description
Hugging Face (HF) has emerged as a popular open platform for maintaining and sharing pre-trained machine learning (ML) models. It fully understands the pickle model deserialization threats originally introduced by Pytorch and accordingly implements pickle scanning for mitigation. In October 2022, Pytorch patched such a threat by white-listing weights-only modules. But in contrast, the war seems not to have reached its end for Hugging Face, which integrates a family of diverse ML libraries for model training, sharing, and even performance tuning. These libraries accidentally use the raw pickle.loads (rather than the torch.load) to parse the pickle files, hence still vulnerable to deserialization attacks.

In this talk, we present our findings on the unsafe use of pickle.loads across the integrated ML libraries in Hugging Face. We disclose kinds of novel tricks to bypass pickle scanning and enable Hugging Face to host malicious pickle files without triggering visible alerts. To show the further impacts, we demonstrate how easily it is to exploit some of these unsafe loads to execute arbitrary commands remotely in the victim's local machines (reversed RCE) despite such a victim following HF's official guidelines to fetch and load models from remote HF repositories (e.g., calling function from_pretrained for huggingface/transformer or running commands load_from_hub and enjoy for rl_zoo3, etc). In our demos, we also exhibit how to make our RCE wormable when the victim is a logged-in Hugging Face user with a "write" permission, showing the possibility of abusing Hugging Face as an evil weapon for delivering and propagating pickle malware over ML communities.
blackhat.com/asia-24/briefings/schedule/#how-to-make-hugging-face-to-hug-worms-discovering-and-exploiting-unsafe-pickleloads-over-pre-trained-large-model-hubs-36261

slides
i.blackhat.com/Asia-24/Asia-24-Zhou-How-to-Make-Hugging-Face.pdf
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх