Back to skill

Security audit

ollama-task-orchestrator

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent, but it gives agents broad SSH-based shell, file-write, and process-control power on a worker machine without strong guardrails.

Install only on a dedicated, low-privilege worker account with isolated non-production project directories. Treat this as remote shell access for any agent that can call it, disable or remove exec and NL exec unless truly needed, keep DEFAULT_PROJECT tightly controlled, review file writes before use, and avoid using shared workers or accounts with SSH keys, cloud credentials, or sensitive repositories.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
runner/run_task.sh:232
Finding

Unrestricted Remote Shell Command Execution Through the Exec Task

Content
View full analysis
str: """Run a task on the worker Mac with exclusivity locking.""" with self.lock: cmd = [f"{self.runner_path}/run_task.sh", *shlex.split(task_command)] stdout, stderr, code = self._ssh(cmd) ``` ### Technical Analysis The `exec` task intentionally accepts an arbitrary command string and evaluates it with Bash `eval`. The implementation has no command allowlist, authorization check, confirmation requirement, working-directory restriction, sandbox, or project-level confinement. Although remote command execution is documented as an available feature, it exceeds the privileges required for the Skill's primary queue-management, code-generation, controlled file-writing, and test-running functions. Any caller that can cause the Skill to process an `ollama run exec` request effectively obtains a shell under the SSH worker account. Using `eval` also causes shell syntax in the supplied value to be interpreted, including command substitutions, redirections, pipelines, variable expansion, and command separators. Quoting performed by the Python SSH layer does not make this safe because the runner deliberately re-evaluates the reconstructed string. ### Attack Path 1. An attacker supplies or induces an Agent to pro ...[truncated 1047 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
runner/run_task.sh:162
Finding

Generated File Writes Can Escape the Intended Project Boundary

Content
View full analysis
" exit 1 fi require_default_project case "$rel_file" in /*|../*|*/../*|..) echo "ERROR: file path must stay inside the project directory." exit 1 ;; esac local target_file="$PROJECTS_DIR/$DEFAULT_PROJECT/$rel_file" if [ "$DRY_RUN" = true ]; then echo "DRY RUN: would write generated code" echo "Target: $target_file" echo "Instruction: $instruction" return 0 fi local tmp_file tmp_file=$(mktemp /tmp/ollama_output_XXXXXX) mkdir -p "$(dirname "$target_file")" ollama_generate "$instruction" true > "$tmp_file" strip_to_code "$tmp_file" > "$target_file" rm -f "$tmp_file" echo "WROTE: $target_file" } ``` ### Technical Analysis The code validates only the caller-supplied `rel_file` value using lexical shell patterns. It does not validate `DEFAULT_PROJECT`, canonicalize the final destination, or verify that the resolved path remains under `PROJECTS_DIR`. A `DEFAULT_PROJECT` value containing traversal components can therefore move the final destination outside the configured projects directory. In addition, shell redirection follows symbolic links. A malicious or compromised project can place a symlink at the target location and cause generated output to overwrite a file outside the project. The check against `../` in `rel_file` does not prevent either condition because confinement is never enforced against the canonical final path. ### Attack Path #### Configuration traversal 1. An attacker gains control over or influences the worker's `DEFAULT ...[truncated 1373 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
runner/queue_status.sh:69
Finding

Queue Cleanup Can Terminate Unrelated Worker Processes

Content
View full analysis
/dev/null | tr '\n' ' ') CURLS=$(pgrep -f "curl.*11434" 2>/dev/null | tr '\n' ' ') ``` The Ollama restart path kills every process whose command line contains `ollama`: ```bash if [ "$OLLAMA_BUSY" = true ] && [ "$FORCE" = "--kill-ollama" ]; then echo -e "${RED}--kill-ollama: stopping Ollama server to cancel active generation...${NC}" pkill -9 -f "ollama" 2>/dev/null sleep 3 echo "Restarting Ollama server..." nohup ollama serve > /tmp/ollama.log 2>&1 & sleep 5 echo -e "${GREEN}Ollama restarted.${NC}" ``` The ordinary cleanup path also force-kills all broadly matched runners and curl processes: ```bash # Kill stuck runner bash processes (force kill) if [ -n "$RUNNERS" ]; then echo "Killing run_task.sh processes: $RUNNERS" kill -9 $RUNNERS 2>/dev/null fi # Kill curl processes if [ -n "$CURLS" ]; then echo "Killing curl processes: $CURLS" kill -9 $CURLS 2>/dev/null fi ``` ### Technical Analysis `pgrep -f` and `pkill -f` match against entire command lines. The patterns are not tied to the lock PID, a known parent process, a specific executable path, or a process created by this Skill. Consequently, any process with `run_task.sh`, `curl` followed by `11434`, or `ollama` in its command line may be selected. The script then uses `SIGKILL`, which prevents graceful cleanup and cannot be handled by the target. The cleanup operation also kills all matched runner processes rather than limiting termination to a verified stale task. This behavior exceeds the minimum privilege required to remove a stale lock and can interfere with unrelated Ollama users or other a ...[truncated 1294 chars]
Remediation
View remediation
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (19)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · README-claude-code.md (reported line 17)May include surrounding context.

Host HostName User IdentityFile ~/.ssh/id_ed25519

text

### Tell Claude Code about the runner

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 61)May include surrounding context.

Host HostName User IdentityFile ~/.ssh/id_ed25519

text

### Tell Claude Code about the runner

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 · runner/run_task.sh (reported line 71)May include surrounding context.

sh
print_status() {
  local active
  local api_base="${OLLAMA_URL%/api/generate}"
  active=$(curl -s --max-time 3 "$api_base/api/ps" 2>/dev/null | python3 -c \
    "import sys,json; m=json.load(sys.stdin).get('models',[]); print(m[0]['name']+' (busy)' if m else 'idle')" 2>/dev/null || echo "unknown")
  local lock_state="clear"
  if [ -d "$LOCK_DIR" ]; then

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 · runner/run_task.sh (reported line 116)May include surrounding context.

sh
local json_prompt
  json_prompt=$(printf '%s' "$prompt" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')

  curl -s --max-time "$OLLAMA_TIMEOUT" "$OLLAMA_URL" -d "{
    \"model\": \"$OLLAMA_MODEL\",
    \"prompt\": $json_prompt,
    \"stream\": false

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

In run_nl, once routing resolves to exec, the command is echoed and immediately passed to run_exec with no confirmation, sandboxing, or policy enforcement. Because routing may be rule-based or LLM-based, this enables arbitrary shell execution from natural-language input, which is especially risky in an agent/automation context where prompts may be attacker-influenced.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script presents the nl command as a safe natural-language router, but its implementation can dispatch to exec and run arbitrary shell commands when ALLOW_NL_EXEC=true. This creates a dangerous trust boundary failure: a user may provide a natural-language request expecting constrained behavior, yet the router can translate that request into direct command execution without a separate explicit approval step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file explicitly instructs the agent to use a write command that writes generated output directly to a specified file. Although the behavior is described later in the notes, there is no nearby warning about overwriting or modifying user files, which is relevant because markdown files should warn about behaviors affecting user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The documentation tells Codex to use a forceful cleanup command to clear stale locks, but does not warn that forcibly removing locks can disrupt in-progress jobs or affect runner state. For markdown files, potentially integrity-affecting actions should be disclosed to the user.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

The skill is designed to provide persistent remote task execution capability via SSH, including arbitrary command execution and file modification on a worker machine. In an agent ecosystem, this meaningfully expands the blast radius of prompt injection or agent misuse because a compromised or overly trusted agent can repeatedly act on the remote host, not just within the local chat context.

Content

Scanner excerpt · README.md (reported line 5)May include surrounding context.

md
An [OpenClaw](https://openclaw.ai) skill that lets your AI agents queue and execute tasks on a local Ollama instance running on a worker Mac (or any machine accessible via SSH).

Agents can check Ollama's queue health, run code generation tasks, write files, run tests, or execute arbitrary shell commands — all through a simple `ollama status` / `ollama run` interface.

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly advertises that agents can write files and execute arbitrary shell commands over SSH, but it does not include any safety boundaries, trust assumptions, or warnings about system and data impact. In the context of an agent skill, this can normalize highly dangerous capabilities and lead operators to deploy it without understanding that prompt-driven actions may modify projects, access sensitive files, or damage the worker host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly offers a write task that generates and writes code to a file, but the specification does not warn that invoking it can modify files on a remote worker or project workspace. In agent settings, lack of an explicit modification warning can cause users or higher-level agents to trigger state-changing actions without informed consent, increasing the risk of unintended overwrite or persistence of unsafe generated code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The exec task advertises arbitrary shell-command execution with no accompanying safety notice, guardrails, or restriction language. In an agent skill, this effectively exposes remote command execution capability; without prominent warnings and constraints, it can be abused to run destructive commands, access sensitive data, or pivot further on the worker machine.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · install.sh (reported line 18)May include surrounding context.

sh
echo "Runner target: $RUNNER_DIR"
echo ""

mkdir -p "$RUNNER_DIR"

cp "$SCRIPT_DIR/runner/run_task.sh" "$RUNNER_DIR/run_task.sh"
cp "$SCRIPT_DIR/runner/queue_status.sh" "$RUNNER_DIR/queue_status.sh"

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · runner/queue_status.sh (reported line 120)May include surrounding context.

sh
pkill -9 -f "ollama" 2>/dev/null
    sleep 3
    echo "Restarting Ollama server..."
    nohup ollama serve > /tmp/ollama.log 2>&1 &
    sleep 5
    echo -e "${GREEN}Ollama restarted.${NC}"

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 · runner/queue_status.sh (reported line 147)May include surrounding context.

sh
kill -9 $RUNNERS 2>/dev/null
  fi

  # Kill curl processes
  if [ -n "$CURLS" ]; then
    echo "Killing curl processes: $CURLS"
    kill -9 $CURLS 2>/dev/null

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 · runner/run_task.sh (reported line 116)May include surrounding context.

sh
local json_prompt
  json_prompt=$(printf '%s' "$prompt" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')

  curl -s --max-time "$OLLAMA_TIMEOUT" "$OLLAMA_URL" -d "{
    \"model\": \"$OLLAMA_MODEL\",
    \"prompt\": $json_prompt,
    \"stream\": false

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

This SSH invocation executes a remote shell command constructed from user-influenced input. In this skill, both queue_status(args) and run_task(task_command) accept untrusted text, transform it with shlex.split/join, and pass the resulting string as the command argument to ssh, which is interpreted by the remote shell; shell metacharacters, option injection, or downstream script argument abuse can therefore lead to arbitrary command execution on the worker host. The skill’s purpose is remote task orchestration, which makes this more dangerous because it is explicitly designed to run commands on another machine.

Content

Scanner excerpt · skill.py (reported line 33)May include surrounding context.

python
remote_command = command
        else:
            remote_command = shlex.join(command)
        result = subprocess.run(
            ["ssh", self.worker_host, remote_command],
            capture_output=True,
            text=True,

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The configuration section explains DEFAULT_PROJECT functionally but does not clearly warn that it defines the target project context for generated writes and tests. That omission increases the chance of operators pointing the skill at a sensitive or production repository and unintentionally authorizing AI-driven modifications there.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The overview states that the skill manages a remote worker over SSH for task execution and code generation, but it does not clearly warn about remote system impact or that actions occur on another machine. This omission increases the chance that operators underestimate the consequences of commands, including changing remote state, consuming resources, killing processes, or affecting shared project environments.

Content

No source excerpt is available for this finding.