Back to skill

Security audit

Bytesagain Crypto

Security checks for vulnerabilities and agentic risk

Overview

This crypto market-data skill mostly matches its stated purpose, but one command can run arbitrary local code if given a crafted pair filter.

Review before installing. The external market-data calls are normal for this kind of tool, but avoid running the pairs command with untrusted or generated filter text until the Python interpolation bug is fixed; also treat the advertised 100+ indicator claim and no-ads claim as overstated.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:310
Finding
Arbitrary Python Code Injection Through the Pair Filter Argument<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh`, lines 310–320 **Vulnerability Type**: User-controlled Python source-code injection **Risk Level**: High ### Vulnerable Code ```bash cmd_pairs() { local filter="${1:-USDT}" local res=$(_request "$BINANCE_API/exchangeInfo") [[ -z "$res" ]] && _error "Failed to fetch exchange info" echo "$res" | python3 -c " import json, sys d = json.load(sys.stdin) pairs = [s['symbol'] for s in d['symbols'] if s['status'] == 'TRADING' and '$filter' in s['symbol']] print(f'Found {len(pairs)} trading pairs for \"$filter\":') for i, p in enumerate(sorted(pairs), 1): print(f'{p:12s}', end='\n' if i % 5 == 0 else '') print() " } ``` ### Technical Analysis The `pairs` command accepts the `filter` argument from the command line and directly interpolates it into a Python program passed to `python3 -c`. The value is inserted into Python string literals in two locations without escaping or validation. Although the shell does not reevaluate shell metacharacters introduced through ordinary parameter expansion, Python subsequently parses the resulting text as source code. An attacker can supply a filter containing quotes, newlines, Python statements, and comment or multiline-string delimiters. This can terminate the intended string expression, add arbitrary Python statements, and neutralize the remaining generated source. The injected code runs under the same operating-system account, environment, working directory, and permissions as the Skill process. Successful exploitation requires the CoinGecko-style request made by this function to be replaced? No: this command uses Binance `exchangeInfo`; successful exploitation requires that request to return nonempty data so execution reaches `python3 -c`. ### Attack Path 1. An attacker causes the user or Agent to invoke the `pairs` command with an attacker-controlled filter argument. 2. `cmd_pairs` assigns the untrusted argument directly to `filte ...[truncated 1568 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Never interpolate untrusted data into source code supplied to `python3 -c`. Pass the filter as a positional argument or through a controlled environment variable and treat it exclusively as data. A safer implementation is: ```bash cmd_pairs() { local filter="${1:-USDT}" local res res=$(_request "$BINANCE_API/exchangeInfo") [[ -z "$res" ]] && _error "Failed to fetch exchange info" printf '%s' "$res" | python3 -c ' import json import sys filter_value = sys.argv[1] data = json.load(sys.stdin) pairs = [ item["symbol"] for item in data["symbols"] if item["status"] == "TRADING" and filter_value in item["symbol"] ] print(f"Found {len(pairs)} trading pairs for {filter_value!r}:") for index, pair in enumerate(sorted(pairs), 1): print(f"{pair:12s}", end="\n" if index % 5 == 0 else "") print() ' "$filter" } ``` Additional hardening measures should include: 1. Validate the filter against the intended symbol syntax, such as `^[A-Za-z0-9]{1,20}$`, if arbitrary text is unnecessary. 2. Use positional arguments, standard input, JSON, or environment variables whenever shell code invokes another language interpreter. 3. Search for and prohibit direct user-input interpolation into `python3 -c`, `sh -c`, `eval`, template-generated code, and similar execution contexts. 4. Add regression tests using quotes, newlines, semicolons, comment markers, and multiline-string delimiters to verify that inputs are treated only as data. 5. Run the Skill with least privilege and avoid exposing unrelated secrets through its environment. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The skill description materially misrepresents behavior and capability by claiming only Binance-backed market data and 100+ indicators while analysis indicates additional CoinGecko usage, undisclosed trending/top-coin discovery, and much narrower indicator coverage. Security-relevant misrepresentation undermines informed consent, review accuracy, and policy enforcement, making it easier to hide external data flows or expanded behavior behind trusted-looking metadata.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The description and usage examples consistently present the skill in both English and Chinese, and the title includes Chinese branding, but there is no statement that language is optional or user-selectable. This can violate language/locale policy expectations because it imposes a specific locale presentation without explicit user opt-in or justification.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The file header frames the toolkit as a technical reference, and the manifest further says it has zero external ads. Yet the help text and final output actively promote other skills, which contradicts the no-ads/no-promotion framing rather than merely omitting details.

External Transmission

Medium
Category
Data Exfiltration
Content
set -uo pipefail

VERSION="1.0.0"
BINANCE_API="https://api.binance.com/api/v3"
COINGECKO_API="https://api.coingecko.com/api/v3"

# ── Helpers ────────────────────────────────────────────────
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
VERSION="1.0.0"
BINANCE_API="https://api.binance.com/api/v3"
COINGECKO_API="https://api.coingecko.com/api/v3"

# ── Helpers ────────────────────────────────────────────────
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Description-Behavior Mismatch

Low
Confidence
92% confidence
Finding
The manifest description specifically states that the skill provides real-time crypto prices and indicators using the Binance API. However, the implementation also defines and uses a separate CoinGecko API endpoint for the top and trending commands, expanding the data sources beyond what the manifest describes.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The script performs HTTP requests with curl to Binance and CoinGecko, which transmits user-supplied query values such as symbols and intervals to third-party services. While the help text says market data is provided via these services, it does not explicitly warn users that invoking commands sends request data off-system.

Description-Behavior Mismatch

Low
Confidence
86% confidence
Finding
The manifest says the skill is a pure technical reference with zero external ads. The help output and final unconditional footer insert promotional discovery text for other skills, which is behavior outside straightforward market-data and indicator functionality and conflicts with the stated ad-free scope.

Static analysis

No suspicious patterns detected.