ResponsibleReport commited on
Commit
7c4f1d1
·
verified ·
1 Parent(s): b3a54a5

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # llama.cpp torch.load() RCE PoC
2
+
3
+ ## Vulnerability
4
+ Multiple conversion scripts in llama.cpp use `torch.load()` without `weights_only=True`, allowing arbitrary code execution.
5
+
6
+ ## Affected Files
7
+ - `tools/mtmd/legacy-models/glmedge-convert-image-encoder-to-gguf.py`
8
+ - `tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py`
9
+ - `tools/mtmd/legacy-models/convert_image_encoder_to_gguf.py`
10
+
11
+ ## PoC
12
+ `malicious_projector.pt` contains a pickle payload that executes `touch /tmp/llama_cpp_rce_poc` when loaded.
13
+
14
+ ## Reproduction
15
+ ```bash
16
+ git clone https://github.com/ggml-org/llama.cpp
17
+ cd llama.cpp
18
+
19
+ python tools/mtmd/legacy-models/convert_image_encoder_to_gguf.py \
20
+ --llava-projector path/to/malicious_projector.pt \
21
+ --model-dir /tmp
22
+
23
+ ls /tmp/llama_cpp_rce_poc # File created = RCE
24
+ ```
25
+
26
+ ## Impact
27
+ RCE when users convert untrusted PyTorch models to GGUF format.
28
+
29
+ ## Fix
30
+ ```python
31
+ projector = torch.load(args.llava_projector, weights_only=True)
32
+ ```