Back to skill

Security audit

Mev

Security checks for vulnerabilities and agentic risk

Overview

This skill claims to analyze MEV and protocol security, but the inspected implementation is a persistent local entry manager with add, delete, export, and config operations.

Review this as a local note/config/export utility, not an MEV security analysis tool. Install only if you are comfortable with it creating ~/.mev, storing arbitrary entries there, deleting entries without confirmation, and exporting unescaped data; do not rely on it for protocol-security decisions.

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

Warning
Location
scripts/script.sh:9
Finding

Unescaped Entry Values Permit JSONL Record Injection and Unsafe Terminal Output

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ```bash cmd_add() { local value="${1:?Usage: mev add }" shift || true _save_entry "add" "$value $*" local count=$(wc -l < "$DATA_DIR/data.jsonl" 2>/dev/null || echo 0) echo "Added: $value (entry #$count)" } ``` ```bash tail -20 "$DATA_DIR/data.jsonl" | while IFS= read -r line; do local ts=$(echo "$line" | grep -o '"ts":"[^"]*' | cut -d'"' -f4) local cmd=$(echo "$line" | grep -o '"cmd":"[^"]*' | cut -d'"' -f4) local val=$(echo "$line" | grep -o '"val":"[^"]*' | cut -d'"' -f4) echo " [$ts] $cmd: $val" done ``` ### Technical Analysis The `_save_entry` function manually constructs JSON by inserting the entry value directly into a quoted JSON string. It does not escape quotation marks, backslashes, carriage returns, newlines, or other control characters. An attacker-controlled value can therefore: - Terminate or alter the expected JSON string. - Insert additional apparent JSONL records by including newline characters. - Corrupt the JSONL data file so subsequent parsing produces inaccurate results. - Store ANSI terminal-control sequences that are emitted when `list` or `search` displays the entry. The later parsing logic uses regular expressions rather than a JSON parser and does not validate that each line is valid JSON. This makes forged or malformed records more likely to be accepted or displayed misleadingly. ### Attack Path 1. An attacker or untrusted caller supplies an entry containing JSON delimiters, a newline, or terminal-control characters. 2. The `add` command pa ...[truncated 1185 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` - Parse records with `jq` or another JSON-aware parser rather than using `grep` and `cut`. - Reject disallowed control characters if multiline entries are not a required feature. - Before printing untrusted stored values, encode or visibly escape non-printable and terminal-control characters. - Validate every existing JSONL line and handle malformed records without displaying raw content. - Consider writing records atomically and setting restrictive data-file permissions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:105
Finding

CSV Export Permits Spreadsheet Formula Injection and Malformed Records

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 The CSV exporter concatenates fields with commas without applying CSV quoting or escaping. Consequently, commas, double quotes, carriage returns, and newlines in stored values can alter columns or create additional rows. The exporter also does not neutralize values beginning with characters commonly interpreted as spreadsheet formulas, including `=`, `+`, `-`, and `@`. If the exported file is opened in vulnerable or permissively configured spreadsheet software, an attacker-controlled field can be evaluated as a formula rather than treated as text. Formula behavior depends on the spreadsheet product and its security configuration. Potential formula effects include misleading displayed content and triggering external data requests. ### Attack Path 1. An attacker causes an entry to be added with a formula-like value, such as one beginning with `=`, `+`, `-`, or `@`. 2. The value is stored in `$DATA_DIR/data.jsonl`. 3. A user runs `scripts/script.sh export csv`. 4. The script writes the value directly into `mev-export.csv` without proper CSV encoding or formula neutralization. 5. The user opens the exported file in spreadsheet software. 6. The spreadsheet may evaluate the attacker-controlled field as a formula, subject to the application's security controls. Separately, an entry containing commas, quotes, or line breaks can corrupt the exported table structure even when n ...[truncated 760 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:132
Finding

Unescaped Configuration Keys and Values Can Corrupt Configuration Data

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 configuration key is interpolated directly into regular expressions used by `grep` and `sed`. Regular-expression metacharacters in a key can therefore modify which records match. The key and value are also inserted directly into the `sed` substitution expression. Characters such as `|`, `&`, backslashes, and newlines have special meaning in a sed program or replacement string: - A key containing regular-expression syntax can match entries other than the requested key. - A value containing `&` can insert the entire matched line into the replacement. - A key or value containing the `|` delimiter can terminate or alter the substitution expression. - Newlines can create malformed or additional configuration records. This is not shell-command injection because the expansion remains inside a quoted argument passed to `sed`. Nevertheless, attacker-controlled syntax can modify or corrupt the local configuration unexpectedly. ### Attack Path 1. An attacker or untrusted caller invokes `config` with a key containing regular-expression metacharacters or with a value containing sed ...[truncated 1177 chars]
Remediation
View remediation
&2 return 1 fi ``` - Reject newline and carriage-return characters in keys and values unless multiline values are explicitly supported. - Avoid constructing regular expressions from untrusted keys. Parse the file using literal key comparison, for example with `awk` and an equality check. - Avoid interpolating untrusted data into a sed program. Rewrite the configuration into a temporary file using a structured parser and then atomically replace the original file. - If sed remains in use, separately escape the regular-expression key and replacement value, including the chosen delimiter, backslashes, and ampersands. - Set restrictive permissions on the configuration file and use an atomic update strategy to prevent partial writes. ]]>
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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as an MEV analysis tool, but its documented behavior is a generic local data manager with persistent storage, export, deletion, and configuration features. This mismatch can cause users or agents to invoke it under false assumptions, expanding access to local data-handling operations that are unrelated to the declared security-analysis purpose.

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 blockchain/MEV analysis functionality, yet every listed command maps to CRUD-style local state manipulation rather than analysis. In an agent setting, this kind of deceptive or inaccurate interface can misroute trust and permissions, leading to unintended local file operations and possible data exposure or tampering.

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 the script can analyze MEV operations and evaluate protocol security, yet no such logic exists in the code. In a security-tool context, misleading claims increase operational risk because users may rely on nonexistent analysis and assume coverage where there is none.

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 an MEV analysis/security tool, but the implementation is only a local note tracker with add/list/search/remove/export features. This capability mismatch is dangerous because users may trust it for protocol-security or on-chain analysis tasks it cannot perform, leading to incorrect security decisions and deceptive skill behavior in an agent ecosystem.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The invocation guidance is broad and unspecific, encouraging use whenever MEV mechanisms or protocol security need to be understood, without clearly constraining when the skill should run or what side effects it has. In agentic environments, vague activation criteria can trigger the wrong tool and unintentionally expose local storage, configuration, or file-export operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The descriptive text says the skill helps understand MEV mechanisms and protocol security, but the command list describes status/add/list/search/remove/export/stats/config operations typical of a note or record manager. Such internal contradiction undermines safe operator expectations and increases the risk of accidental invocation of file-manipulating actions in a context where analytical behavior was expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation advertises removal and export features but provides no warning about deletion risk, data sensitivity, overwrite behavior, or destination handling. Without user-impact warnings, operators may accidentally destroy local records or export sensitive data to unintended locations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The remove command deletes stored data immediately with sed -i and no confirmation prompt, backup, or dry-run behavior. While this is not a code-execution issue, it can cause accidental loss of local data, and the risk is somewhat elevated because the skill presents itself as a security-analysis tool where retained records may matter.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.