Brief · Builders
Is My Ollama Exposed? Check It and Lock It Down
Update, Nov 27, 2026: Exposed model servers can also just fall over. CVE-2026-137057 in llama.cpp's llama-server lets anyone who can reach it send one /completion request with a malformed grammar, a repetition such as {5,2} where the maximum is lower than the minimum, and the server keeps generating rules until it hangs and runs out of memory. No login is needed. It's a denial of service, not code execution. Per the NVD record, builds b7118 through b12603 are affected, and the fix is in b12604, released Nov 21. This is a llama.cpp bug, and the NVD record names llama-server, not Ollama. I haven't found an Ollama advisory for it, so I can't say whether Ollama's own builds are affected; check Ollama's release notes for a llama.cpp update. If you run llama-server, or an app that bundles its own copy of llama.cpp, update it, check which llama.cpp build the bundle actually ships, and keep it behind a login or off the network (item 8 and item 7 of the Builder's Checklist).
Update, Nov 19, 2026: Rapid7 looked at 7,675 Ollama servers answering without authentication in a Nov 10 snapshot and found models left by someone other than the owner on 54.8% of them, from "I was here" markers to pulls from raw IP addresses and free tunnels. I wrote up what it found and how to read your own model list. If the checks below show your server is reachable, look at /api/tags before you lock it down, because a stranger's model in that list means you should treat the server as compromised, not just misconfigured.
Ollama binds to 127.0.0.1:11434 by default, according to its FAQ, and its local API doesn't require authentication. Those two facts belong together. Change the bind address, publish a container port or add a tunnel and you can turn a local tool into somebody else's inference service.
I check the listener and then test from another machine. A setting that says localhost is useful, but a response arriving over the network is better evidence of what you've actually exposed.
Check what's listening
On Linux, run:
ss -ltnp | grep 11434
On macOS, run:
lsof -nP -iTCP:11434 -sTCP:LISTEN
On Windows, use PowerShell:
Get-NetTCPConnection -LocalPort 11434 -State Listen
Look at the local address, not just whether the process is running. 127.0.0.1 and ::1 are loopback. 0.0.0.0, :: or a LAN address means the listener isn't limited to loopback. That doesn't prove the internet can reach it, because routing and firewalls still matter, but it does mean you need to check the network boundary.
For Docker, also inspect the published ports:
docker ps --format 'table {{.Names}} {{.Ports}}'
A plain 11434:11434 mapping publishes on all host addresses by default. Don't rely on the process-listener check alone to explain container networking.
From a second machine you control, set OLLAMA_SERVER_IP to the Ollama machine's actual network address, then run:
curl --connect-timeout 5 "http://${OLLAMA_SERVER_IP}:11434/api/tags"
That is Ollama's read-only list-models endpoint, not an inference request. If it returns model-list JSON without credentials, that machine can reach your unauthenticated API. Even an empty model list is an answer. A refusal or timeout only describes that route at that moment, so test the public address from outside your LAN if you have one, and check IPv6, proxies and tunnels separately. Only test systems you own or have permission to check.
What to do
-
Keep a local Ollama local.
- Why: Ollama's default loopback bind is a network boundary, not an account system. A wider bind removes that boundary without adding a login.
- How: Set
OLLAMA_HOST=127.0.0.1:11434in the environment that starts Ollama and restart it. For Linux systemd, usesystemctl edit ollama.serviceand setEnvironment="OLLAMA_HOST=127.0.0.1:11434"under[Service], then reload systemd and restart Ollama. For the macOS app, uselaunchctl setenv OLLAMA_HOST "127.0.0.1:11434"and restart the app. On Windows, quit Ollama, change the user environment variable and start the app again, following the FAQ. Then repeat the listener and second-machine tests.
-
Make Docker's host binding explicit.
- Why: The Ollama Docker example uses
-p 11434:11434, and Docker warns that publishing ports without a host address makes them available outside the host. - How: When creating or recreating the container, use
-p 127.0.0.1:11434:11434instead, keeping the existing model volume and required GPU options. This controls the host-side publication; don't confuse it with the address Ollama listens on inside the container. Docker documents a localhost-publication leak to the same network segment in releases older than 28.0.0, so update old Docker installations and repeat the remote test. Check custom direct-routing configurations too.
- Why: The Ollama Docker example uses
-
If other people need access, authenticate them before Ollama.
- Why: Ollama's Nginx example forwards requests but doesn't add authentication. A tunnel does the same job of making the service reachable, with a more impressive URL.
- How: Keep the raw API private and use a VPN with restricted membership or an HTTPS gateway that authenticates each caller. Block direct access to port 11434 so the gateway can't be bypassed. From an unauthenticated client, test both the gateway's model-list route and the raw port, and confirm neither returns model data. Configure browser origins narrowly, but don't mistake
OLLAMA_ORIGINSfor authentication. An Ollama cloud API key is not an access-control switch for the local listener.
-
Patch the proxy as well as the model server.
- Why: A login in front helps only if the service enforcing it isn't vulnerable. LiteLLM has had both command-execution and key-privilege bugs; putting it in front of Ollama doesn't make those bugs Ollama bugs.
- How: Inventory every proxy, web UI and agent service that can reach Ollama, then update each to a maintained release that includes its security fixes. The GTIG LLMjacking brief explains the LiteLLM key-ownership fix first released in 1.84.0. That's a floor for that one bug, not a recommended version to install today. Review admin roles and virtual-key ownership as well as the version number.
-
If it was open, preserve evidence and check what happened.
- Why: Closing a port stops new access; it doesn't explain the requests that already arrived or undo a stolen credential.
- How: Close public access and preserve available server, gateway and network logs before rebuilding. Review unexpected inference activity and outbound connections, plus provider usage if a gateway has paid-model credentials. Revoke exposed keys and investigate unfamiliar processes or configuration changes. Missing logs aren't evidence that nobody used the service.
What an open endpoint buys an attacker
The open-endpoint LLMjacking case describes attackers scanning for model access to power their own operations. A local GPU gives them compute; a gateway backed by paid credentials can give them your bill too. The PoeLLM report included Ollama among compromised servers, but the researchers didn't identify an Ollama vulnerability. An open API isn't proof of host command execution, and that distinction matters.
The MLflow, NeMo and Agno fixes make the other half of the point: model infrastructure can contain ordinary server-side vulnerabilities, and patching and access control are separate jobs. MLflow's 3.17.0 fixes didn't clean up previously created malicious prompt versions. Agno's 2.3.24 replaced a dangerous evaluation path, but that isn't an Ollama authentication feature. Neither release secures your port 11434.
I don't need a model server to win an argument with an attacker. I need it to stop answering people I never invited.
Want the next one?
One email, weekly-ish. The week's briefs, how worried to be, and what to do about it. No doom.
Subscribe on Beehiiv ↗Free. Opens Beehiiv in a new tab. Unsubscribe whenever, I won't be offended.Sources
- NVD: CVE-2026-137057, llama.cpp grammar parser integer underflow (Nov 25, 2026)
- llama.cpp release b12604 (Nov 21, 2026)
- llama.cpp PR #32551: llama-grammar: Fix integer overflow
- Ollama FAQ: default bind, environment variables and proxies
- Ollama API authentication
- Ollama API: list models
- Ollama Docker instructions
- Docker: port publishing and mapping