Back to skill

Security audit

Finality

Security checks for vulnerabilities and agentic risk

Overview

This skill is labeled as a blockchain finality analysis tool, but the artifacts show a local data manager with unsafe mutation/export behavior and a command-injection flaw.

Review carefully before installing. This does not appear to contain remote exfiltration or automatic persistence, but it is not a real finality-analysis skill as advertised and it can persist, delete, export, and unsafely process local data. Do not run its config command with untrusted input, and do not rely on it for blockchain security analysis.

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 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 `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 ordinary shell metacharacters inside these values from being interpreted directly by the calling shell. It does not, however, prevent the values from changing the syntax of the sed program itself. An attacker can include the `|` delimiter and newline characters in `val`. This can terminate the intended substitution and introduce an additional GNU sed `e` instruction. GNU sed's `e` instruction executes a shell command, turning sed-language injection into arbitrary operating-system command execution. The vulnerable branch is reached when the configuration file already contains a line matching the supplied key. The `key` is also interpolated into grep and sed regular expressions without escaping, creating additional regular-expression and sed-program manipulation opportunities. ### Attack Path 1. The attacker invokes the Skill's `config` command with a normal key and value, causing that ke ...[truncated 1533 chars]
Remediation
View remediation
&2 return 1 fi ``` 2. Replace the sed-based update with exact string processing that treats the key and value as data. Write the updated configuration to a securely created temporary file and atomically rename it: ```bash tmp=$(mktemp "${cfg}.XXXXXX") trap 'rm -f "$tmp"' EXIT awk -F= -v wanted="$key" -v replacement="$val" ' BEGIN { found = 0 } $1 == wanted { print wanted "=" replacement found = 1 next } { print } END { if (!found) print wanted "=" replacement } ' "$cfg" > "$tmp" chmod 600 "$tmp" mv -- "$tmp" "$cfg" trap - EXIT ``` 3. Reject carriage returns, newlines, NUL bytes, and other control characters in values if the configuration format is intended to remain one record per line. 4. Use `grep -F` or exact field comparisons rather than interpolating keys into regular expressions. 5. Add regression tests containing sed delimiters, backslashes, newlines, regex metacharacters, and attempted GNU sed commands. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:12
Finding

Unsafe Serialization Enables JSONL Record Injection and CSV Formula Injection

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` CSV exports similarly concatenate values without CSV quoting or spreadsheet-formula protection: ```bash cmd_export() { local fmt="${1:-json}" local out="finality-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)" } ``` Configuration records are also appended without rejecting embedded record separators: ```bash else echo "${key}=${val}" >> "$cfg" fi ``` ### Technical Analysis `cmd_add` accepts attacker-controlled text and passes it to `_save_entry`. `_save_entry` inserts the text directly between JSON quotation marks without escaping quotation marks, backslashes, carriage returns, newlines, or other JSON control characters. Consequently, a crafted entry can: - Produce invalid JSON. - Terminate the intended JSON string. - Insert additional JSON properties. - Insert newlines and forge additional JSONL records. - Cause t ...[truncated 2829 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` 2. Parse JSONL using a JSON parser rather than grep and cut. Reject or report malformed records instead of silently extracting partial fields. 3. Generate CSV with a library or function that implements RFC 4180: - Enclose fields in double quotation marks. - Replace each embedded double quotation mark with two double quotation marks. - Preserve commas and newlines inside quoted fields. 4. If exports may be opened in spreadsheet applications, neutralize formula-leading cells according to the intended consumer. One common defense is to prefix values beginning with `=`, `+`, `-`, or `@` with an apostrophe, while documenting that transformation. 5. For the line-based configuration format: - Restrict keys to a safe identifier allowlist. - Reject embedded carriage returns, newlines, and NUL bytes. - Use a structured serialization format if arbitrary values must be supported. 6. Set restrictive permissions on the data directory and files, such as directory mode `0700` and file mode `0600`, where appropriate. 7. Add tests for quotation marks, backslashes, commas, CRLF sequences, multiline values, Unicode, and spreadsheet-formula prefixes. ]]>
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is marketed as a blockchain finality analysis tool, but the documented commands implement a generic local CRUD/export utility. This mismatch is dangerous because it can mislead users or agents into invoking file-writing, deletion, and data-export behavior under a trusted analytical label, increasing the chance of unintended side effects or misuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest description claims domain-specific finality analysis, while the documented behavior is a generic persistent data-management tool. In an agent setting, this semantic deception can cause inappropriate trust and execution decisions, leading to unauthorized local storage, modification, or export of data that the caller did not expect.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The human-facing documentation says the skill analyzes finality operations, but the command list consists of add/list/search/remove/export/config actions unrelated to that purpose. This makes the skill more dangerous in context because users seeking protocol-security analysis may unknowingly authorize local data manipulation commands with destructive or exfiltration-adjacent effects.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The inline documentation explicitly advertises finality-analysis functionality even though the script performs no such security or on-chain analysis. In an agent ecosystem, deceptive or inaccurate self-description increases the risk of unsafe delegation, incorrect security conclusions, and operator trust in nonexistent analysis.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill claims to analyze blockchain finality, but the implementation is only a local CRUD data manager. This mismatch is dangerous because it can mislead users and higher-level agents into trusting outputs as protocol/security analysis when no such analysis occurs, enabling silent task failure or deceptive capability presentation.

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 presents the tool as a finality-analysis utility, but the exposed commands only store, list, search, remove, export, and configure local data. This can cause users or orchestrating agents to invoke it for security-sensitive analysis and receive no real analytical protection, which is especially risky given the security-oriented skill context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown documents commands that add, remove, export, and reconfigure data without warning users that these operations write to disk, may delete stored content, or may create output files. Lack of safety disclosures increases the likelihood of accidental destructive actions, especially when an agent may invoke commands based only on the skill description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The remove command irreversibly deletes a line from the data file without confirmation, dry-run support, or backup. This creates a realistic risk of accidental data loss, especially when invoked by automation or with untrusted/incorrect line numbers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The export command copies stored entries into a new file in the current working directory, which is a file write affecting user data. Although the command prints a message after completion, there is no prior warning in the code comments or help text that running export will create or overwrite an output file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.