Back to skill

Security audit

Staking

Security checks for vulnerabilities and agentic risk

Overview

The skill is presented as staking/security analysis, but it actually installs a local note/config manager with persistent writes, deletion/export behavior, and unsafe shell handling.

Review this carefully before installing. Use it only as a local plaintext note utility, not as a staking analysis or security evaluation tool. Do not store wallet details, credentials, validator operational secrets, or sensitive protocol notes in it. Avoid running config or export with untrusted input, and expect it to create, modify, delete, and export local 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:139
Finding

Arbitrary Command Execution Through GNU sed Expression 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 inserted directly into a GNU sed program without escaping or validation: ```bash sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" ``` Because these values may contain sed delimiters, newlines, regular-expression operators, and command flags, an attacker can alter the structure of the generated sed script. GNU sed supports the `e` substitution flag, which executes the resulting pattern space through a shell. A malicious multiline value can terminate the intended substitution, add the `e` flag, and comment out or neutralize the remaining generated syntax. Command substitution embedded in the replacement text is then evaluated by the shell invoked by GNU sed. The lookup operations are also affected by regular-expression injection because `key` is interpolated into `grep` patterns without being treated as a fixed string. ### Attack Path 1. The attacker invokes the configuration command with a benign key and value to ensure that the key exists in `config.txt`. 2. The attacker invokes the command again for that ...[truncated 1198 chars]
Remediation
View remediation
&2 return 1 fi ``` 3. Define and enforce an allowlist of supported configuration keys rather than accepting arbitrary names. 4. Do not permit embedded control characters or newlines in values unless the storage format explicitly supports and safely encodes them. 5. If sed must be retained, escape pattern and replacement metacharacters separately. This is less robust than avoiding dynamic sed expressions entirely. 6. Write updates to a securely created temporary file in the same directory and atomically rename it over the original file. 7. Use fixed-string matching where regular expressions are not required, such as `grep -F`, while ensuring complete key/value boundary checks. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:109
Finding

Predictable Export Files Allow Symlink-Based File Overwrite

Content
View full analysis
"$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 The export destination is a predictable relative filename: ```bash local out="staking-export.$fmt" ``` The JSON path uses `cp`, while the CSV path uses truncating shell redirection. Both operations follow an existing symbolic link at the destination. The script neither checks whether the output exists nor verifies that it is a regular file owned by the invoking user. Consequently, an attacker with write access to the directory from which the Skill will be run can create `staking-export.json` or `staking-export.csv` as a symbolic link to another file. The export operation then overwrites or truncates the symlink target. ### Attack Path 1. The attacker identifies or controls the working directory in which the victim will invoke the export command. 2. The attacker creates one of the predictable export names as a symbolic link to a victim-owned target file. 3. The victim runs `scripts/script.sh export json` or `scripts/script.sh export csv`. 4. The script fo ...[truncated 747 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:12
Finding

Unescaped Entry Values Permit JSONL Corruption and Record Injection

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ### Technical Analysis The script manually constructs JSON using `printf`, but it does not JSON-escape `cmd` or `val`. User-controlled values containing quotation marks, backslashes, carriage returns, newlines, or other control characters can produce invalid JSON. A newline in `val` can also create additional physical lines in `data.jsonl`. Because other commands treat each line as an independent record and calculate entry counts using `wc -l`, this permits record-boundary injection and corrupts the integrity of list, search, remove, status, statistics, and export operations. The parsing code later relies on regular expressions rather than a JSON parser, which compounds the issue and can cause inconsistent interpretation of malformed records. ### Attack Path 1. The attacker supplies an `add` value containing JSON metacharacters or embedded newlines. 2. `_save_entry` inserts the value directly into the JSON template. 3. The resulting `data.jsonl` contains malformed JSON or attacker-created line boundaries. 4. Subsequent commands count, search, display, remove, or export the injected physical lines as if they were valid records. ### Impact Assessment The attacker can corrupt the local staking data store and manipulate its apparent record structure. This can lead to: - Incorrect entry counts and statistics. - Misleading list and search output. - Removal of unintended physical records due to shifted line numbers. - Invalid JSON exports. - Log or terminal-output manipulation through embedded control characters. The issue affects local data integ ...[truncated 151 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a staking-analysis tool, but the documented behavior is a generic local CRUD/config utility with persistent storage and export capability. This mismatch can mislead users or upstream agents into invoking file-writing, deletion, or export operations under the false assumption that the skill is limited to blockchain analysis, increasing the risk of unintended local side effects and abuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation claims staking analysis, protocol security evaluation, and on-chain reference functionality, but the command set only describes local entry management operations. In an agent setting, this kind of semantic deception is dangerous because tool-selection logic may grant or invoke the skill for sensitive analytical tasks while the skill actually performs unrelated stateful local actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The inline banner claims the script analyzes staking operations, but the code only stores arbitrary user input on disk. In a security-oriented skill context, misleading descriptions materially increase risk because users may trust the tool with sensitive operational details that are then retained locally without meaningful analysis or consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises staking analysis but actually implements a generic local note store with add/list/search/remove/export/config operations. This mismatch is dangerous because users may provide wallet, protocol, or security-sensitive staking data under false assumptions about the tool’s purpose, creating an opportunity for unintended collection and persistence of sensitive information.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help text repeatedly promises staking analysis and protocol-security functionality, but the available commands only manage a local datastore. This kind of deceptive UX can induce users to enter confidential or security-relevant information, making the mismatch especially risky given the skill’s stated blockchain/security context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The title and description establish a blockchain/staking-security context, but the exposed operations are unrelated entry-management actions. This makes the skill more dangerous in context because users and orchestrators may trust it with higher-value security-analysis workflows, despite it behaving like a local data manipulation tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill advertises commands such as add, remove, export, and config without warning that they write persistent data, delete entries, or modify configuration. In an automated or delegated-use context, missing safety disclosures can lead to unintended data loss, filesystem changes, or exfiltration to export files because operators may assume the skill is informational rather than state-changing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script persistently stores user-supplied data under ~/.staking without warning, consent, retention controls, or any protection for potentially sensitive contents. Because the surrounding skill claims staking and protocol-security use cases, users are more likely to enter wallet-related notes, operational details, or other confidential data that should not be silently written to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The export feature creates or overwrites local files without an explicit warning or confirmation, which can surprise users and expose stored data through unintended file creation. While the behavior is common for CLI tools, it is riskier here because the tool may already have collected sensitive staking-related notes under misleading branding.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.