Back to skill

Security audit

Cuda Ollama

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent guide for installing and using a local Ollama GPU router, with ordinary setup risks but no artifact-backed malicious behavior.

Install in a virtual environment or other low-privilege account, review the `ollama-herd` package source or pin a trusted version before installation, and only run the sudo systemd commands if you intentionally want to change the host Ollama service configuration.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:36
Finding

Unpinned Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 36
Vulnerability Type: Unpinned and mutable third-party dependency
Risk Level: Medium

Complete Code Snippet:

bash
pip install ollama-herd    # PyPI: https://pypi.org/project/ollama-herd/

Technical Analysis

The quick-start instruction installs ollama-herd from the configured Python package index without an exact version constraint or integrity hash. Consequently, the code installed by this command can change after the Skill has been reviewed.

Python package installation may execute package-controlled build or installation logic. The installed package and its transitive dependencies also execute when the documented herd and herd-node commands are subsequently launched. The package source is not included in the audited project, so its behavior could not be verified as part of this audit.

This is a supply-chain weakness rather than evidence that the currently published package is malicious. Exploitation requires compromise of a future package release, a dependency, the selected package index, or the user's package-resolution configuration.

Attack Path

  1. An attacker compromises the ollama-herd publishing account, one of its dependencies, or a package index used by the victim.
  2. The attacker publishes a malicious release that satisfies the unrestricted package request.
  3. A user follows the documented quick-start command.
  4. pip resolves and downloads the attacker-controlled release or dependency.
  5. Malicious code executes during package installation, import, or subsequent invocation of herd or herd-node.
  6. The payload operates with the privileges of the account that performed the installation or launched the service.

Impact Assessment

Successful exploitation could permit arbitrary code execution with the installing user's privileges. Depending on that account's access, the payload could read or modify user file ...[truncated 664 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the unrestricted installation command with an exact, reviewed release, for example:
    bash
    python3 -m pip install "ollama-herd==<reviewed-version>"
    
  2. Publish a lock file or requirements file containing exact versions for the package and all transitive dependencies.
  3. Record and verify distribution hashes, and install with pip's --require-hashes option:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  4. Explicitly specify the trusted package index and warn users that custom pip index configuration can alter package resolution.
  5. Recommend installation in a dedicated virtual environment under an unprivileged service account rather than with sudo or an administrator account.
  6. Review each pinned release and its dependency changes before updating the documented version and hashes.
  7. Where practical, provide signed release artifacts, attestations, or reproducible-build information so users can validate package provenance.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

print(chunk.choices[0].delta.content or "", end="")

text

### curl (Ollama format)

```bash
# Routes to best available NVIDIA CUDA GPU

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
curl -s http://localhost:11435/fleet/status | python3 -m json.tool

# CUDA GPU health — 15 automated checks
curl -s http://localhost:11435/dashboard/api/health | python3 -m json.tool

# Which CUDA models are loaded
curl -s http://localhost:11435/api/ps | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

curl -s http://localhost:11435/dashboard/api/health | python3 -m json.tool

Which CUDA models are loaded

curl -s http://localhost:11435/api/ps | python3 -m json.tool

text

Web dashboard at `http://localhost:11435/dashboard` — live view of all NVIDIA CUDA nodes, queues, and models.

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 80)May include surrounding context.

print(chunk.choices[0].delta.content or "", end="")

text

### curl (Ollama format)

```bash
# Routes to best available NVIDIA CUDA GPU

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
# Linux (systemd)
sudo systemctl edit ollama
# Add under [Service]:
#   Environment="OLLAMA_KEEP_ALIVE=-1"
#   Environment="OLLAMA_MAX_LOADED_MODELS=-1"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
#   Environment="OLLAMA_KEEP_ALIVE=-1"
#   Environment="OLLAMA_MAX_LOADED_MODELS=-1"
#   Environment="OLLAMA_NUM_PARALLEL=2"
sudo systemctl restart ollama

# Windows (PowerShell)
[System.Environment]::SetEnvironmentVariable("OLLAMA_KEEP_ALIVE", "-1", "User")

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 143)May include surrounding context.

Image generation

bash
curl http://localhost:11435/api/generate-image \
  -d '{"model": "z-image-turbo", "prompt": "NVIDIA GPU rendering abstract art", "width": 1024, "height": 1024}'

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The description line includes English, Chinese, and Spanish text in a fixed way, which can be interpreted as imposing language choices rather than letting the user opt in to a preferred language. The policy requires avoiding language or locale constraints unless the skill offers choice or clearly documents the reason.

Content

No source excerpt is available for this finding.