Back to skill

Security audit

ollama-skill

Security checks for vulnerabilities and agentic risk

Overview

This Ollama integration skill is mostly coherent, but its default Docker examples can expose an unauthenticated Ollama API beyond the local machine and its cloud examples need clearer privacy warnings.

Review before installing if you plan to run the Docker setup or cloud examples. Prefer binding Ollama to 127.0.0.1, avoid exposing port 11434 to untrusted networks, pin dependencies and container images for repeatable installs, and treat cloud mode or web search as sending prompt/query data off-device.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
docker-compose.yml:5
Finding

Unauthenticated Ollama API Exposed on All Host Interfaces

Content
View full analysis

Vulnerability Details

File Location: docker-compose.yml:5-6
Vulnerability Type: Unrestricted network service exposure
Risk Level: Medium

Vulnerable Code

yaml
ports:
  - "11434:11434"

Technical Analysis

Docker publishes this port on all host interfaces by default. The project documentation states that the local Ollama API does not require authentication. Consequently, running this Compose configuration on a host whose port 11434 is reachable from an untrusted network exposes the unauthenticated Ollama API to that network.

This exposure is unnecessary for the default local integration workflow, which only requires access through the loopback interface. The configuration therefore grants broader network access than the Skill's local-use case requires.

Attack Path

  1. A user starts the service with docker compose up -d.
  2. Docker binds host port 11434 to all available interfaces.
  3. An attacker identifies a host where TCP port 11434 is reachable.
  4. The attacker connects directly to the Ollama API without authentication.
  5. The attacker invokes exposed endpoints to enumerate models, submit inference workloads, or perform other operations supported by the installed Ollama version.
  6. Repeated or expensive requests consume host CPU, GPU, memory, and storage resources.

Exploitation depends on port 11434 being reachable through the host firewall or surrounding network controls.

Impact Assessment

An attacker can obtain unauthenticated network-level access to the Ollama service, but this finding alone does not establish host shell access. The practical scope includes unauthorized inference, service and model metadata exposure, compute-resource consumption, denial of service, and any additional unauthenticated model-management operations exposed by the deployed Ollama version.

Remediation
View remediation

Remediation Suggestions

Bind the published port to the loopback interface for the default local deployment:

yaml
services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    ports:
      - "127.0.0.1:11434:11434"
    volumes:
      - ollama:/root/.ollama
    restart: unless-stopped

If remote access is required:

  1. Do not expose the backend port directly to untrusted networks.
  2. Place Ollama behind an authenticated TLS reverse proxy.
  3. Restrict source addresses with host and network firewalls.
  4. Apply request-size, concurrency, and rate limits.
  5. Separate administrative or model-management access from ordinary inference access where supported.
  6. Document explicitly that the default Ollama endpoint has no authentication and must not be internet-exposed.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Mutable and Broadly Versioned Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Locations: requirements.txt:1-6, package.json:11-14, and docker-compose.yml:3
Vulnerability Type: Non-reproducible dependency and container resolution
Risk Level: Low

Vulnerable Code

requirements.txt:1-6:

text
ollama>=0.6.0
openai>=1.0.0
anthropic>=0.34.0
pydantic>=2.0.0
python-dotenv>=1.0.0
requests>=2.31.0

package.json:11-14:

json
"dependencies": {
  "ollama": "^0.5.0",
  "zod": "^3.23.8",
  "zod-to-json-schema": "^3.23.3"
}

docker-compose.yml:3:

yaml
image: ollama/ollama

Technical Analysis

The Python requirements use open-ended minimum versions, while the Node.js manifest uses caret ranges. No Python or Node lockfile was present in the audited project. The container reference omits both a version tag and an immutable digest, causing it to resolve through the mutable default image tag.

These choices make installations and deployments non-reproducible. A future package release or replacement container image can be selected without any source change or explicit review. This does not prove that any current dependency is malicious, but it expands the supply-chain attack surface and can silently introduce vulnerable, compromised, or incompatible code.

Attack Path

  1. An attacker compromises a permitted future dependency release or the mutable container-image publication channel.
  2. The user subsequently runs pip install -r requirements.txt, installs the Node dependencies without a trusted lockfile, or pulls the Compose image.
  3. The package manager resolves a newer release allowed by the version range, or Docker resolves the changed default image.
  4. Package installation hooks, imported library code, or container startup code executes in the user's environment.
  5. Compromised code operates with the privileges granted to the package installation process, application process, or container.

This path ...[truncated 725 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin direct Python dependencies to reviewed exact versions.

  2. Generate and commit a hash-verified lockfile using a tool such as pip-compile, Poetry, or uv.

  3. Commit a Node.js lockfile and use deterministic installation such as npm ci.

  4. Review transitive dependency changes before updating lockfiles.

  5. Pin the Ollama image to a reviewed release and immutable digest, for example:

    yaml
    image: ollama/ollama:<reviewed-version>@sha256:<reviewed-digest>
    
  6. Use automated vulnerability scanning for lockfiles and container images.

  7. Configure update automation to open reviewed change requests rather than silently selecting new releases at installation time.

  8. Run examples and containers with the minimum necessary operating-system and filesystem privileges.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (40)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 65)May include surrounding context.

md
1. Read `SKILL.md` inside the installed directory

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 127)May include surrounding context.

md
# Clone and setup
git clone https://github.com/WaiYanNyeinNaing/ollama-skill.git
cd ollama-skill
cp .env.example .env
pip install -r requirements.txt

# Run example

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill provides shell commands and environment-variable based setup instructions but does not declare any explicit tool scope or allowed-tools metadata. In agent environments, this can cause the harness to grant broader execution capability than users expect, increasing the chance of unintended command execution or secret exposure during installation and use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill promotes web search without explicitly warning that search queries may include or reveal sensitive user context to external providers. In agent workflows, generated queries can unintentionally leak internal project names, code fragments, or investigative context to third parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes direct cloud API use but does not clearly warn that prompts, source code, and other user data may leave the local machine and be transmitted to a third-party service. In a coding-agent context, that omission can lead to accidental disclosure of proprietary code, secrets, or regulated data.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 110)May include surrounding context.

md
OLLAMA_API_BASE = os.getenv("OLLAMA_API_BASE", "http://localhost:11434/api")
MODEL = os.getenv("OLLAMA_MODEL", "qwen3-coder")

response = requests.post(
    f"{OLLAMA_API_BASE}/chat",
    json={
        "model": MODEL,

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 183)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 243)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 268)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 300)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 183)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 243)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 300)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · SKILL.md (reported line 183)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · SKILL.md (reported line 205)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · SKILL.md (reported line 243)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · SKILL.md (reported line 268)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · SKILL.md (reported line 300)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/chat",
    json={
        "model": "qwen3-coder",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 268)May include surrounding context.

python
import requests

response = requests.post(
    "http://localhost:11434/api/embed",
    json={
        "model": "embeddinggemma",

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The Docker run example references the ollama/ollama image without a fixed tag or digest, making deployments non-reproducible and exposing users to supply-chain risk if the upstream image changes unexpectedly. An attacker controlling or compromising the image source could cause users to pull a malicious or vulnerable image.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · examples/curl_chat.sh (reported line 2)May include surrounding context.

sh
#!/usr/bin/env bash
curl http://localhost:11434/api/chat -H "Content-Type: application/json" -d '{
  "model": "gemma3",
  "messages": [{"role": "user", "content": "Hello!"}],
  "stream": false

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This example transmits prompt content to a remote cloud endpoint at https://ollama.com, and the code provides no disclosure, consent check, or warning that user-supplied data leaves the local environment. In an agent or IDE integration context, prompts can contain source code, secrets, proprietary data, or sensitive user input, so silent cloud transmission creates a meaningful privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
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.

Content

Scanner excerpt · SKILL.md (reported line 531)May include surrounding context.

md
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

Static analysis

No suspicious patterns detected.