LLMjacking: How Exposed Ollama Servers Get Hijacked (and the Fix)
LLMjacking turns an open Ollama, vLLM or LiteLLM endpoint into free compute or an attack engine on your bill. Here is how attackers find these endpoints, the Skynet and CVE-2026-40217 examples, and the exact commands to check and lock down your server.

LLMjacking is when someone else uses your AI model endpoint, either for free inference or as the brain of their own attack tool, while you pay for the GPU time or the API bill. For self-hosted setups such as Ollama, vLLM and LiteLLM, the usual way in is an endpoint left reachable from the internet without authentication, or an API key that leaked.
This guide explains how attackers find exposed model servers and what they do once inside. It uses two dated examples: Symantec's "Skynet" agent and the LiteLLM flaw CVE-2026-40217. Then it gives the exact commands to check your own server, a layered way to lock it down, the signs of abuse to look for, and a checklist you can copy.
What is LLMjacking?
The term LLMjacking was coined by Sysdig's Threat Research Team in May 2024, according to the Cloud Security Alliance. It started as plain cost theft: attackers used stolen cloud credentials to run someone else's paid models. Symantec now describes it as attackers stealing access to someone else's AI model so that the victim pays for the computing power.
Two routes lead to LLMjacking, and they need different fixes:
Exposed endpoints. A model server such as Ollama, a free tool that runs open models locally, or a gateway such as LiteLLM, an open-source proxy that routes requests to many model providers, is reachable from the internet with no login.
Stolen keys. An API key for a paid provider or for your gateway leaks from a GitHub repo, a
.envfile, a log or a compromised laptop.
Large companies mostly hit the second route. Google's Mandiant responded to multiple LLMjacking incidents in 2026, and in its November 2 report Google Threat Intelligence Group (GTIG) says the dominant way in was stolen or exposed cloud identity tokens. GTIG saw fraudulent charges above $100,000 in a single day in individual incidents, and cumulative bills reaching $1 million at some organizations before access was revoked.
For a developer with one VPS or a home GPU box, the first route is the bigger risk. Symantec says much of this exposure is "a matter of configuration rather than malware." That is good news: configuration is something you control.
Why an OpenAI-compatible API is easy to abuse
Most self-hosted servers copy the OpenAI API shape. Ollama serves one at http://localhost:11434/v1, its API docs show, and vLLM, a high-throughput inference server, does the same on port 8000 by default. Symantec points out that because most AI tools share this "OpenAI-compatible" interface, one scanner with one set of probes can find many kinds of targets.
The chain is short: a standard request goes in, no key is asked for, and from then on any OpenAI client library or agent framework can drive your model on your hardware.
How do attackers find exposed Ollama, vLLM and LiteLLM servers?
LLMjacking starts with discovery, and discovery is automated and cheap. Symantec's AI honeypot, a decoy that pretends to be an unprotected AI service, logged more than 127,000 external requests from tens of thousands of unique addresses over its monitoring period. Most of that traffic was reconnaissance of model endpoints, sprays of stolen API keys, and probes for exposed configuration files, Symantec says.
A probe does not need anything clever. Default ports and paths are documented, so a scanner just asks for them:
| Server | Default port | A path that answers without auth if left open | Documented by |
|---|---|---|---|
| Ollama | 11434 | GET /api/tags lists every model and its size | Ollama docs |
| Ollama (OpenAI-style) | 11434 | /v1/... endpoints | Ollama docs |
| vLLM | 8000 | /v1/... with no --api-key; some paths stay open even with a key | vLLM docs |
| LiteLLM proxy | 4000 in its examples | Admin and key routes, if no master key is set | LiteLLM docs |
Ollama's /api/tags endpoint returns each model's name, size, parameter count and quantization: a menu for an attacker. GTIG also documents a script that checked exposed Ollama servers by calling /api/create to register the attacker's own models on them.
Stolen-key sprays are the other half of LLMjacking reconnaissance, and they work the other way round. The attacker already holds a list of keys and tries each one against known endpoints. GTIG lists where such keys come from: public GitHub repositories, misconfigured service-account keys, access logs and cloud secret managers. It also describes "validation sweeps," tiny requests such as max_tokens=1 that check whether a stolen key still works before it is sold or used.
Symantec's conclusion is blunt: organizations should assume exposed AI services, model gateways or MCP servers will be found and tested soon after they go live.

Two dated LLMjacking examples: Skynet and CVE-2026-40217
Symantec's "Skynet" agent (October 21, 2026)
On October 21, 2026, Symantec researchers Priti More and Susmit Yenkar published an analysis of an autonomous attack agent captured by their honeypot in summer 2026. The operators sent their full working prompt to what they thought was a real, unprotected model. The honeypot recorded it.
Symantec's own summary of what makes it different: "the stolen model does not simply answer questions; it plans and drives the attack." The hijacked model acts as the planner, while the agent's tools do the scanning and exploitation against other victims.
What the captured instructions contained, according to Symantec:
About 74 offensive tool definitions, covering internet-wide discovery through FOFA (a search engine for connected devices), database dumping, command injection and server-side request forgery (SSRF).
Targeted platforms. VS Code servers, Django, Jupyter, Laravel, Supabase, Next.js and Flask/Werkzeug, including recovery of the Werkzeug debugger PIN for remote code execution.
A layered jailbreak. It recast reading
.envfiles, API keys and database schemas as routine development work, and told the model to dismiss its own safety warnings."Skynet mode." A final directive authorized up to 100,000 unattended steps, with tools run immediately and no asking for permission. It told the model to deploy miners quietly under
/tmp/.xand to keep looping: scan, infect, deploy miners, reinfect.A miner payload. A second request a day later, from a rotated address, carried an encoded shell script. It fetches or compiles XMRig, an open-source Monero miner, makes its config immutable and keeps erasing access logs. It hides the miner as
.tracein directories used by go2rtc, a video streaming server found in smart camera and Home Assistant setups.
What Symantec did not report matters just as much. The honeypot executed none of the tool calls and did not run the miner script. Symantec reports captured instructions, not confirmed victims. It notes that the first request carried a harmless programming challenge from a legitimate training platform, which suggests the operators may have been testing the tool on a safe target. Symantec does not attribute the activity to any named group or country.
The honest reading: a well-built LLMjacking tool, with no public evidence ByteMuni could find of real victims. It shows what an exposed endpoint is worth to whoever finds it.
LiteLLM CVE-2026-40217: a gateway flaw on CISA's exploited list
CVE-2026-40217 is a sandbox escape in LiteLLM's custom-code guardrail. The POST /guardrails/test_custom_code endpoint runs user-supplied Python inside a hand-built sandbox. LiteLLM's GitHub advisory says bytecode-level tricks can escape that sandbox and run arbitrary code inside the proxy process. That process runs as root in the default Docker image.
The mechanism: the endpoint checks submitted source against a deny-list of risky patterns, but Python runs compiled bytecode, not text. Bytecode rewritten to do what the deny-list never saw gets code execution on the gateway, which holds your provider API keys.
The flaw was found by X41 D-Sec, a German security firm. It published its advisory on April 8, 2026, when the embargo expired with no vendor patch available. LiteLLM published its GitHub advisory on May 7, 2026. On November 18, 2026, CISA added the CVE to its Known Exploited Vulnerabilities (KEV) catalog, which lists flaws with evidence of active exploitation. US federal agencies must fix it by December 2, 2026.
The sources disagree on two points: which versions are fixed, and how severe the flaw is.
| Question | What each source says |
|---|---|
| Affected versions | LiteLLM advisory: 1.81.8 up to, but not including, 1.83.10. X41: confirmed on the main-latest Docker image, no release numbers listed. NVD: "LiteLLM through 2026-04-08." |
| Fixed version | LiteLLM advisory header: 1.83.10 or later. The same advisory's Patches section: 1.83.11, which replaced the sandbox with RestrictedPython. SecureLayer7, a security firm: a partial fix in 1.83.10-stable and the complete fix in 1.83.14-stable. |
| Severity | LiteLLM (GitHub): CVSS v4 5.9, Moderate, with high privileges required. X41: CVSS 4.0 8.7, High. NVD record (assigned by MITRE): CVSS 3.1 8.8, High. Obsidian Security scores a chain of three LiteLLM CVEs, including this one, at 9.9. |
| Who can exploit it | LiteLLM: a proxy-admin credential is needed in default setups. X41: the endpoint requires the master key. SecureLayer7 and Obsidian: a low-privilege user can first reach admin through two other CVEs (CVE-2026-47101 and CVE-2026-47102), then use this one. |
| What the CVE covers | The CVE record, LiteLLM's advisory, X41 and CISA all describe the /guardrails/test_custom_code sandbox escape. GTIG's November 2 report uses the same CVE ID for different activity: a user ID rebind in /key/regenerate that turned virtual keys into admin keys. These are two different mechanisms, and no public source ByteMuni found reconciles them. |
Treat that last row as an unresolved reporting inconsistency, not as two confirmed descriptions of one bug. This article follows the CVE record and the vendor advisory. GTIG's privilege-escalation finding may belong to a related LiteLLM flaw; SecureLayer7 and Obsidian Security describe a chain in which CVE-2026-47101 and CVE-2026-47102 lift a low-privilege user to admin before CVE-2026-40217 is used. That is a possible explanation, not a confirmed one.
The practical answer does not depend on settling these disputes. Rather than aiming for any one disputed threshold, upgrade to the current supported release. The newest LiteLLM release on PyPI was 1.111.1 (November 29, 2026) when ByteMuni checked on November 30, 2026, which is past every fixed version any source claims. Check the PyPI release history for the latest version before you install, and pin the exact version you test.
Two releases need more than an upgrade. LiteLLM's incident report says its compromised release pipeline pushed 1.107.0 to PyPI and its Docker registry on October 21, 2026, with malware that steals credentials and loads remote-code execution tools. Snyk reports that 1.82.7 and 1.82.8 were malicious uploads on March 24, 2026. Upgrading does not undo credential theft. If you ran one of these versions:
Isolate the affected host or container.
Revoke and reissue every credential the process could reach: provider API keys, the LiteLLM master key, cloud credentials, database passwords and anything in its environment variables.
Review provider usage, cloud logs and outbound network logs for signs that secrets were used or sent out.
Rebuild from a clean image or a fresh environment rather than cleaning in place.
Reinstall dependencies from a pinned, known-good version list and check what is installed before you go live again.
If you cannot upgrade yet, LiteLLM and X41 both suggest blocking /guardrails/test_custom_code at your reverse proxy. X41 also advises keeping the master key to trusted admins, firewalling the management interface and running the container as a non-root user.
Who is exposed: common self-hosted AI setups
These are the setups developers in India commonly run on a VPS, a rented cloud GPU, a home server or Docker. Each row is based on the tool's own documentation.
| Setup | Why it can end up exposed | Safer default |
|---|---|---|
| Ollama installed directly | Safe out of the box: Ollama "binds 127.0.0.1 port 11434 by default," says its FAQ. The risk starts when you set OLLAMA_HOST=0.0.0.0:11434 so a laptop or a teammate can reach it. Ollama's FAQ describes no login or API-key setting for the local server. | Keep the default bind; reach it through a proxy with auth or a private network |
Ollama in Docker with -p 11434:11434 | Docker publishes ports to all host addresses by default and calls this "insecure by default." Its docs also warn that published-port traffic is routed before ufw rules apply, "effectively ignoring your firewall configuration." | -p 127.0.0.1:11434:11434 |
vLLM without --api-key | Anyone who reaches the port can run inference. | Bind locally, set a key, put a reverse proxy in front |
vLLM with --api-key | The key does not protect every endpoint. vLLM's current security docs say it covers only the /v1, /v2, /inference and /cohere prefixes, and list paths such as /invocations, /pooling, /score, /pause, /metrics and /tokenize as unprotected. Behavior can change between versions, so check the security docs for the version you run. They warn: "Do not rely exclusively on --api-key." | Reverse proxy that allowlists only the paths you use |
| LiteLLM proxy without a master key, or an old version | The master key is the proxy admin key. Old versions carry CVE-2026-40217 and related flaws. | Master key set, current release, admin routes not public |
| Open WebUI exposed | Open WebUI, a browser chat front end often paired with Ollama, defaults to ENABLE_SIGNUP=True, with new users held as pending. Signup, admin approval and model access are separate controls: changing the default role to user skips approval and lets anyone who signs up use your configured models. | Turn off signup once your accounts exist |
| MCP servers | Model Context Protocol (MCP) servers connect models to real tools. Symantec lists them among the agent's targets. | Never expose without auth; prefer local stdio transport |
A home server needs one extra LLMjacking check: if you forwarded port 11434, 8000 or 4000 on your router, the box is on the internet even though it sits in your room.
How to check if your AI endpoint is exposed
Checking your own exposure to LLMjacking takes about a minute. Run the first commands on the server, then test from a different network, such as a laptop on your phone's hotspot.
1. See what address the server listens on.
sudo ss -tlnp | grep -E '11434|8000|4000'127.0.0.1:11434 or [::1]:11434 means local only, which is good. 0.0.0.0:11434, *:11434 or [::]:11434 means every network interface is listening, so the firewall is now your only protection.
2. Check Docker port mappings.
docker ps --format 'table {{.Names}}\t{{.Ports}}'0.0.0.0:11434->11434/tcp means the container is published on all addresses, and ufw will not stop it. 127.0.0.1:11434->11434/tcp is local only.
3. Test from outside. Replace 203.0.113.10 with your server's public IP.
curl -s --max-time 5 http://203.0.113.10:11434/api/tags
curl -s --max-time 5 http://203.0.113.10:8000/v1/models
curl -s --max-time 5 http://203.0.113.10:4000/v1/modelsRead the results like this:
JSON from Ollama's
/api/tags: the server is publicly reachable. Ollama has no built-in login, so in practice anyone who can list the models can also run them.JSON from
/v1/modelson vLLM or LiteLLM: the endpoint is publicly reachable and exposing model information. That alone does not prove inference is open, because authentication can differ by path. Test an inference request separately, on your own server, without a key.A timeout or "connection refused": the port is not reachable from that network.
A
401: the endpoint asks for a key. That is better, but scanners can still see it and try stolen keys against it.
4. Check your LiteLLM version.
pip show litellm | grep -i '^version'
# or, inside a container:
docker exec <container-name> pip show litellm | grep -i '^version'Compare the result with the current release on PyPI and upgrade if you are behind. Every version below 1.83.14 falls inside at least one source's affected range for CVE-2026-40217. If the result is 1.107.0, 1.82.7 or 1.82.8, follow the incident steps in the CVE section above, not just an upgrade. SecureLayer7 also notes the version shows up in an x-litellm-version response header, so scanners can read it from outside.
How to secure an Ollama server and other self-hosted models
No single setting makes a server safe from LLMjacking. Each layer below covers a gap the others leave, so use as many as fit your setup.

1. Bind the model server to localhost
For Ollama installed directly, keep the default. If you changed it, check the systemd override, which Ollama's FAQ tells you to edit with systemctl edit ollama.service:
[Service]
Environment="OLLAMA_HOST=127.0.0.1:11434"sudo systemctl daemon-reload
sudo systemctl restart ollamaFor Docker, publish to the loopback address only, using the form Docker's port-publishing docs show:
docker run -d -v ollama:/root/.ollama -p 127.0.0.1:11434:11434 --name ollama ollama/ollamaFor vLLM, bind to localhost and set a key:
export VLLM_API_KEY="$(openssl rand -hex 32)"
vllm serve <model-name> --host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"Trade-off: other machines can no longer reach the model directly. That is the point. Layers 3 and 5 give trusted users a way back in.
2. Close the port with a firewall and security group
On Ubuntu, ufw, the Uncomplicated Firewall, can deny everything inbound except SSH and the web ports your proxy uses:
sudo ufw default deny incoming
sudo ufw allow OpenSSH
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verboseOn a cloud VPS or GPU instance, also remove 11434, 8000 and 4000 from the provider's security group. That firewall sits outside your machine, so it still blocks traffic when Docker or a config change goes wrong.
Trap: as Docker's docs explain, ufw does not filter Docker-published ports. Fix the -p mapping in layer 1, and rely on the cloud firewall as the backstop.
3. Put a reverse proxy with authentication in front
Ollama's FAQ shows NGINX, a widely used web server and reverse proxy, as the documented way to expose it. The FAQ's example has no authentication, so add NGINX's auth_basic module. Serve it over HTTPS only: basic auth sends the password with every request, and plain HTTP would leak it.
sudo htpasswd -c /etc/nginx/.htpasswd aliceserver {
listen 443 ssl;
server_name ai.example.com;
# ssl_certificate and ssl_certificate_key lines go here
location / {
auth_basic "Private model";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://localhost:11434;
proxy_set_header Host localhost:11434;
}
}This example assumes NGINX and Ollama run on the same host. If NGINX runs in its own Docker container, localhost means the NGINX container itself, so point proxy_pass at the Ollama container's service name on a shared Docker network instead (for example http://ollama:11434 when the container is named ollama).
To limit access to known networks as well, NGINX's access module adds allow 198.51.100.0/24; and deny all; lines, and the satisfy directive decides whether both checks must pass. For vLLM, the vLLM docs recommend a reverse proxy that allowlists only the endpoints you want users to reach. For LiteLLM, block the risky route until you have upgraded:
location = /guardrails/test_custom_code {
return 403;
}Trade-off: check that every client you use, such as a desktop app or editor plugin, can send these credentials before you switch. For those, a private network (layer 5) works better than a password prompt.
4. Use API keys properly, and rotate leaked ones
On LiteLLM, set a master key, which the docs say must start with sk-, then hand out scoped virtual keys rather than the master key:
general_settings:
master_key: os.environ/LITELLM_MASTER_KEYcurl -X POST 'http://127.0.0.1:4000/key/generate' \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H 'Content-Type: application/json' \
-d '{"models": ["my-model"], "max_budget": 10, "rpm_limit": 60, "duration": "30d"}'That key can call only my-model, stops at its budget, is rate-limited and expires in 30 days. Symantec's advice matches: treat AI keys as high-value credentials, scope them narrowly and keep them out of code.
If a key leaked, revoke it at the provider first, then issue a new one. Deleting the commit that exposed it is not enough: GTIG reports attackers harvesting keys from public GitHub repositories, and the old commit stays in Git history. The Railway breach and key rotation case shows the order of steps.
5. Use a private network for remote access
If only you and your team need the model, do not publish it at all. Reach it over SSH port forwarding or a VPN, so the server stays bound to localhost and the internet sees nothing:
ssh -L 11434:localhost:11434 [email protected]Your laptop's localhost:11434 now reaches the server's Ollama through the encrypted SSH session. Mesh VPN tools such as Tailscale do the same thing for a whole team. Follow the vendor's own setup docs for those.
6. Patch the gateway, cap spending, restrict the process
Patch. GTIG lists gateway patch management as a mitigation and names LiteLLM and CVE-2026-40217. Pin exact versions and avoid known-bad releases.
Rate limits and budgets. OWASP's Top 10 for LLM applications calls this risk "Unbounded Consumption" (LLM10:2025), including "Denial of Wallet," and lists rate limiting and access controls among its defenses. Set provider billing alerts and hard caps wherever your provider offers them.
Do not run as root. X41 points out the LiteLLM container runs as root by default and suggests
--user. Ollama's Linux docs create a dedicatedollamasystem user and run the service withUser=ollama. Keep it that way.Limit outbound traffic. Symantec advises restricting outbound access from hosts running AI tools, and enforcing IMDSv2 with a hop limit of one on cloud workloads to block SSRF credential theft.
Signs of LLMjacking on your server, plus a checklist
None of these signs proves a compromise, and their absence does not prove you are safe. They tell you where to look.
GPU busy when you are not. Run
nvidia-smi. Steady load with nobody using the model is worth checking.Unknown clients in the logs. On a systemd install, Ollama's Linux docs use
journalctl -e -u ollamato read the service log, which includes incoming requests. Look for IP addresses you do not recognize.Unexpected models. GTIG saw attackers registering their own models through
/api/create. Compareollama listwith what you installed.Miner-like processes.
ps aux --sort=-%cpu | headshows the top CPU users. Symantec's sample hid files at/tmp/.xand as.tracein go2rtc directories, and made its config immutable.lsattrshows that attribute.Bills and tiny requests. Sudden token-usage spikes, or many
max_tokens=1requests, which GTIG describes as attackers testing whether a stolen key works.
If you find signs of a real compromise, treat the host as untrusted: rotate every key stored on it and rebuild from a clean image.
Copy-paste LLMjacking checklist
ss -tlnpshows model ports on127.0.0.1only.docker psshows127.0.0.1:in front of every model port.curlfrom another network to 11434, 8000 and 4000 times out.Cloud security group allows only 22 and 443, ideally SSH from your own IP only.
Anything public sits behind HTTPS plus auth: NGINX basic auth, an auth proxy or a VPN.
vLLM runs with
--api-keyand behind a proxy that allowlists paths.LiteLLM has a master key, scoped virtual keys with budgets, and runs the current release from PyPI. Any host that ran 1.107.0, 1.82.7 or 1.82.8 has been rebuilt and its secrets rotated.
/guardrails/test_custom_codeis blocked if you cannot upgrade.Open WebUI signup is off once your users exist.
No API keys in Git; leaked keys revoked at the provider, not just deleted.
Billing alerts and caps are set; GPU and token usage are checked weekly.
Model servers and gateways run as non-root users.
My take on LLMjacking
My read is that LLMjacking is an old lesson in a new place. We stopped leaving Redis and Elasticsearch open years ago, and then a new class of server arrived with an open port, no auth and a five-minute tutorial. The Skynet report shows the attacker side has caught up: an open model is no longer just free compute but a planner that will run someone else's campaign.
The engineering habit worth changing is treating "it's only for me" as a security setting. Teams running agents should apply the same thinking to their own tools, which is the idea behind an AI agent kill switch. And anyone new to how a model "plans" with tools will find how AI agents work explains why a hijacked model is more than a stolen chatbot.
The bottom line on securing a self-hosted AI model
Decide first whether the model needs to be reachable from the internet at all. For most solo developers and student projects, it does not: keep it on 127.0.0.1 and use SSH forwarding or a VPN. If it must be public, put it behind HTTPS with authentication and a firewall that allows nothing else, and keep any gateway like LiteLLM on a current release. Then watch your GPU and your bill, because that is where LLMjacking shows up first.
Frequently asked questions
Does Ollama have built-in authentication?
Ollama's FAQ describes no login or API-key setting for the local server. It binds to 127.0.0.1:11434 by default, and the documented way to expose it is a proxy such as NGINX, where you add authentication yourself.
Is it safe to set OLLAMA_HOST=0.0.0.0?
Only if a firewall or private network stops the internet from reaching port 11434. Setting it makes Ollama listen on every interface, and with no built-in auth, anyone who reaches the port can list and run your models.
Why does ufw not block my Docker container's port?
Docker's documentation says traffic to published container ports is routed before ufw rules apply, effectively ignoring the firewall configuration. Publish with -p 127.0.0.1:11434:11434 and also close the port in your cloud security group.
Was Symantec's Skynet agent used in real attacks?
Symantec reported captured instructions, not confirmed victims. Its honeypot ran none of the agent's tools, the operators may have been testing on a safe target, and Symantec did not attribute the activity to anyone.
Which LiteLLM version fixes CVE-2026-40217?
Sources disagree: LiteLLM's advisory lists 1.83.10 in its header and 1.83.11 in its patch notes, and SecureLayer7 says the complete fix landed in 1.83.14-stable. The latest release on PyPI was 1.111.1 on November 29, 2026. Avoid 1.107.0, which LiteLLM says was a compromised release.
Is setting --api-key on vLLM enough?
No. vLLM's security docs say the key protects only the /v1, /v2, /inference and /cohere path prefixes and warn against relying on it alone. They recommend a reverse proxy that allowlists only the endpoints you use.



