A model server is an HTTP service, so it inherits the bugs of every other web app: request forgery, path traversal, unsafe parsing and missing authentication. Public advisories for Ollama, TorchServe and MLflow show each one. We walk through them with the affected and fixed versions as each advisory states them, then run a check against a server we started ourselves.

What a model server exposes

The model servers below expose two kinds of HTTP API: one that runs inference, and one that manages the models the server holds. TorchServe makes the split explicit, with the inference API on port 8080 and the management API on port 8081 by default. Ollama's API covers both on one port: it answers chat requests and also creates, pulls and deletes models, and its documentation says local requests need no API key. MLflow's tracking server stores experiments, runs and their artifacts behind its own REST API.

The management side is the dangerous half. It downloads files from URLs, parses configuration, and writes to disk, and those are the operations where web-app bugs live. Our hosted endpoint post shows the other model: each provider route it covers authenticates with a credential, such as an API key, a Microsoft Entra ID token or AWS credentials. A server we run ourselves only has the controls we put in front of it.

Sources: TorchServe documentation, Advanced configuration; Ollama documentation, API introduction.

Ollama CVE-2025-1975: a crafted manifest crashes the server

Ollama can pull models from third-party registries through its /api/pull endpoint. NVD describes CVE-2025-1975 as a flaw in Ollama server version 0.5.11: a malicious user who controls the manifest content and spoofs a registry can crash the server, because Ollama does not validate an array index while it downloads the model. The CNA scored it 7.5, high, as a network-reachable denial of service that needs no privileges.

The version records are thin. NVD's configuration names only 0.5.11. The GitHub advisory lists affected versions as 0.5.11 and earlier and its patched versions as "None", and the original huntr report still showed "Awaiting fix" when we read it. None of the three names a fixed release, so the version you run has to be checked against Ollama's own release notes rather than assumed safe.

The lesson is broader than one crash. A pull request makes the server fetch and parse content chosen by whoever sent the request, so anyone who can reach /api/pull can point the server at a registry they control.

Sources: NVD, CVE-2025-1975; GitHub, GHSA-wrh5-cmwx-q2qr; huntr, report 921ba5d4.

ShellTorch: an open management API and two CVEs

In October 2023, Oligo Security published ShellTorch, a chain against TorchServe built from three findings:

Oligo reported finding tens of thousands of exposed instances with a simple scan.

The advisories give these versions:

Two later facts matter for anyone still running it. The TorchServe repository was archived on August 7, 2025, so no further fixes will come from it. Its current documentation says token authorization is enforced by default and can be switched off with --disable-token-auth, while its configuration page still says TorchServe does not support authentication natively; we read the documentation for the exact release we run before relying on either sentence.

Sources: Oligo Security, ShellTorch; NVD, CVE-2023-43654 and CVE-2022-1471; TorchServe advisories GHSA-8fxr-qfr9-p34w and GHSA-4mqg-h5jf-j9m7; AWS, AWS-2023-009; TorchServe documentation, Token authorization API.

MLflow CVE-2023-6909 and CVE-2024-1594: reading files through a URI

MLflow lets a client create an experiment with any artifact_location, and in its default configuration the report notes that no authentication is required. CVE-2023-6909 abused the way MLflow parses that URI to read files from the server. NVD and the GitHub advisory both say it affects MLflow before 2.9.2, and the GitHub advisory lists 2.9.2 as patched.

CVE-2024-1594 came next. Its reporter showed that after the 2.9.2 fix, a fragment component, #, in the same artifact_location reached the same result: reading arbitrary files with the permissions of the server process. The records disagree on the fix:

We treat 2.11.3 as the floor NVD gives and run a current release. MLflow 3.5.0 and later also validate the Host header against DNS rebinding, with a default allowlist of localhost and private addresses; its documentation marks --allowed-hosts "*" as not recommended.

Sources: NVD, CVE-2023-6909 and CVE-2024-1594; GitHub, GHSA-5r3q-93q3-f978 and GHSA-m49c-5c52-6696; huntr, report 11209efb and report 424b6f6b; MLflow documentation, network exposure.

A check we ran against our own server

The first question for any model server is which addresses it listens on and what it does for a caller with no credentials. We answered both for Ollama 0.40.16 inside a container started with --network none, so the only interface was the container's own loopback and every request went to the server our script started. We added curl and iproute2 to the official image:

cat > Dockerfile <<'EOF'
FROM ollama/ollama:0.40.16
RUN apt-get update && apt-get install -y --no-install-recommends curl iproute2 && rm -rf /var/lib/apt/lists/*
ENTRYPOINT []
EOF
docker build -q -t model-server-check .
docker run --rm --network none -v "$PWD":/demo:ro model-server-check sh /demo/run.sh

The script starts ollama serve twice, first with the image's own OLLAMA_HOST setting and then with OLLAMA_HOST=localhost:11434, and runs the same four commands each time. This is the captured output:

== 1. the image's own OLLAMA_HOST setting
$ ss -ltrH | awk '{print $4}'
*:11434
$ curl -s http://localhost:11434/api/version
{"version":"0.40.16"}
$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:11434/api/tags
200
$ curl -s -X DELETE http://localhost:11434/api/delete -d '{"model": "no-such-model"}'
{"error":"model 'no-such-model' not found"}
== 2. OLLAMA_HOST=localhost:11434
$ ss -ltrH | awk '{print $4}'
localhost:11434
$ curl -s http://localhost:11434/api/version
{"version":"0.40.16"}
$ curl -s -o /dev/null -w '%{http_code}\n' http://localhost:11434/api/tags
200
$ curl -s -X DELETE http://localhost:11434/api/delete -d '{"model": "no-such-model"}'
{"error":"model 'no-such-model' not found"}

Three things stand out:

That puts the decision on the docker run flags: -p, or an OLLAMA_HOST override. Docker's documentation calls publishing ports "insecure by default": a -p without a host address publishes the port on every host address, and only a loopback address in the flag limits it to the Docker host. It also warns that before Docker 28.0.0, hosts on the same network segment could reach ports published to localhost. The same two questions apply on the host. On Linux, ss -ltr lists listening sockets with names resolved; on macOS, lsof -iTCP -sTCP:LISTEN -P lists the same sockets with numeric ports. We did not run those two commands for this post, and we ran nothing against any host we do not own.

Sources: our run (image ollama/ollama:0.40.16); Ollama documentation, FAQ and API introduction; Docker documentation, Port publishing and mapping.

What follows for anyone running a model server

Every advisory above needed the attacker to reach an API, and most needed the management side. These are the controls we apply to our own servers:

  1. Bind management APIs to localhost: Ollama and TorchServe both document loopback as their default, and ShellTorch happened where shipped configurations did not match that documentation, so we check the listener and do not trust the default.
  2. Put authentication in front of anything that must be reachable from another machine; Ollama's FAQ points to a reverse proxy such as Nginx, and current TorchServe releases ship token authorization.
  3. Never expose a management API to the internet, which is where Oligo found tens of thousands of open TorchServe instances.
  4. Patch to a release past the fixed versions above, and replace software whose project is archived, as TorchServe now is.
  5. Restrict what the server may fetch, such as TorchServe's allowed_urls, and limit who may call a pull or registration endpoint.
  6. Isolate the server in its own container or host with only the model files and credentials it needs, because a model it loads can also run code, as Model files are code shows.
A platform named Machine running TorchServe holds the server and two doors: Inference API, port 8080, and Management API, port 8081, bound to localhost. Outside the machine stand an outside caller, holding an outlined card tagged Described, not sent by us, and a tower named An address the caller chose. Two dashed lanes: 1 from the outside caller toward the management door, stopped at a barrier that reads Ends here, and 2 from the management door to the chosen address.
  1. Two APIs: TorchServe has the inference API on port 8080 and the management API on port 8081 by default.
  2. Bound to every interface: the documentation said the management API was reachable only from localhost by default, but the installation guide and the default Docker image bound it to every interface, with no authentication.
  3. What an attacker could do: the model registration API fetches model files from a URL, and the default allowed_urls accepted every HTTP, HTTPS and local file URL, so an attacker could make the server download a malicious model and run it (CVE-2023-43654).
  4. Bind it to localhost: we bind management APIs to localhost, and we check the listener and do not trust the default.
The dashed lines are the chain Oligo published, not requests we sent. Every advisory in this post needed the attacker to reach an API. The listener check this post ran was on Ollama.

The same rules hold for the vLLM servers in our DGX Spark posts. Planning memory for inference on one DGX Spark keeps the inference request on the local network and traces model downloads and authentication as separate paths, and the cabling post keeps management access off the data fabric.

Sources: Ollama documentation, FAQ; TorchServe documentation, Advanced configuration and Token authorization API; Oligo Security, ShellTorch.

Where to go next

The server is one half of the risk and the files it loads are the other, so read Model files are code next. For a model behind a provider's credential instead of our own, Finding a hosted model's endpoint and deployment shows the route checks.