Back to skill

Security audit

Inverter

Security checks for vulnerabilities and agentic risk

Overview

The skill is advertised as an inverter/VFD calculator, but the inspected artifact behaves like a persistent local data store and includes an unsafe config command.

Review carefully before installing. Do not rely on this as an inverter/VFD calculator or real status checker. It should be corrected to match its advertised purpose, fully disclose its local storage/export/delete behavior, and fix the sed and serialization issues before normal use.

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

Arbitrary Command Execution Through GNU sed Program Injection

Content
View full analysis
/dev/null; then sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" else echo "${key}=${val}" >> "$cfg" fi echo "Set: $key=$val" ``` ### Technical Analysis The user-controlled `key` and `val` arguments are interpolated directly into a `sed` program. Shell quoting prevents direct shell metacharacter expansion by Bash, but it does not make these values safe within the syntax of the generated `sed` expression. An attacker can include the `|` delimiter, additional `sed` commands, and GNU `sed`'s `e` flag in a configuration key. The first invocation writes the crafted key to `config.txt`. A later invocation with the same key satisfies the `grep` condition and reaches the vulnerable `sed -i` command. GNU `sed` can then interpret the injected syntax and execute the resulting pattern space through a shell. This vulnerability depends on GNU `sed` or another implementation supporting the `e` command or substitution flag. ### Attack Path 1. The attacker can influence arguments passed to `scripts/script.sh config`. 2. The attacker supplies a key containing a replacement delimiter and GNU `sed` execution syntax, for example a structure resembling: ```text x|touch /tmp/pwned #|e;# ``` 3. On the first call, the crafted key is appended to `$DATA_DIR/config.txt`. 4. The attacker invokes `config` again using the same key and a nonempty value. 5. The existing key causes execution to enter the `sed -i` update branch. 6. The crafted key changes the intended substitution expression and introduces the GNU `sed` `e` execution behavior. 7. The injected command executes with the privileges of the account running the Skill. ### Impact Assessment Successful exploitation provides arbitrary operating- ...[truncated 486 chars]
Remediation
View remediation
&2 return 1 } ``` 3. Prefer an update mechanism that treats keys and values as data rather than executable syntax. For example, use a temporary file and an `awk` variable: ```bash tmp=$(mktemp "${cfg}.XXXXXX") awk -F= -v key="$key" -v value="$val" ' BEGIN { found = 0 } $1 == key { print key "=" value found = 1 next } { print } END { if (!found) print key "=" value } ' "$cfg" > "$tmp" mv -- "$tmp" "$cfg" ``` 4. Create the configuration file with restrictive permissions and use a cleanup trap for temporary files. 5. Add regression tests containing `sed` delimiters, newlines, backslashes, semicolons, and GNU `sed` command characters. 6. If only a fixed set of settings is supported, reject every key not present in that explicit set. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:10
Finding

Unsafe JSONL and CSV Serialization of Attacker-Controlled Entries

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` CSV output is assembled without quoting, escaping, or spreadsheet-formula neutralization: ```bash cmd_export() { local fmt="${1:-json}" local out="inverter-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 ``` ### Technical Analysis `_save_entry` inserts `val` directly between JSON quotation marks. It does not escape quotation marks, backslashes, carriage returns, newlines, or other JSON control characters. A crafted entry can therefore invalidate the JSONL record, alter its apparent fields, or inject additional physical lines that downstream code may treat as independent records. The export path parses JSON using `grep` and `cut`, which is not a valid JSON parser and behaves incorrectly once escaped or crafted content is present. CSV fields are then concatenated with commas without RFC 4180 quoting. Embedded commas, quotation marks, and line breaks can create additional field ...[truncated 1641 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` 2. Parse stored records with a JSON parser such as `jq`, rather than `grep` and `cut`. 3. Generate CSV using a library or helper that implements RFC 4180: - Enclose every field in double quotes. - Replace each embedded `"` with `""`. - Preserve embedded commas and line breaks correctly. 4. If exports are expected to be opened in spreadsheets, neutralize formula-leading values. Prefix fields beginning with `=`, `+`, `-`, or `@` with an apostrophe or apply another policy appropriate to the target spreadsheet. 5. Validate every existing JSONL record during export and reject malformed data rather than silently producing misleading output. 6. Add tests covering quotation marks, backslashes, commas, CR/LF characters, Unicode, and spreadsheet-formula prefixes. ]]>
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to be an inverter/VFD parameter calculator, but the documented behavior is a generic local datastore with add/list/search/remove/export/config operations. This mismatch is dangerous because it can cause users or calling agents to invoke the skill under false assumptions, leading to unintended local data persistence, file writes, and destructive actions that are unrelated to inverter analysis.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest advertises inverter/VFD parameter calculation, but the listed commands implement generic entry management and local record handling. In an agent ecosystem, this kind of semantic deception can bypass user expectations and policy routing, causing the skill to be selected for sensitive tasks while performing unrelated stateful file operations.

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 implemented behavior is a generic local note/config store, not an inverter or VFD calculator/status tool as described. This mismatch is dangerous because users or higher-level agents may grant it trust, invoke it in automation, or pass sensitive operational data under false assumptions about its purpose, creating a deceptive capability boundary and increasing the chance of unintended data collection or misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description says 'Use when json inverter tasks, csv inverter tasks, checking inverter status,' which does not define clear trigger phrases or boundaries for when the skill should or should not activate. Terms like 'json inverter tasks' and 'csv inverter tasks' are broad and lack examples or exclusion conditions, increasing the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The inline documentation continues to describe inverter-specific functionality while the commands themselves are generic CRUD-style operations. This inconsistency increases the chance of unsafe invocation and operator error because users may trust the surrounding prose rather than recognize that the skill can store, delete, and export arbitrary data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation exposes a remove command without warning that it is destructive or clarifying what data is deleted. In a misleadingly branded skill, this is more dangerous because users expecting read-only inverter status functionality may inadvertently delete locally stored records or configuration-related data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The help text and status command imply operational device status, but the code only reports metadata about a local directory and saved entries. This can mislead users or agent workflows into believing they are receiving real inverter status, which may cause incorrect decisions, conceal the absence of actual monitoring, or normalize deceptive behavior in a security-sensitive context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The export command writes data to a file, but the markdown does not disclose the destination, format, overwrite behavior, or data sensitivity implications. This can lead to unintended data exposure or file modification, especially when users believe they are interacting with a calculator/status tool rather than a persistent datastore.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The config command modifies or creates a persistent file under the user's data directory, but the script provides no prior comment, docstring, or help text warning that configuration changes are written to disk. Although it prints a success message afterward, the user-facing documentation does not disclose this file write behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.