Back to skill

Security audit

Auto-Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill is an autonomous optimizer that openly edits files and runs evaluations, but its command execution, workspace mutation, and scoping safeguards are too broad for quiet installation.

Review carefully before installing. Use only in a disposable repo or isolated worktree, inspect git status before any baseline commit, avoid secrets in the target directory, pass only reviewed metric scripts, avoid running it on executable code without sandboxing, and do not connect live APIs or private analytics data unless you have explicitly approved that data flow.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
auto-optimizer.sh:326
Finding

Path Traversal Through Session Name Allows Filesystem Writes Outside the Results Directory

Content
View full analysis
"$TSV_FILE" # Initialize hypothesis log touch "$HYPOTHESIS_LOG" ``` ### Technical Analysis The value supplied through `--session` is inserted directly into a filesystem path without validation or canonicalization. A session name containing traversal components such as `../` can cause `RESULTS_DIR` to resolve outside the intended `$SKILL_DIR/results` directory. The script subsequently performs `mkdir -p`, output redirection, `touch`, and `cp` operations using paths derived from this value. These operations create or overwrite files named: - `results.tsv` - `report.md` - `best.md` - `hypothesis_log.jsonl` - `prompt_iterN.txt` when the fallback agent path is used The attack is limited to the privileges of the account running the optimizer. Direct writes use predictable filenames, but the scope can become broader if an attacker can pre-create symbolic links with those names in the selected destination directory. ### Attack Path 1. An attacker causes the optimizer to be invoked with a crafted session name, for example: ```bash ./auto-optimizer.sh \ --file ./target.md \ --metric "bash ./metric.sh" \ --session "../../../../tmp/attacker-controlled" ``` 2. The script constructs: ```text $SKILL_DIR/results/../../../../tmp/attacker-controlled ``` 3. `mkdir -p` creates the escaped destination directory if permissions allow. ...[truncated 973 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
auto-optimizer.sh:400
Finding

Prompt-Injection-to-Code-Execution Chain Through Unsandboxed Evaluation of Model-Generated Files

Content
View full analysis
/dev/null | grep -oE '[0-9]+\.?[0-9]*([eE][+-]?[0-9]+)?' | tail -1) echo "${result:-0}" } ``` The mutable file and program instructions are inserted directly into the model prompt: ```bash call_agent() { local file="$1" program="$2" iteration="$3" hypothesis_context="$4" local prompt prompt=$(cat < CHANGE_DESC: FILE_CONTENT: EOF ) ``` The returned content is written over the target and then evaluated: ```bash # Apply change echo "$NEW_CONTENT" > "$MUTABLE_FILE" # Run metric if [[ "$EVAL_MODE" == "scalar" ]]; then METRIC_AFTER=$(run_scalar_metric) else METRIC_AFTER=$(run_binary_eval "$MUTABLE_FILE" "$EVALS_FILE" "$BATCH_SIZE" "$ITER" "$HYPOTHESIS_CONTEXT") fi log "Metric after: $METRIC_AFTER" ``` ### Technical Analysis The optimizer treats the mutable file, hypothesis history, and optional program file as trusted prompt material. No trust boundary separates the optimizer's control instructions from potentially attacker-controlled content inside those files. A malicious mutable file or custom program fil ...[truncated 2794 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (16)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger phrases are extremely broad (optimize, improve, make better, benchmark, etc.), making accidental or overly eager activation likely. Because this skill can autonomously modify files and execute commands, mis-triggering is more dangerous than for a passive advisory skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The metric runner uses eval "$METRIC_CMD", so any user-supplied metric string is executed as arbitrary shell code. Because this skill is designed to run iterative autonomous loops, that command may be invoked repeatedly, amplifying the impact from a bad input into repeated command execution, file modification, data exfiltration, or system compromise.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
60% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/web-optimization.md (reported line 58)May include surrounding context.

md
lighthouse $URL --output json --quiet | jq '.audits.interactive.numericValue'

# Custom: measure API response time
curl -w "%{time_total}" -o /dev/null -s https://api.yoursite.com/endpoint

# Custom: measure bundle size
du -k dist/assets/*.js | awk '{sum += $1} END {print sum}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup instructs users to run git init && git add . && git commit -m "baseline" without warning that this stages and commits every file in the current project directory. In practice this can snapshot secrets, API keys, private datasets, credentials, or unrelated proprietary files, creating a durable local history entry that may later be pushed to a remote by accident.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The agent-facing instructions tell an AI agent to initialize a repo and auto-commit all files in /path/to/target/dir if no repo exists, again without requiring review of what will be committed. Because this is framed as an exact automated step for agents, it is more dangerous than the human-facing version: an autonomous agent may commit sensitive files non-interactively and proceed without user awareness.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly instructs the agent to run shell commands (git, curl, npm, Python, custom metric commands) but declares no explicit tool scope or permission boundaries. In an agent ecosystem, that omission can enable unintended command execution or broader-than-expected access, especially because the skill is designed for autonomous iterative loops.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill markets 'zero-friction' autonomous optimization but does not prominently warn that it will modify files and use git to keep or revert changes. Users may invoke it without understanding that their workspace will be changed automatically across multiple iterations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill accepts --metric values like bash ./your-metric.sh and instructs users to pass shell pipelines, but it does not clearly warn that these strings will be executed as shell commands. If user-controlled or model-generated input reaches that argument, this creates a straightforward command-injection and arbitrary code execution risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The MiroFish section materially expands the skill from generic optimization into local service control, market-data workflows, and API interaction against a specific backend. That scope expansion increases attack surface and may cause an agent to access unrelated systems or data under the guise of using the optimizer.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The MiroFish setup and API usage instructions involve live backend access, project enumeration, simulation control, and market-data handling without clear privacy or system-impact warnings. Users may unknowingly expose local service metadata, operate on real projects, or consume sensitive data during optimization loops.

Content

No source excerpt is available for this finding.

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

cd /data/workspace-crypto/mirofish npm run backend

Or check status:

curl http://localhost:5001/health

text

Build a seed from live market data:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

When the primary CLI is unavailable, the fallback passes the constructed prompt—including program instructions, hypothesis history, and full target file contents—to another external agent script without explicit consent or disclosure. In an optimization tool that may operate on code, prompts, or business content, this can expose proprietary or sensitive data to another toolchain or backend the user did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script writes agent-generated content directly to the user-selected file with echo "$NEW_CONTENT" > "$MUTABLE_FILE" before any validation or confirmation. In this skill's context, the whole purpose is autonomous mutation of files, so destructive overwrite is intentional, but it still creates real integrity risk because an LLM or fallback agent can corrupt source, configs, or sensitive documents in a single step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The guidance encourages personalization and optimization of cold outreach based on prospect-specific observations and reply behavior, but it omits safeguards around lawful collection, minimization, consent, and retention of personal data. In an autonomous optimization skill, that omission can normalize scraping or processing prospect data at scale without privacy review, increasing compliance and misuse risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The landing-page section instructs users to optimize against an analytics API metric without noting that visitor interaction data may be transmitted, stored, or combined with other identifiers. In this self-improving automation context, users may wire analytics data directly into iterative loops without checking whether the data flow is permitted, properly disclosed, or sanitized.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/web-optimization.md (reported line 58)May include surrounding context.

md
lighthouse $URL --output json --quiet | jq '.audits.interactive.numericValue'

# Custom: measure API response time
curl -w "%{time_total}" -o /dev/null -s https://api.yoursite.com/endpoint

# Custom: measure bundle size
du -k dist/assets/*.js | awk '{sum += $1} END {print sum}'