Back to skill

Security audit

Ollama on Windows — Setup, CORS Fix & Custom Models

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only Ollama setup skill, but it should be reviewed because it tells users to permanently allow any website to access their local Ollama service without a clear warning.

Install only if you are comfortable editing the CORS guidance before use. Prefer an exact trusted origin such as your local web UI URL instead of *, avoid making wildcard CORS permanent, and remove any persistent OLLAMA_ORIGINS=* setting after troubleshooting.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
README.md:14
Finding
Wildcard CORS Policy Exposes the Local Ollama API to Untrusted Websites## Vulnerability Details **File Location**: `README.md`, lines 14–29 **Vulnerability Type**: Unrestricted cross-origin access to a local API **Risk Level**: High The guide instructs users to configure `OLLAMA_ORIGINS` as `*`, both temporarily and as a persistent user environment variable: ```powershell ### Via PowerShell (temporary): $env:OLLAMA_ORIGINS = "*" ollama serve ``` ```text ### Via System Settings (permanent): 1. Open System Properties → Environment Variables 2. Under User variables, click New 3. Variable name: OLLAMA_ORIGINS 4. Variable value: * 5. Restart Ollama ``` ### Technical Analysis CORS controls which browser origins may read responses from and interact with the Ollama HTTP API. Setting `OLLAMA_ORIGINS` to `*` permits requests from every website origin rather than limiting access to the intended local web application. Ollama commonly exposes a local HTTP API without a separate authentication layer. When wildcard CORS is enabled, JavaScript hosted on an attacker-controlled website may be able to issue accepted cross-origin requests to that API while the victim browses the site. The permanent configuration increases the exposure window because the unsafe policy remains active across later Ollama sessions. The vulnerability is especially significant if Ollama is also configured to listen on a network-accessible interface. However, even a loopback-only service can be targeted by browser code running on a remote website because the requests originate from the victim's browser. ### Attack Path 1. A user follows the documented instructions and sets `OLLAMA_ORIGINS` to `*`. 2. The user starts Ollama, exposing its local HTTP API with unrestricted browser-origin access. 3. The user visits an attacker-controlled or compromised website. 4. JavaScript on that website sends cross-origin requests from the browser to the local Ollama endpoint. 5. Because every origin is allowed, Ollama accepts the website's origin and the browser permits the cross- ...[truncated 1083 chars]
Remediation
## Remediation Suggestions 1. Replace the wildcard with the exact trusted web application origin. For example: ```powershell $env:OLLAMA_ORIGINS = "http://localhost:3000" ollama serve ``` 2. If multiple front ends are required, explicitly enumerate only the origins that Ollama supports rather than using `*`. 3. Keep Ollama bound to the loopback interface unless remote network access is an explicit requirement. 4. If network access is necessary, place Ollama behind an authenticated reverse proxy, enforce TLS, and restrict inbound connections with host firewall rules. 5. Avoid presenting wildcard CORS as a general or permanent fix. Document it only as a short-lived diagnostic option, accompanied by a clear security warning. 6. Advise users to restart Ollama after narrowing the origin policy and verify that requests from unapproved origins are rejected. 7. Remove any persistent `OLLAMA_ORIGINS=*` user environment variable after troubleshooting is complete.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Unsafe Defaults

Medium
Category
Tool Misuse
Content
# Ollama on Windows — Complete Setup, CORS Fix & Custom Models

## What This Solves
Confidence
89% confidence
Finding
The skill positions a 'CORS Fix' as part of the normal setup flow, and the body defaults to an unsafe wildcard configuration. In this context, the documentation normalizes a less-secure default for convenience, which makes the risk more likely to be adopted widely by non-expert users running a local service accessed by browsers.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The guide tells users to enable wildcard CORS but does not warn that this makes the local Ollama service callable from arbitrary browser contexts. Because this is a setup guide for desktop users, many readers may apply the setting without understanding that visiting a malicious page could trigger requests to the local AI service.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The README explicitly instructs users to set `OLLAMA_ORIGINS="*"`, which allows any website origin to make browser requests to the local Ollama service. In the context of a local AI service, this broad CORS policy can let malicious web pages interact with the user's local model endpoint, increasing risk of prompt injection, data exfiltration from local workflows, or misuse of local compute resources.

Scope Creep

Low
Category
Excessive Agency
Content
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Static analysis

No suspicious patterns detected.