Back to skill

Security audit

Consensus

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as blockchain consensus analysis, but its actual script is a local data manager with file writes, deletion, export behavior, and an unsafe config path that can lead to command execution.

Review this skill carefully before installing. It does not appear to perform blockchain consensus analysis; it manages local records instead. Avoid using the config command with untrusted keys or values, do not run exports in shared or sensitive directories, and treat stored/exported data as potentially malformed unless the script is fixed.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:139
Finding

Arbitrary Command Execution Through Configuration Value Injection

Content
View full analysis
/dev/null; then sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" else echo "${key}=${val}" >> "$cfg" fi ``` ### Technical Analysis The `key` and `val` arguments are inserted directly into a GNU `sed` program. Shell quoting prevents immediate expansion by the invoking shell, but it does not prevent the arguments from being interpreted as `sed` syntax. An attacker can place the `|` delimiter, the GNU `sed` `e` execution flag, a newline, and a comment into `val`. This closes the replacement expression and instructs GNU `sed` to execute the resulting replacement as a shell command. A newline followed by `#` can consume the delimiter appended by the script and keep the injected `sed` program syntactically valid. The issue is reachable whenever the attacker can invoke the Skill with controlled configuration arguments and update an existing configuration key. ### Attack Path 1. Create an ordinary configuration entry so that the vulnerable update branch is reached: ```bash scripts/script.sh config test initial ``` 2. Invoke the command again with a crafted value containing shell syntax, a `sed` delimiter, the GNU `sed` execution flag, and a newline. Conceptually, the payload has this form: ```text ; attacker-command |e # ``` 3. The script constructs a `sed` expression equivalent to: ```sed s|^test=.*|test=; attacker-command |e #| ``` 4. On GNU `sed`, the `e` flag passes the generated replacement text to a shell. 5. The attacker-supplied command runs with the same operating-system privileges and environment as the Skill process. Successful exploitation depends on GNU `sed` behavior, which is consistent with the script's existing use of GNU-style `sed -i`. ...[truncated 607 chars]
Remediation
View remediation
&2 return 1 } ``` - Rewrite the configuration through a temporary file using a method that treats values strictly as data rather than executable syntax. - Prefer a structured format and serializer, such as JSON generated with `jq`. - If `awk` is used, pass values through variables and avoid constructing source code from them. - Create temporary files securely with `mktemp`, apply restrictive permissions, and atomically replace the original configuration. - Add tests containing delimiters, newlines, backslashes, semicolons, and other metacharacters to verify that configuration values cannot alter program syntax. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:9
Finding

Malformed JSONL and Record Injection Through Unescaped Entry Values

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ### Technical Analysis The function constructs JSON by inserting strings directly into a JSON template. It does not escape quotation marks, backslashes, carriage returns, newlines, or other JSON control characters. An attacker-controlled entry can therefore: - Terminate the intended `val` string. - Add attacker-selected JSON properties. - Insert literal newlines and forge additional JSONL records. - Produce invalid JSON that breaks downstream consumers. - Manipulate the script's regex-based listing and export behavior. Shell quoting does not make the generated output valid JSON; it only prevents shell word splitting and pathname expansion. ### Attack Path 1. Invoke `add` with a value containing JSON syntax or embedded newline characters. 2. `_save_entry` places the value directly between JSON quotation marks. 3. The crafted input closes or corrupts the original JSON string. 4. If the input contains a newline, additional attacker-controlled lines can be introduced into `data.jsonl`. 5. Subsequent `list`, `search`, `remove`, or `export` operations treat the forged or malformed lines as stored records. For example, an entry containing a quotation mark and newline can transform one logical addition into malformed content or multiple apparent JSONL records. ### Impact Assessment The attacker can compromise the integrity of the persistent entry database. Consequences include: - Forging or altering the apparent structure of stored records. - Increasing the line count with records that were not legitimately created. - Causing incorrect listing, sear ...[truncated 309 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` - If adding a dependency is undesirable, implement complete JSON string escaping rather than partial character replacement. - Reject or normalize unexpected control characters if multiline values are not required. - Parse records with a JSON parser in `list`, `search`, and `export` rather than extracting fields with `grep` and `cut`. - Add regression tests for quotes, backslashes, tabs, carriage returns, Unicode, and embedded newlines. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:109
Finding

CSV Injection and Structural Corruption in Exported Data

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" ;; ``` ### Technical Analysis CSV fields are concatenated with commas without RFC 4180 quoting or escaping. Values containing commas, quotation marks, carriage returns, or newlines can alter the row and column structure. In addition, values beginning with spreadsheet formula markers such as `=`, `+`, `-`, or `@` are written without neutralization. When the exported file is opened in spreadsheet software, such fields may be interpreted as formulas rather than text. The preceding regex-based JSON extraction is also not a reliable parser and can truncate values containing quotation marks. ### Attack Path 1. Add an attacker-controlled entry whose value contains CSV delimiters or begins with a spreadsheet formula marker. 2. Run: ```bash scripts/script.sh export csv ``` 3. The entry is written directly into `consensus-export.csv` without CSV escaping. 4. A user opens the export in spreadsheet software. 5. Depending on the application and its security settings, the value may be evaluated as a formula or may alter the apparent row and column layout. ### Impact Assessment Possible effects include: - Misrepresentation or corruption of exported records. - Injection of attacker-controlled cells, columns, or rows. - Formula execution in spreadsheet applications. - Potential disclosure of spreadsheet-accessible data or external requests, depending on the spreadsheet application and security ...[truncated 156 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:100
Finding

Predictable Export Paths Permit File Clobbering and Symlink-Following Writes

Content
View full analysis
"$out" ``` ### Technical Analysis The export path is fixed relative to the current working directory. The script does not check whether the destination already exists, obtain user confirmation, create the file exclusively, or reject symbolic links. Consequently, export operations can silently overwrite an existing `consensus-export.json` or `consensus-export.csv`. If the predictable path is a symbolic link, `cp` or shell redirection can follow it and overwrite the linked target when the Skill process has write permission. ### Attack Path 1. An attacker or another process creates a file or symbolic link named `consensus-export.json` or `consensus-export.csv` in the directory where the Skill will run. 2. The user invokes the corresponding export operation. 3. The script writes to the fixed path without checking its type or existence. 4. The existing file, or the writable target of the symbolic link, is overwritten. The attacker must be able to prepare the current working directory or otherwise influence the predictable destination path. ### Impact Assessment The issue can cause: - Destruction or replacement of existing user files. - Overwriting of another writable file through a symbolic link. - Loss of data in shared or attacker-influenced directories. - Placement of exported data into an unintended destination. The overwrite remains limited to files writable by the operating-system account running the Skill and does not independentl ...[truncated 36 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill advertises blockchain consensus analysis, but the documented behavior is a generic local CRUD/export/config utility. This mismatch is dangerous because users or higher-level agents may invoke it with misplaced trust, causing unintended data modification or file export under the guise of harmless 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 and metadata frame this as a blockchain/security analysis skill, while the commands implement unrelated local entry management functions. In an agent ecosystem, this semantic deception can lead to unsafe invocation, overbroad trust, and accidental execution of file-writing or destructive commands in contexts where only read-only analysis was expected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The body documentation continues the claim of consensus analysis but only exposes add/list/search/remove/export/config actions unrelated to that domain. This creates a strong risk of confused-deputy behavior where an agent may perform persistent storage, deletion, or export operations because the skill presentation conceals its true capabilities.

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 claims consensus/security analysis capabilities that the code does not perform. In an agent-skill ecosystem, deceptive capability claims can misroute sensitive tasks to an unqualified tool and conceal local filesystem side effects behind a misleading security-oriented description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is presented as a consensus-analysis tool, but the implementation is only a local CRUD log manager. This mismatch is security-relevant because users or higher-level agents may grant it trust, permissions, or invoke it under false assumptions, causing unintended data handling and breaking policy or least-privilege expectations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The help text advertises consensus analysis and on-chain/security concepts, but the available commands only add, list, search, remove, export, and configure local data. This kind of capability deception is dangerous in automated environments because it can cause users or agents to rely on nonexistent analysis while the tool silently persists or exports data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description says to use the skill whenever you need to 'understand consensus mechanisms, evaluate protocol security, or reference on-chain concepts,' which is a very broad scope for a markdown skill description. It does not define specific trigger phrases, constraints, or exclusion cases, so the skill could be invoked for many general blockchain conversations unintentionally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documents commands that add, remove, export, and change configuration without any warnings or confirmation requirements. In agent-driven usage, lack of guardrails around data modification and file output increases the chance of unintended persistence, deletion, or exfiltration to local files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The remove command deletes a line from the persistent data file with sed -i and immediately reports success, but there is no confirmation prompt or prior warning in comments/docstrings about the destructive action. Because this operation irreversibly modifies user data, the skill should disclose that behavior more explicitly before performing it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The export command creates or overwrites consensus-export.<fmt> in the current directory, which is a file write affecting user data and filesystem state. While it prints a message after completion, there is no advance disclosure in the help text or inline documentation that running export will create an output file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.