Back to skill

Security audit

Agent Learner

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local logging utility for agent experiments, with disclosed plaintext storage and export features that users should handle carefully.

Install only if you are comfortable with agent prompts, evaluations, cost notes, and similar records being saved locally in plaintext under ~/.local/share/agent-learner. Do not log secrets, credentials, customer data, or proprietary prompts unless you control the machine and file permissions; treat exports as sensitive files.

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

Warning
Location
scripts/script.sh:6
Finding
Persistent sensitive records are created without explicit restrictive permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh`, lines 6-9 **Vulnerability Type**: Plaintext sensitive data with permissions inherited from the ambient umask **Risk Level**: Medium ### Vulnerable Code ```bash DATA_DIR="${HOME}/.local/share/agent-learner" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } ``` User-provided values are subsequently written to category-specific files using the same permission model. For example: ```bash local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/prompt.log" ``` ### Technical Analysis The skill persistently records prompts, configurations, evaluations, costs, benchmark results, and other command arguments in plaintext files under `~/.local/share/agent-learner`. Neither the storage directory nor the generated log files are assigned explicit restrictive permissions. `mkdir -p` and shell redirection create resources according to the process's ambient umask. Under a permissive umask, the directory or files may be readable by other local users. This is especially relevant because prompts and configuration records may contain internal instructions, proprietary data, endpoint details, tokens, or other secrets accidentally supplied by a user. The issue affects both the category logs and `history.log`, because `_log` duplicates user-provided content into the history file. No encryption, secret filtering, or permission verification is performed. ### Attack Path 1. The skill runs in an environment with a permissive umask or otherwise permissive permissions on the user's home data directories. 2. A user invokes a data command with sensitive content, such as: ```bash agent-learner prompt "Internal system prompt containing confidential information" ``` 3. The script writes the content to `prompt.log` and duplicates it in `history.log`. 4. Another local account that can traverse the relevant home directories reads the ...[truncated 755 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Set a restrictive umask before creating any persistent data: ```bash umask 077 ``` 2. Explicitly restrict the storage directory: ```bash install -d -m 700 "$DATA_DIR" ``` 3. Create or repair log permissions as mode `600`: ```bash touch "$DATA_DIR/history.log" chmod 600 "$DATA_DIR/history.log" ``` 4. Apply the same permission controls to every category log and export file. Do not rely solely on the caller's umask. 5. Check existing installations and warn if the data directory or any record is accessible to group or other users. 6. Document that users must not submit credentials, API keys, authentication tokens, or other secrets as log values. 7. Consider optional encryption at rest or configurable retention and secure deletion for environments where sensitive prompts are expected. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:56
Finding
Untrusted log values are exported without JSON or CSV escaping<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh`, lines 56-82 **Vulnerability Type**: Unsafe output serialization and CSV formula injection **Risk Level**: Medium ### Vulnerable Code ```bash _export() { local fmt="${1:-json}" local out="$DATA_DIR/export.$fmt" case "$fmt" in json) echo "[" > "$out" local first=1 for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do [ $first -eq 1 ] && first=0 || echo "," >> "$out" printf ' {"type":"%s","time":"%s","value":"%s"}' "$name" "$ts" "$val" >> "$out" done < "$f" done echo "" >> "$out" echo "]" >> "$out" ;; csv) echo "type,time,value" > "$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do echo "$name,$ts,$val" >> "$out" done < "$f" done ;; ``` ### Technical Analysis Values read from the log files are attacker-controlled or user-controlled data. They are inserted directly into JSON string literals without escaping quotation marks, backslashes, control characters, or embedded newlines. A crafted value can therefore corrupt the JSON document or inject additional JSON properties or objects into the exported representation. The CSV branch also concatenates fields without RFC 4180 quoting. Commas, double quotes, carriage returns, and newlines can alter columns or inject additional records. More importantly, values beginning with spreadsheet formula markers such as `=`, `+`, `-`, or `@` may be interpreted as formulas when the exported CSV file is opened in spreadsheet software. Shell quoting around `"$val"` prevents ...[truncated 2087 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use a real JSON serializer rather than constructing JSON with `printf`. For example, if adding `jq` as a dependency is acceptable: ```bash jq -n \ --arg type "$name" \ --arg time "$ts" \ --arg value "$val" \ '{type: $type, time: $time, value: $value}' ``` 2. If external dependencies are prohibited, implement and thoroughly test escaping for quotation marks, backslashes, and all JSON control characters. A standards-compliant serializer remains preferable. 3. Encode every CSV field according to RFC 4180: - Enclose each field in double quotes. - Replace each embedded double quote with two double quotes. - Preserve embedded commas and line endings only inside properly quoted fields. 4. Protect spreadsheet consumers by neutralizing formula-leading values. One approach is to prefix fields beginning with `=`, `+`, `-`, or `@` with an apostrophe when producing a spreadsheet-oriented export. 5. Clearly distinguish a standards-compliant machine-readable CSV export from a spreadsheet-safe export if exact value preservation is required. 6. Add regression tests covering: - Double quotes and backslashes in JSON. - Newlines and control characters. - Commas and double quotes in CSV. - Values beginning with formula markers. - Multiple records containing crafted delimiters. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill is presented as a benchmarking/comparison tool, but the documented behavior substantially expands into persistent collection, indexing, audit logging, searching, and exporting of arbitrary user inputs. That mismatch matters because users may provide prompts, model outputs, evaluations, or configuration details assuming transient use, while the skill actually creates durable local records that broaden privacy and data-handling risk.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
This skill encourages logging arbitrary prompts, evaluations, comparisons, and costs into plain-text files, but does not warn that those entries may contain sensitive information such as proprietary prompts, credentials pasted into examples, model outputs with personal data, or internal benchmark results. In this context, silent persistent storage increases the chance of accidental local disclosure and later unintended reuse or export of sensitive content.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
Documenting that every command execution is written to an audit history log without an accompanying privacy warning creates a hidden retention channel even for users who may think they are only viewing status or searching data. Because command usage itself can reveal sensitive operational patterns, prompt themes, filenames, or search terms, always-on audit logging increases exposure beyond the primary category logs.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The export feature aggregates stored logs into JSON, CSV, or TXT files, which makes mass disclosure easier if the exported files are copied, synced, or accessed by other local users or backup systems. Without a warning that exports may contain all previously logged sensitive content, users may underestimate the blast radius of a single export operation.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a focused benchmarking/comparison skill for tuning strategies and evaluating outputs. In contrast, the help text and dispatch implement a broad command set such as configure, fine-tune, optimize, test, report, export, search, recent, and status, and each command simply records arbitrary input to local log files rather than performing benchmarking or comparison logic.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The script provides broad local search, recent-history viewing, status reporting, and export of accumulated logs, which expands data exposure beyond the stated benchmarking purpose. In an agent-skill context, prompts, evaluation outputs, or other sensitive content may be stored and later enumerated or exfiltrated via export commands without clear minimization or access controls.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
User-supplied input is written verbatim to persistent log files under the user's home directory with no warning that the data will be retained and may be exported later. Because this skill is meant to handle prompts and evaluation results, the stored content could include secrets, proprietary prompts, model outputs, or personal data, making silent persistence materially risky.

Static analysis

No suspicious patterns detected.