Back to skill

Security audit

Crypto Analyst

Security checks for vulnerabilities and agentic risk

Overview

This crypto analysis skill largely fits its stated purpose, but it runs unbundled local helper scripts by default and handles exchange credentials with misleading documentation.

Review before installing. Use only read-only OKX API keys with no trading or withdrawal permissions, avoid placing broad credentials in the project .env, and run okx_analyst.py with --no-news unless the external helper scripts are reviewed, trusted, and expected on your machine.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/okx_analyst.py:829
Finding
Default Execution of Unverified External Skill Scripts<![CDATA[ ## Vulnerability Details **File Location**: `scripts/okx_analyst.py`, lines 829–910 and 1055–1095 **Vulnerability Type**: Unverified local dependency execution **Risk Level**: Medium ### Vulnerable Code ```python def fetch_crypto_news(symbol, limit=5, lang='zh-CN', max_age_hours=24): """从NS3 API获取加密货币新闻 (通过Node.js脚本) 只保留最近 max_age_hours 小时内的新闻""" import subprocess base_symbol = extract_base_symbol(symbol) try: # 调用Node.js脚本获取新闻,获取更多然后过滤 script_path = '/Users/yirongcao/.openclaw/skills/crypto-monitor/scripts/news.js' cmd = ['node', script_path, f'--coin={base_symbol}', f'--lang={lang}', f'--limit={max(20, limit * 4)}'] result = subprocess.run(cmd, capture_output=True, text=True, timeout=30) ``` ```python def fetch_wire_news(symbol, limit=5, max_age_hours=24): """从通讯社RSS获取新闻 只保留最近 max_age_hours 小时内的新闻""" import subprocess from datetime import datetime try: # 调用wire-news脚本,获取更多然后过滤 script_path = '/Users/yirongcao/.openclaw/skills/wire-news-aggregator/scripts/wire_news.py' cmd = ['python3', script_path, '--limit', str(max(20, limit * 4)), '--json'] result = subprocess.run(cmd, capture_output=True, text=True, timeout=60) ``` The external scripts are invoked by default through the following command-line and control-flow configuration: ```python parser.add_argument('-n', '--news', action='store_true', default=True, help='获取相关新闻 (默认开启)') parser.add_argument('--no-news', action='store_true', help='禁用新闻') ``` ```python # 获取相关新闻 - NS3 + 通讯社 ns3_items = [] wire_items = [] if not args.no_news: print(f"📰 正在获取新闻 (NS3 + 通讯社) [过滤24小时内]...", file=sys.stderr) try: # NS3加密货币新闻 - 只保留24小时内 ns3_items = fetch_crypto_news(args.symbol, limit=5, lang='zh-CN', max_age_hours=24) if not ns3_items: ns3_items = fetch_crypto_news(args.symbol, limit=5, lang='en', max_age_hours=24) if ns3_items: print(f"✅ NS3: ...[truncated 3496 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Remove cross-Skill subprocess execution** - Fetch news through reviewed code contained within this project. - Use a documented HTTPS API client with an explicit destination allowlist and strict timeouts. 2. **Make news integration opt-in** - Set the news flag's default to disabled. - Require an explicit `--news` option before contacting news services or launching auxiliary components. - Remove the conflicting `action='store_true', default=True` configuration. 3. **Declare and verify external components** - If external scripts must remain supported, expose their paths through explicit configuration rather than developer-specific absolute paths. - Document their package names, versions, expected hashes, permissions, and network behavior. - Verify a cryptographic digest or signed manifest before every execution. 4. **Constrain the execution boundary** - Run auxiliary components with a minimal environment rather than inheriting all environment variables. - Use a dedicated low-privilege account or sandbox with restricted filesystem and network access. - Do not expose OKX credentials to news-related subprocesses. 5. **Bundle immutable reviewed dependencies** - Include required helper code in the audited package or use version-pinned packages from trusted repositories. - Maintain a lock file and integrity hashes for third-party dependencies. 6. **Fail transparently** - Report that a configured dependency is missing or failed integrity validation instead of silently treating all subprocess failures as an empty news result. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
If the skill can invoke external scripts or news aggregation beyond what the description discloses, that hidden expansion of behavior materially increases attack surface and user surprise. Undisclosed external execution paths are risky in agent skills because they can introduce unreviewed network destinations, data handling, or shell execution not anticipated by the user.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"""
OKX Account Balance Checker
Requires OKX API Key with read permissions. Uses only public endpoints (no trading).
.env 需要: OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE
"""

import sys
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
def load_env():
    """Load OKX credentials from .env (优先项目根目录,其次脚本目录)"""
    for env_path in [
        os.path.join(PROJECT_ROOT, '.env'),
        os.path.join(SCRIPT_DIR, '.env'),
    ]:
        if os.path.exists(env_path):
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
def load_env():
    """Load OKX credentials from .env (优先项目根目录,其次脚本目录)"""
    for env_path in [
        os.path.join(PROJECT_ROOT, '.env'),
        os.path.join(SCRIPT_DIR, '.env'),
    ]:
        if os.path.exists(env_path):
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises and orchestrates scripts that require shell execution, network access, file reads, and environment-based secrets, but it does not declare any explicit tool scope or permissions boundaries. This increases the risk of over-privileged execution, accidental secret exposure, or unsafe tool invocation because consumers cannot tell what capabilities the skill actually needs before running it.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill metadata and instructions are entirely presented in Chinese, with no indication that the user may choose another language or locale. Under the stated policy, a language constraint should either be optional for the user or explicitly justified as region-specific.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger phrase includes broad, everyday language such as asking for market views, which can cause the skill to activate unintentionally in contexts where the user did not explicitly request this crypto tool. Unintended invocation is more dangerous here because the skill can lead to network access, script execution, and potentially credential-dependent flows.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The script claims it 'uses only public endpoints' but actually calls OKX's authenticated private `/api/v5/account/balance` endpoint and requires API key, secret, and passphrase. This mismatch can mislead users into supplying sensitive credentials under a false assumption, increasing the chance of unsafe deployment or over-trust.

Intent-Code Divergence

Medium
Confidence
99% confidence
Finding
The module docstring materially contradicts the implementation by presenting the API usage as public/non-sensitive while the code performs signed private account access. In a security-sensitive crypto skill, this deception-by-documentation can cause operators to expose exchange credentials they would not otherwise provide.

External Transmission

Medium
Category
Data Exfiltration
Content
symbol = symbol.upper().replace('-', '') + 'USD'
    # Try Binance US first, then OKX as fallback reference
    for base_url in [
        f"https://api.binance.us/api/v3/ticker/price?symbol={symbol}",
    ]:
        try:
            r = requests.get(base_url, timeout=10)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.