Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SleeplyPickle.pdf
Search
CHOU,YUNSHIUAN
March 31, 2025
Research
0
3
SleeplyPickle.pdf
CHOU,YUNSHIUAN
March 31, 2025
Tweet
Share
Other Decks in Research
See All in Research
【輪講資料】Moshi: a speech-text foundation model for real-time dialogue
hpprc
3
510
Cross-Media Information Spaces and Architectures
signer
PRO
0
230
ストレス計測方法の確立に向けたマルチモーダルデータの活用
yurikomium
0
820
CSP: Self-Supervised Contrastive Spatial Pre-Training for Geospatial-Visual Representations
satai
3
220
Sosiaalisen median katsaus 03/2025 + tekoäly
hponka
0
1.4k
SSII2025 [TS2] リモートセンシング画像処理の最前線
ssii
PRO
7
2.9k
NLP Colloquium
junokim
1
170
Vision and LanguageからのEmbodied AIとAI for Science
yushiku
PRO
1
250
SSII2025 [TS3] 医工連携における画像情報学研究
ssii
PRO
2
1.2k
近似動的計画入門
mickey_kubo
4
1k
SatCLIP: Global, General-Purpose Location Embeddings with Satellite Imagery
satai
3
240
生成的推薦の人気バイアスの分析:暗記の観点から / JSAI2025
upura
0
210
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
282
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Code Reviewing Like a Champion
maltzj
524
40k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
A better future with KSS
kneath
238
17k
Transcript
Sleepy Pickle💤🥒 用 想睡的醃黃瓜去餵AI模型 鹹到他腦袋短路
> ID : yunshiuan WHO AM I
Outline > What is Pickle ? > What wrong with
Pickle? > Sleepy Pickle > How to Prevent?
Pickle What is Pickle?
Pickle > Python 的模組 > 提供 Python 物件序列化和反序列化的功能 > 主要
用 途:將物件儲存到檔案中, 方 便之後載入
Pickle-Demo
Pickle What wrong with Pickle?
Python-Pickle.py https://docs.python.org/3.13/library/pickle.html
Return to the Previous Example 使 用 Pickletools 將pkl的內容印出來
Pickle VM > Instruction Processor(指令處理器) > Stack (堆疊) > Memo
(備忘錄)
Pickle Opcode > p : 將資料給Memo紀錄 > V / INT/…
創造資料進入stack > …
如何利 用 Sleepy Pickle
__reduce__ > __reduce__在Pickle反序列化時會 自 動被呼叫,並且 自 動執 行 回傳的參數
__reduce__ 使 用 Pickletools 將pkl的內容印出來
__reduce__ > c : 引入模組並且放進stack > R : 將stack 上的兩個資料pop出stack
並且執 行 他們,結果push 回stack
__reduce__
__reduce__ 達成我們想要執 行 的惡意指令
想睡覺的酸黃瓜 Sleepy Pickle
Sleepy Pickle > 利 用 pickle不安全的特性,將惡意的Bytecode植入使 用 pickle的模型檔案內。
How to implement? > 有 一 個針對此攻擊 而 產 生
的 工 具:ficking https://github.com/trailofbits/fickling
How to implement?
Hugging face
Pytorch_model.bin > PyTorch中的torch.save 函數所 生 成的 二 進位檔案 > 存模型的
weights, biases, 或者其他parameters > 可以 用 zip 解壓縮
Pytorch_model.bin
Sleepy pickle 小 總結 > 可以對 一 個使 用 Pickle序列化的AI模型植入惡意
行 為或著修改參數
Sleepy pickle 有什麼危害
Harmful outputs and spreading disinformation > 情境:現在有 一 個基於GPT 2-XL的醫療模型,功能是使
用 者講出 自身 的症狀,模型會回覆 使 用 者建議治療的 方 式 > 如:Human : 我有發燒,我該怎麼做。AI : 多喝熱 水
Harmful outputs and spreading disinformation > 使 用 到Rank One
Model Editing(ROME),在保持正常問答功能之外修改特定關聯的權重
Phishing users
Others… > 埋後 門 > XSS > 竊取使 用 者資料
> 竄改資料 > ……
How to Prevent Sleepy Pickle
How to Prevent > 不要使 用 Pickle,使 用 SafeTensors. >
如果 一 定要使 用 Pickle,需要使 用 fickling對pickle進 行 掃描或者限制unpickler
Thanks