Back to skill

Security audit

Cex

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as a CEX/blockchain analysis tool, but the inspected artifacts implement a persistent local data manager with writes, deletion, export, and an unsafe config update path.

Review this carefully before installing. It does not appear to be a real CEX analysis skill; it stores local entries under ~/.cex, can delete them, can export them to files, and has coding flaws that could corrupt data or potentially execute unintended commands through crafted config values. Only use it in a contained environment with non-sensitive test data unless the publisher fixes the scope mismatch and unsafe shell handling.

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

Arbitrary Command Execution Through sed Injection in Configuration Updates

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 Both `key` and `val` are inserted directly into a GNU `sed` program without escaping. An attacker can include the `|` delimiter and additional `sed` syntax in either argument. In particular, GNU `sed` supports the `e` substitution flag, which executes the replacement text through a shell. The vulnerable branch is reached when the configuration file already contains a record matching the supplied key. A crafted value can terminate the intended replacement, add the `e` flag, and arrange for the generated replacement text to contain shell metacharacters and attacker-selected commands. The use of shell quoting around the entire `sed` expression does not prevent this attack because the injected content is interpreted by `sed` after shell expansion. ### Attack Path 1. An attacker first creates or identifies an existing configuration key using `script.sh config `. 2. The attacker invokes the configuration command again for the same key with a value containing a `sed` delimiter, shell me ...[truncated 905 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:8
Finding

JSONL Record Injection Through Unescaped Entry Data

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` ### Technical Analysis The function creates JSON by interpolating entry data directly into a format string. JSON-sensitive characters—including double quotes, backslashes, carriage returns, and newlines—are not escaped. Although the shell variables are quoted against shell word splitting, that does not make their contents valid JSON. A malicious value can terminate the intended JSON string, add fields, or insert newlines that create additional apparent JSONL records. Downstream commands treat physical lines as records and parse them with regular expressions rather than a JSON parser, increasing the effect of malformed or injected content. ### Attack Path 1. An attacker supplies an entry containing JSON syntax or embedded newline characters to the `add` command. 2. `_save_entry` writes the content directly inside the JSON string without escaping it. 3. The resulting `data.jsonl` becomes malformed or contains attacker-created additional lines. 4. The `list`, `search`, `remove`, `status`, and `export` commands consume the corrupted file as if each physical line were a legitimate record. 5. The attacker can manipulate displayed records, record counts, search results, exports, or the line targeted by a later removal operation. ### Impact Assessment The primary impact is loss of integrity and reliability of the local data store. An attacker who can influence added entry text can forge apparent records, corrupt exports, conceal content from the simplistic parser, and cause users to remove an unintended ...[truncated 196 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:107
Finding

Spreadsheet Formula Injection in CSV Exports

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 ``` ### Technical Analysis The export routine writes attacker-controlled values directly into CSV cells without RFC 4180 quoting or spreadsheet formula neutralization. Values containing commas, quotes, or line breaks can alter the CSV structure. More critically, spreadsheet applications may interpret cells beginning with `=`, `+`, `-`, or `@` as formulas. An entry beginning with a formula marker can therefore become executable spreadsheet content when a user opens the generated export. Depending on the spreadsheet application and its security configuration, formulas may trigger external requests, expose local or spreadsheet data, create deceptive hyperlinks, or invoke dangerous legacy functionality. ### Attack Path 1. An attacker causes an entry beginning with a spreadsheet formula marker to be stored. 2. A user runs `script.sh export csv`. 3. The export routine writes the value directly into the third CSV column without quoting or neutralization. 4. The user opens `cex-export.csv` in spreadsheet so ...[truncated 744 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:6
Finding

Sensitive Data Files Created Without Enforced Restrictive Permissions

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` Configuration data is similarly appended without setting explicit file permissions: ```bash echo "${key}=${val}" >> "$cfg" ``` ### Technical Analysis The Skill creates its data directory and files using permissions determined entirely by the invoking process's ambient `umask`. It does not enforce mode `0700` for the directory or mode `0600` for data and configuration files. With a permissive `umask`, the directory and files can become readable or traversable by other users on the same system. Existing directories are also accepted without verifying their owner or permissions. The stored entries may contain sensitive exchange-related notes or other user-provided information, while configuration values may contain operational settings. ### Attack Path 1. The Skill runs under an account with a permissive `umask`, or uses a pre-existing data directory with broad permissions. 2. `_ensure_dirs` creates or reuses the directory without applying restrictive modes. 3. Shell redirection creates `data.jsonl` or `config.txt` with permissions inherited from the ambient environment. 4. Another local user enumerates or reads the accessible directory and files. 5. Stored entries or configuration values are disclosed outside the intended account. ### Impact Assessment The impact is local confidentiality loss. An unprivileged account on the same host may be able to read stored entries and configuration data, depending on the actual `umask`, p ...[truncated 131 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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill presents itself as a blockchain/CEX analysis capability, but the documented behavior is a generic local data manager with persistent storage, export, and deletion features. This mismatch is dangerous because an agent or user may invoke the skill under false assumptions, leading to unintended filesystem writes, retention of sensitive data, or destructive actions unrelated to the advertised 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/CEX analysis, but the commands implement local entry management operations such as add, remove, export, and config. In an agent setting, this kind of deceptive or inaccurate interface can cause unsafe tool selection and make unrelated local-data manipulation appear trustworthy under a security-analysis label.

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 claims the script analyzes CEX operations, but the code performs local data storage and file management instead. Deceptive or materially inaccurate documentation increases the chance of unsafe execution because reviewers and users may underestimate the script's actual side effects on the local system.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The advertised purpose is CEX/security analysis, but the implementation is a local CRUD datastore and config manager. This mismatch is dangerous because users may grant trust and execute the skill expecting analysis-only behavior, while it silently persists, modifies, removes, and exports local data outside the declared scope.

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 markets the tool as an analysis skill, but the exposed commands are generic local data-management operations such as add, remove, export, and config. In a skill ecosystem, this kind of scope deception is risky because it can hide unauthorized data collection or persistence behind an apparently harmless analytical label.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description says to use the skill when you need to 'understand cex mechanisms, evaluate protocol security, or reference on-chain concepts,' which is a wide natural-language scope without clear trigger boundaries or exclusions. This can overlap with many general blockchain/security queries and does not specify when the skill should not be invoked.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The 'When to Use' and command list contradict the stated analytical purpose by emphasizing entry CRUD, export, and config actions. This inconsistency increases the chance that users or autonomous agents will invoke the skill in inappropriate contexts and permit writes or deletions they would not otherwise authorize.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown documents commands that add, remove, export, and configure persistent local data without warning about destructive effects or filesystem writes. In an agent context, omission of these warnings can lead to silent modification, deletion, or exfiltration of local data because the operations look routine and low-risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The remove command deletes a line from the persistent data file via sed -i, which is a destructive operation affecting stored user data. The script reports success after deletion, but there is no advance warning, confirmation prompt, or descriptive comment/help text highlighting that data removal is irreversible.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The export command copies or transforms stored entries into a new output file in the current directory. While the command prints the output filename afterward, the skill description and help text do not clearly warn that invoking export creates files containing stored data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script modifies persistent local state by updating or appending to $DATA_DIR/config.txt, but this action has no preceding warning in comments/docstrings and no explicit disclosure before the write occurs. Although it echoes the result afterward, the user is not warned in advance that configuration changes will be persisted to disk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.