Back to skill

Security audit

Breaker

Security checks for vulnerabilities and agentic risk

Overview

This skill claims to be an electrical breaker sizing tool, but the inspected code is a local record manager with persistent storage, export, deletion, and an unsafe config update path.

Review before installing. Do not rely on this skill for electrical breaker sizing or coordination, and do not store sensitive data in it. If used at all, treat it as a local note/config script, avoid untrusted config values, and inspect or fix the shell serialization and sed update logic first.

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:132
Finding

Arbitrary Command Execution Through GNU sed Script 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 an immediate shell expansion of metacharacters, but it does not make untrusted content safe as sed syntax. An attacker can supply the `|` delimiter, newline characters, backreferences, regular-expression syntax, or additional sed commands. In particular, GNU sed supports the `e` command, which executes a shell command. A multiline value can terminate the intended substitution and inject a separate `e` instruction. The vulnerable branch is reached when the selected key already exists in `config.txt`. The key is also embedded in the regular expressions used by `grep` and sed without validation or escaping. This permits unintended matching and configuration-file corruption in addition to command execution. ### Attack Path 1. The attacker invokes the configuration command with a normal key and value so that an existing configuration record is created: ```bash scripts/script.sh config target initial ...[truncated 1161 chars]
Remediation
View remediation
&2 return 1 } ``` - Reject newline, carriage-return, and NUL-like control content in configuration values unless such content is explicitly required. - Replace the dynamic sed operation with a safe configuration writer that treats keys and values as data rather than executable syntax. - Prefer a structured format such as JSON and update it with a dedicated parser such as `jq`. - If a plain key-value file must be retained, rewrite it using a parser that performs exact string comparisons and safely encodes values. - Write updates to a securely created temporary file in the same directory, verify success, set restrictive permissions, and atomically rename it over the original file. - Add regression tests containing sed delimiters, backslashes, newlines, regular-expression characters, and strings resembling GNU sed commands. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:12
Finding

Malformed JSONL Records and Spreadsheet Formula Injection in CSV Exports

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` The CSV exporter inserts parsed fields directly into comma-separated output: ```bash cmd_export() { local fmt="${1:-json}" local out="breaker-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` does not apply JSON escaping to `cmd` or `val`. A value containing double quotes, backslashes, carriage returns, or newline characters can terminate the intended JSON string, produce invalid JSON, or create additional apparent JSONL records. The later parsing logic uses `grep` and `cut` rather than a JSON parser, so malformed or crafted records can also be interpreted inconsistently. The CSV exporter does not implement CSV quoting. Commas, double quotes, carriage returns, and newlines can alter column or row boundaries. Furthermore, values beginning with spreadsheet formula prefixes such as ...[truncated 1802 chars]
Remediation
View remediation

other

Note
Location
SKILL.md:2
Finding

Skill Description Misrepresents the Implemented Functionality

Content
View full analysis
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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a specialized electrical breaker sizing/coordination tool, but the documented behavior is a generic local record-management utility with add/list/search/remove/export/config operations. This mismatch can mislead users and higher-level agents into invoking it with inappropriate trust or assumptions, increasing the risk of unintended data modification, storage, or export in contexts where an engineering analysis tool was expected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The header/help text reinforce a false safety narrative by presenting the tool as electrical engineering functionality while the code operates as a generic logger. In an agent skill context, this kind of misrepresentation increases the chance that users or automation will trust and invoke it with sensitive task data that is then silently retained.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script’s advertised purpose is circuit breaker sizing/coordination, but its actual behavior is a persistent local note/data collection utility. This deceptive mismatch is dangerous because users or higher-level agents may supply operational or sensitive data under false pretenses, enabling covert collection and later export/search of unrelated information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest and command set describe materially different functions: the metadata claims an electrical coordination tool, while the commands resemble a generic CRUD datastore. In agent-driven environments, this semantic deception is dangerous because routing, permissions, and user expectations may be based on the declared purpose rather than the actual side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation advertises state-changing commands such as add, remove, export, and config without warning about destructive or persistent effects. This can cause accidental data loss, unintended overwrites, or silent local data exposure, especially when an agent executes commands non-interactively based only on the skill docs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persists user-supplied entries to a hidden file under the user’s home directory without prominent disclosure at the point of collection. In this skill context, silent persistence is more dangerous because users expect a calculation/status tool, not a local datastore, so they may expose sensitive project or operational information unknowingly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

cmd_remove deletes a selected line from the data file using sed -i, which changes the stored history in place. The command prints a message after deletion, but there is no confirmation step or explicit warning in help text that removal is destructive.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

cmd_export copies or transforms the full contents of the local data store into breaker-export.json or breaker-export.csv. While this behavior matches the command name, there is no user-facing warning in help text that potentially sensitive stored values will be written to a new file on disk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.