Back to skill

Security audit

Contactor

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as an electrical contactor tool, but it mainly stores and mutates local records and includes an exploitable shell-script configuration path.

Review this carefully before installing. It is not a clear contactor-selection tool; it stores arbitrary local data, can remove and export that data, and has a configuration bug that may let crafted input run local commands. Do not store secrets in it, avoid opening exported CSVs from untrusted data in spreadsheet software, and prefer a fixed version with clear purpose, documented storage behavior, input validation, and safe serialization.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:137
Finding

Command Execution Through Sed Program 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 user-controlled `key` and `val` arguments are interpolated directly into a sed program. Neither value is escaped for use as a regular expression, replacement string, or sed command. An attacker can supply delimiters, backslashes, regular-expression operators, or embedded newline characters. On GNU sed, a newline can terminate the intended substitution and introduce another sed instruction. The GNU-specific `e` instruction can execute an operating-system command. For example, after a configuration key exists, a multiline value shaped like the following can transform the generated sed program: ```text x| e touch /tmp/contactor-pwned # ``` The resulting program contains an independent `e touch /tmp/contactor-pwned` instruction. GNU sed executes that command while processing the configuration file. The configuration lookup at line 145 is also regex-based and uses the unescaped key, allowing metacharacters in the key to select unintended records. ### Attack Path 1. The attacker invokes the Skill with arguments or otherwise influences parameters passed to `config`. 2. The attacker creates an ordinary ...[truncated 1193 chars]
Remediation
View remediation
&2 return 1 } ``` 2. Reject newline and carriage-return characters in configuration values unless multiline values are explicitly supported. 3. Replace the sed update with exact string processing that does not evaluate input as code or regular expressions. 4. Write updates to a securely created temporary file in the same directory, then atomically rename it over the original file. 5. Apply restrictive permissions to the configuration directory and file. 6. If structured or arbitrary values are required, use a standard JSON parser and serializer rather than a custom `key=value` format. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:10
Finding

Unescaped JSONL and CSV Data Injection

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` The CSV exporter subsequently writes parsed values without CSV quoting or formula neutralization: ```bash cmd_export() { local fmt="${1:-json}" local out="contactor-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` treats arbitrary user input as though it were already a valid JSON string. Quotes, backslashes, control characters, and newline characters are not escaped. A crafted entry can therefore terminate the `val` string, add fields, or inject additional JSONL records. The read and export operations use regular-expression extraction instead of a JSON parser, so malformed or adversarial records can also cause values to be truncated or misinterpreted. The CSV exporter concatenates fields with commas without applying RFC 4180 quoting. Values contai ...[truncated 1673 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:73
Finding

Search Terms Are Interpreted as Grep Options

Content
View full analysis
}" if [ -f "$DATA_DIR/data.jsonl" ]; then local matches=$(grep -ic "$term" "$DATA_DIR/data.jsonl" 2>/dev/null || echo 0) echo "Found: $matches matches" grep -i "$term" "$DATA_DIR/data.jsonl" 2>/dev/null | head -20 | while IFS= read -r line; do local val=$(echo "$line" | grep -o '"val":"[^"]*' | cut -d'"' -f4) local ts=$(echo "$line" | grep -o '"ts":"[^"]*' | cut -d'"' -f4) echo " [$ts] $val" done else echo "No data to search." fi } ``` ### Technical Analysis The search term is passed to grep without the `--` end-of-options delimiter. Quoting prevents shell word splitting, but it does not prevent grep from interpreting an argument beginning with `-` as an option. The input is also treated as a regular expression even though the command is documented as a general text search. Crafted regular expressions can change matching behavior, trigger errors, or consume disproportionate processing time on sufficiently large input. Option-shaped input can activate unintended grep modes rather than being searched literally. ### Attack Path 1. An attacker or untrusted caller controls the term passed to `scripts/script.sh search`. 2. The attacker supplies a term beginning with `-`, such as a grep option, or supplies a computationally expensive regular expression. 3. The script passes the term directly to both grep invocations. 4. Grep interprets the value as command-line behavior or regex syntax rather than as literal search text. 5. Search results become unreliable, errors may be hidden by `2>/dev/null`, and repeated expensive searches may consume process resources. ### Impact Assessment The likely impact is limited to the search operat ...[truncated 334 chars]
Remediation
View remediation
/dev/null || true) grep -iF -- "$term" "$DATA_DIR/data.jsonl" ``` Additional hardening should include: 1. Validate or limit the maximum search-term length. 2. Avoid regular-expression matching unless regex searches are an intentional, documented feature. 3. Do not suppress every grep error; report invalid input or operational failures clearly. 4. Parse matching JSON records with a proper JSON parser instead of extracting fields with regexes. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose presents the skill as a contactor/starter selection and status tool, but the exposed commands describe a generic local record-management utility with add, remove, export, and config mutation capabilities. This mismatch can mislead users or orchestrating agents into invoking filesystem-affecting operations under a benign electrical-tool pretext, increasing the risk of unintended data handling and trust abuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation materially differs from the stated purpose: instead of performing contactor/starter selection or status checking, it persists arbitrary user-supplied entries and configuration data to local disk. In an agent-skill context, that mismatch is dangerous because it can quietly collect and retain sensitive operational data under a misleading description, undermining user consent and trust boundaries.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation wording is broad and ambiguous, which can cause an agent or user to select this skill for loosely related JSON/CSV or status tasks without understanding that it performs local persistence and record manipulation. In agentic environments, vague triggers raise the chance of accidental invocation of file-affecting functionality outside the user's intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation lists destructive or file-affecting commands such as remove, export, and config without warning about their side effects, destinations, or persistence scope. Users and agents may therefore perform deletion, data export, or configuration changes without informed consent, which can lead to unintended data loss or leakage from the local storage directory.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script writes configuration values to a persistent file without clearly disclosing that settings will be stored on disk. While not code-execution dangerous by itself, this can cause unintended retention of sensitive values if users provide secrets or environment-specific information via the config interface.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.