Back to skill

Security audit

Agv

Security checks for vulnerabilities and agentic risk

Overview

This skill is advertised as an AGV route planner, but the inspected artifact is a generic local record store with persistent file writes, deletion, export, config changes, and an unsafe config update path.

Review this carefully before installing. It should not be treated as an AGV route planner or operational AGV status tool. At most, it behaves like a local note/log manager that writes to ~/.agv, can delete entries, and exports files. Avoid using it with safety-critical AGV workflows or untrusted input unless the purpose mismatch and shell escaping issues are fixed.

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
scripts/script.sh:137
Finding

Arbitrary Command Execution Through GNU sed Configuration Injection

Content
View full analysis
)"; fi elif [ -z "$val" ]; then grep "^${key}=" "$cfg" 2>/dev/null | cut -d= -f2- || echo "(not set)" else if [ -f "$cfg" ] && grep -q "^${key}=" "$cfg" 2>/dev/null; then sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" else echo "${key}=${val}" >> "$cfg" fi echo "Set: $key=$val" fi } ``` ### Technical Analysis The `key` and `val` command-line arguments are interpolated directly into a GNU sed program: ```bash sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" ``` Shell quoting prevents direct shell expansion while constructing the argument, but it does not make untrusted text safe as sed syntax. An attacker can place sed delimiters, regular-expression metacharacters, backslashes, or newline characters in either argument. In particular, a newline in `val` can terminate the intended substitution and insert another sed command. GNU sed supports the `e` command, which executes a supplied command through a shell. Because the script uses GNU-style `sed -i`, an injected `e` command can lead to arbitrary command execution under the identity running the Skill. The same unescaped `key` is also used as a regular expression by `grep` and sed. This permits unintended matching or modification of configuration entries even when command execution is not attempted. ### Attack Path 1. The attacker invokes the exposed `config` command to create a normal existing key: ```bash scripts/script.sh ...[truncated 1408 chars]
Remediation
View remediation
&2 return 1 } ``` - Reject newline, carriage-return, NUL, and other control characters in configuration values. - Replace the sed-based update with a safe implementation that compares keys as data rather than executable syntax. For example, parse the file line by line, write validated entries to a newly created temporary file, and atomically rename it over the original. - Create temporary files inside `DATA_DIR` using `mktemp`, set restrictive permissions, and use `trap` to remove them on failure. - If a text-processing utility is retained, pass values through data variables and ensure they cannot become program syntax. Do not rely only on escaping one delimiter because regular expressions, replacement syntax, newlines, and implementation-specific commands must all be handled. - Add regression tests covering delimiters, backslashes, regular-expression metacharacters, embedded newlines, carriage returns, and GNU sed commands such as `e`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:8
Finding

Unsafe JSONL and CSV Serialization Enables Record Injection and Spreadsheet Formula Injection

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ```bash cmd_export() { local fmt="${1:-json}" local out="agv-export.$fmt" if [ ! -f "$DATA_DIR/data.jsonl" ]; then echo "No data."; return 0; fi case "$fmt" in json) cp "$DATA_DIR/data.jsonl" "$out" ;; csv) echo "timestamp,command,value" > "$out" while IFS= read -r line; do ts=$(echo "$line" | grep -o '"ts":"[^"]*' | cut -d'"' -f4) c2=$(echo "$line" | grep -o '"cmd":"[^"]*' | cut -d'"' -f4) vl=$(echo "$line" | grep -o '"val":"[^"]*' | cut -d'"' -f4) echo "$ts,$c2,$vl" >> "$out" done < "$DATA_DIR/data.jsonl" ;; *) echo "Formats: json, csv"; return 1 ;; esac echo "Exported: $out ($(wc -c < "$out") bytes)" } ``` ### Technical Analysis `_save_entry` inserts user-controlled values directly between JSON quotation marks. It does not escape quotation marks, backslashes, tabs, carriage returns, newlines, or other JSON control characters. Consequently, an entry containing crafted characters can corrupt the JSONL document or inject additional physical records. The export routine then parses the purported JSON using `grep` and `cut` rather than a JSON parser. This parser is not aware of JSON escaping and can truncate, misinterpret, or omit crafted values. For CSV output, values are concatenated with commas without RFC 4180 quoting or escaping. Commas, quotation marks, and newlines can create additional cells or rows. A value beginning with a formula marker such as `=`, `+`, `-`, or `@` can a ...[truncated 1966 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s advertised purpose is AGV route planning and status handling, but the documented commands describe a generic local record-management tool with add/list/search/remove/export/config functions and no visible AGV-specific processing. This mismatch is dangerous because operators may grant trust or use the skill in industrial contexts under false assumptions, leading to misuse, unsafe automation decisions, or execution of unintended file-manipulation behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill metadata and in-script branding present this as an AGV route planner/status utility, but the implementation is a generic local datastore supporting add/search/remove/export/config operations. This mismatch is dangerous because users or automated agents may grant it trust, data, or execution context intended for operational AGV tooling while it actually performs unrelated local data collection and manipulation, enabling deceptive capability smuggling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill exposes potentially destructive or state-changing operations such as remove, export, and config updates without warning users about deletion, file writes, or persistent configuration changes. In an agent-driven environment, missing safety notes increases the chance of accidental data loss or unauthorized writes because users may assume these commands are read-only or AGV-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text advertises AGV route-planning behavior even though the available commands are storage-oriented and do not perform routing or status integration. In an agent skill ecosystem, misleading operator-facing documentation increases the chance of unsafe invocation, misplaced trust, and accidental exposure of sensitive task data to a tool with different behavior than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The remove command deletes entries in place with sed -i and no confirmation, backup, dry-run, or undo mechanism. In a skill context, this raises integrity risk because accidental or agent-driven invocation can permanently destroy local records, and the misleading AGV framing could make users less cautious about data-destructive behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.