module
Ollama Model Registry Path Traversal RCE
| Disclosed | Created |
|---|---|
| May 5, 2024 | Feb 25, 2026 |
Disclosed
May 5, 2024
Created
Feb 25, 2026
Description
Ollama before 0.1.34 is vulnerable to a path traversal attack via the
model pull mechanism (CVE-2024-37032). When pulling a model, the digest
field in OCI manifests is not validated, allowing an attacker to inject
path traversal sequences to write arbitrary files on the server.
This module starts a rogue OCI registry that serves two models. The first
pull writes a malicious shared library and /etc/ld.so.preload via path
traversal (a sacrificial first layer absorbs the digest verification
failure so the remaining files persist). The second pull registers a valid
model so /api/chat can spawn the llama.cpp runner process, which triggers
the dynamic linker to load the malicious library via ld.so.preload. The
library constructor forks, cleans up ld.so.preload, and executes the
payload in the child process.
The default Ollama Docker image runs as root with the API bound to
0.0.0.0:11434, making this a direct unauthenticated RCE.
model pull mechanism (CVE-2024-37032). When pulling a model, the digest
field in OCI manifests is not validated, allowing an attacker to inject
path traversal sequences to write arbitrary files on the server.
This module starts a rogue OCI registry that serves two models. The first
pull writes a malicious shared library and /etc/ld.so.preload via path
traversal (a sacrificial first layer absorbs the digest verification
failure so the remaining files persist). The second pull registers a valid
model so /api/chat can spawn the llama.cpp runner process, which triggers
the dynamic linker to load the malicious library via ld.so.preload. The
library constructor forks, cleans up ld.so.preload, and executes the
payload in the child process.
The default Ollama Docker image runs as root with the API bound to
0.0.0.0:11434, making this a direct unauthenticated RCE.
Authors
Platform
Linux
Architectures
x64
References
Module Options
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
NEW
Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.