Skip to content

Commit 93897af

Browse files
committed
Detect an exposed Ollama API and an open Open WebUI
Two more read only checks for self-hosted AI tools, the sort attackers hunt to run their own work on someone else's compute and model keys. Ollama has no built-in authentication, so an instance that answers from outside is open to anyone to run its models, pull and register models, and read what is installed. The check confirms it by the string Ollama returns at its root and by the model listing it serves, against a control. Open WebUI publishes in its config whether signup is open or authentication is off. The check reads that public config and fires when either is true, which means a stranger can use the AI. The remediation says how to close it and to rotate the model keys if strangers may have reached it. Both are plain GET requests that fetch, never change, and send no credentials.
1 parent 21edc05 commit 93897af

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"id": "misconfiguration-ollama-exposed",
3+
"class": "misconfiguration",
4+
"safety": "read",
5+
"severity_floor": "high",
6+
"title": "Ollama API is exposed without authentication",
7+
"summary": "An Ollama server is answering without any login. Ollama has no built-in authentication, so anyone who can reach it can run its models on the organization's hardware, pull and register models, and read what is installed. Exposed Ollama servers are actively taken over to run attackers' work on someone else's compute.",
8+
"needs": [],
9+
"candidate_paths": [
10+
"/",
11+
"/api/tags"
12+
],
13+
"probe": [
14+
{ "request": { "method": "GET", "path": "{route}" } }
15+
],
16+
"confirm": {
17+
"control": "A path that cannot exist, so the site's not found answer is known and the Ollama response is told apart from a soft 404.",
18+
"differential": "status == 200 and (body_contains(\"Ollama is running\") or (body_contains(\"\\\"models\\\"\") and body_contains(\"\\\"digest\\\"\"))) and body_differs(control)",
19+
"retest": 2
20+
},
21+
"reproduce": "curl -sk 'https://host/' (it answers 'Ollama is running') or 'https://host/api/tags' (it lists the installed models as JSON). If either answers without a login, the Ollama API is open to anyone.",
22+
"remediate": "Bind Ollama to 127.0.0.1, firewall its port (11434 by default) off the internet, and put any remote access behind an authenticated reverse proxy or VPN. Treat the models and the host as reachable by strangers until it is closed.",
23+
"references": [],
24+
"mappings": { "cwe": "CWE-306", "owasp": "A05:2021" },
25+
"rulesets": ["ollama"]
26+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "misconfiguration-open-webui-open-access",
3+
"class": "access-control",
4+
"safety": "read",
5+
"severity_floor": "high",
6+
"title": "Open WebUI lets anyone in (open signup or no authentication)",
7+
"summary": "This Open WebUI instance reports from its public config that signup is open, or that authentication is turned off entirely. Either way a stranger who can reach it can use the AI, which runs on the organization's model keys or hardware, and keep an account as a foothold.",
8+
"needs": [],
9+
"probe": [
10+
{ "request": { "method": "GET", "path": "/api/config" } }
11+
],
12+
"confirm": {
13+
"control": "A path that cannot exist, so the site's not found answer is known and the config response is told apart from a soft 404.",
14+
"differential": "status == 200 and body_contains(\"enable_login_form\") and body_contains(\"enable_signup\") and (body_contains(\"\\\"auth\\\":false\") or body_contains(\"\\\"enable_signup\\\":true\")) and body_differs(control)",
15+
"retest": 2
16+
},
17+
"reproduce": "curl -sk 'https://host/api/config' and read the JSON features: enable_login_form and enable_signup confirm it is Open WebUI. \"auth\":false means authentication is off; \"enable_signup\":true means anyone can register. Either way the instance is open.",
18+
"remediate": "Turn signup off (ENABLE_SIGNUP false, or Enable New Sign Ups in the admin panel) and keep authentication on (WEBUI_AUTH true). Put the instance behind single sign on or the gateway so only staff reach it, and rotate the model keys if strangers may have used them.",
19+
"references": [],
20+
"mappings": { "cwe": "CWE-1188", "owasp": "A05:2021" },
21+
"rulesets": ["open-webui"]
22+
}

0 commit comments

Comments
 (0)