Back to skill

Security audit

Crypto Algo Execution

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent crypto-trading skill, but it can place live orders and has optional notification paths that can send private order details to arbitrary destinations or execute a configured command.

Install only if you intend to give this skill live crypto-trading authority. Use restricted and IP-whitelisted QE/exchange keys, separate read-only from trade-enabled credentials, avoid the webhook and command notification channels unless you fully control the destination or executable, and require a human confirmation outside the script before any create, update, cancel, or paired-order command.

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

Warning
Location
scripts/notify_order_complete.py:117
Finding

Unrestricted Webhook Destination Enables Sensitive Trading Data Disclosure and Blind SSRF

Content
View full analysis

Vulnerability Details

File Location: scripts/notify_order_complete.py, lines 117–127
Vulnerability Type: Unrestricted outbound webhook / sensitive information exposure / blind server-side request forgery (SSRF)
Risk Level: Medium

Vulnerable Code

python
def _send_webhook(target: str, master_order_id: str, message: str) -> None:
    if not target or target == "-":
        raise ValueError("webhook channel requires target URL")
    payload = json.dumps({"message": message, "masterOrderId": master_order_id}).encode("utf-8")
    req = request.Request(target, data=payload, headers={"Content-Type": "application/json"}, method="POST")
    try:
        with request.urlopen(req, timeout=15) as resp:
            if resp.status >= 400:
                raise RuntimeError(f"webhook returned status {resp.status}")
    except (HTTPError, URLError, TimeoutError) as e:
        raise RuntimeError(f"webhook request failed: {e}")

The sensitive message supplied to this function is assembled from private order information in _format_result, including the master order ID, trading symbol, direction, status, filled quantity, average price, total value, maker rate, completion progress, and potentially the order reason.

Technical Analysis

The webhook destination is supplied by the caller and passed directly to urllib.request.Request and request.urlopen. Validation only checks whether the target is nonempty and not equal to -. The implementation does not:

  • Require HTTPS.
  • Restrict destinations to approved notification providers.
  • Reject loopback, private, link-local, multicast, or cloud metadata addresses.
  • Restrict URL schemes explicitly.
  • Disable redirects or validate each redirect destination.
  • Minimize or redact the trading data sent in the webhook body.
  • Require separate confirmation of the destination and disclosed fields.

Consequently, a caller capable of selecting the webhoo ...[truncated 2650 chars]

Remediation
View remediation

Remediation Suggestions

  1. Use an explicit destination allowlist

    • Permit only administrator-configured notification hostnames.
    • Match normalized hostnames exactly rather than using suffix or substring checks.
    • Do not allow callers to supply arbitrary destinations unless a separate privileged configuration explicitly enables that capability.
  2. Require secure transport

    • Accept only https URLs.
    • Reject URLs containing embedded credentials.
    • Verify TLS certificates using the platform trust store.
    • Do not fall back to plaintext HTTP.
  3. Prevent SSRF

    • Resolve the destination before connecting.
    • Reject loopback, private, link-local, multicast, reserved, unspecified, and cloud metadata address ranges for both IPv4 and IPv6.
    • Revalidate the actual connection destination to reduce DNS-rebinding risk.
    • Disable redirects where possible. If redirects are required, apply the full scheme, hostname, port, and IP validation process to every redirect target.
    • Restrict destination ports to those required by approved providers.
  4. Minimize disclosed information

    • Send only a minimal event identifier and terminal status by default.
    • Make detailed fields opt-in.
    • Redact order IDs and financial values where the notification recipient does not need them.
    • Avoid sending free-form reason content without sanitization and an explicit need.
  5. Require explicit authorization

    • Display the normalized destination hostname and exact fields that will be transmitted.
    • Require explicit user confirmation before enabling webhook delivery.
    • Keep stdout or direct authenticated status queries as the default notification mechanism.
  6. Apply outbound network controls

    • Run the Skill with an egress policy that permits only QuantumExecute, required public market-data services, and approved notification providers.
    • Block access to loopback ...[truncated 405 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (49)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

A substantial mismatch between the advertised functionality and the actual implemented behavior is a security problem because users and orchestrators may grant credentials and permissions based on false assumptions. In a trading skill, misrepresentation can cause users to trust unsupported safety checks, venue coverage, or execution logic, leading to unsafe order routing or unintended exposure of exchange credentials and balances.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section provides ready-to-run order creation commands for live trading, including perp and target-position examples, but does not require an explicit final user confirmation immediately before submission. In a trading-execution skill, that omission is dangerous because a downstream agent could translate user intent into irreversible market actions without a clear consent checkpoint, increasing the risk of unauthorized or mistaken trades.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill explicitly requires environment variables, Python execution, and remote API access, and it can create, update, and cancel live crypto orders, yet it declares no explicit tool scope or permission boundaries. In an agent setting, this increases the chance of overbroad execution authority and accidental use of sensitive capabilities without clear operator review.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
## Official Links

- Website: https://www.quantumexecute.com/
- API Docs: https://api.quantumexecute.com/trading-api
- Golang SDK: https://github.com/Quantum-Execute/qe-connector-go
- Python SDK: https://github.com/Quantum-Execute/qe-connector-python
- Telegram Community: https://t.me/QuantumExecuteGroup

Session Persistence

Medium
Category
Rogue Agent
Confidence
79% confidence
Finding

The skill instructs users to create persistent API credentials and store them in a local shell-loaded env file for repeated authenticated use. Persistent high-privilege trading credentials materially increase the blast radius of host compromise, shell-history leakage, accidental sourcing, or misuse by other tools running in the same environment.

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

md
1. Register an account on the QuantumExecute website.
2. In QuantumExecute trading account management, bind your exchange API key.
3. Add QE page IP addresses to your exchange API whitelist.
4. Create a QuantumExecute platform API key.
5. Use `QE_API_KEY` and `QE_API_SECRET` for authenticated scripts.

## API Key Setup

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 68)May include surrounding context.

export QE_API_KEY="your_qe_api_key" export QE_API_SECRET="your_qe_api_secret" EOF chmod 600 ~/.qe.env

text

Load credentials before running authenticated scripts:

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/trading.md (reported line 134)May include surrounding context.

md
### Paired Order CLI Wrapper

Use `create_paired_order.py` only when the user explicitly wants a paired order. It creates two master orders concurrently. If either leg fails, the script attempts to cancel any successfully created leg and exits non-zero. Do not ask the user to choose paired-order tolerance or strict-bound parameters; this wrapper hard-codes them for both legs.

Fixed internal parameters for both legs:

Known Vulnerable Dependency: requests==2.32.5 — 2 advisory(ies): CVE-2026-25645 (Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility func); CVE-2026-25645 (Requests is a HTTP library. Prior to version 2.33.0, the `requests.utils.extract)

Medium
Category
Supply Chain
Confidence
94% confidence
Finding

The pinned dependency requests==2.32.5 is flagged with a known CVE affecting requests prior to 2.33.0, specifically involving insecure temporary file reuse in extract_zipped_paths(). Even if exploitation depends on the application actually invoking the affected utility on attacker-influenced content, shipping a version with a known published vulnerability is a real supply-chain weakness and should be treated as a true positive until proven unreachable.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This script directly submits a master order via client.create_master_order(**params) with no interactive confirmation, dry-run mode, or explicit warning at the point of execution. In a crypto algorithmic trading skill, that omission materially increases the risk of accidental or unintended live order placement, especially because the script accepts many trading parameters and authenticated API key references.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This script submits two live orders concurrently and, on partial failure, attempts a compensating cancel on the successful leg, all without any interactive confirmation, dry-run mode, or prominent safety gate. In the context of a crypto execution skill, accidental or unauthorized invocation can immediately place real market activity and rollback may be incomplete or fail, leaving unintended exposure and possible financial loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code file performs a filesystem write by exporting master order data, including trading account and order details, into an .xlsx file. Although it reports success afterward, there is no prior confirmation, cautionary comment, or explicit user disclosure in the script about persisting potentially sensitive data locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file fetches Binance CM account data and immediately prints the full result to stdout. There is no confirmation prompt, warning message, or explanatory comment/docstring disclosing that sensitive financial/account information may be retrieved and exposed in terminal output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This Python file performs an authenticated account-information lookup against Deribit and prints the returned balance data, which is sensitive financial information. While the script name and argument help indicate purpose, the file contains no explicit warning, confirmation, or user-facing disclosure about accessing and outputting sensitive account data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code fetches account margin balance data from an exchange API and prints the full result to stdout. While the script name and argument help imply its purpose, there is no explicit warning in code comments, docstrings, or user-facing output that sensitive account financial data will be retrieved and displayed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code file includes only Chinese natural-language descriptions in its module docstring, function docstrings, argparse description, and help text. That imposes a specific language/locale on users without offering a choice or documenting that the skill is intentionally region-specific, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/get_market_data.py (reported line 22)May include surrounding context.

python
def get_spot_price(symbol="BTCUSDT"):
    """获取现货实时价格"""
    url = "https://api.binance.com/api/v3/ticker/price"
    response = requests.get(url, params={"symbol": symbol}, timeout=10)
    data = _load_json(response)
    _raise_if_binance_error(data, symbol)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/get_market_data.py (reported line 32)May include surrounding context.

python
def get_spot_price(symbol="BTCUSDT"):
    """获取现货实时价格"""
    url = "https://api.binance.com/api/v3/ticker/price"
    response = requests.get(url, params={"symbol": symbol}, timeout=10)
    data = _load_json(response)
    _raise_if_binance_error(data, symbol)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring, CLI description, and argument help text are written only in Chinese, which imposes a specific language on users without any opt-in or indication that the skill is intentionally limited to a Chinese-speaking audience. This matches the policy concern for language or locale restrictions expressed in natural-language content.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/notify_order_complete.py (reported line 60)May include surrounding context.

python
def _fetch_detail(master_order_id: str) -> tuple[Optional[Dict[str, Any]], str]:
    cmd = [_python_bin(), str(_detail_script_path()), "--master-order-id", master_order_id]
    proc = subprocess.run(cmd, capture_output=True, text=True)
    raw = (proc.stdout or "").strip()
    if proc.returncode != 0:
        err = (proc.stderr or "").strip()

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
89% confidence
Finding

The command notification path executes a program specified by the NOTIFY_COMMAND environment variable with attacker-controllable arguments. While shell metacharacter injection is avoided by using a list, this still enables arbitrary code execution if an untrusted party can influence the environment or select the command channel in the runtime context.

Content

Scanner excerpt · scripts/notify_order_complete.py (reported line 134)May include surrounding context.

python
notify_cmd = os.environ.get("NOTIFY_COMMAND")
    if not notify_cmd:
        raise ValueError("NOTIFY_COMMAND not set for command channel")
    proc = subprocess.run([notify_cmd, target, message], capture_output=True, text=True)
    if proc.returncode != 0:
        err = (proc.stderr or proc.stdout or "").strip()
        raise RuntimeError(f"command notify failed: {err}")

Tainted flow: 'notify_cmd' from os.environ.get (line 131, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
95% confidence
Finding

NOTIFY_COMMAND is read directly from the environment and executed, creating a tainted path from external configuration to process execution. In automation and agent environments, environment variables are often easier to influence than source code, so this can become a reliable arbitrary command execution primitive.

Content

Scanner excerpt · scripts/notify_order_complete.py (reported line 134)May include surrounding context.

python
notify_cmd = os.environ.get("NOTIFY_COMMAND")
    if not notify_cmd:
        raise ValueError("NOTIFY_COMMAND not set for command channel")
    proc = subprocess.run([notify_cmd, target, message], capture_output=True, text=True)
    if proc.returncode != 0:
        err = (proc.stderr or proc.stdout or "").strip()
        raise RuntimeError(f"command notify failed: {err}")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The raised ValueError message is written only in Chinese: "请设置环境变量 QE_API_KEY 和 QE_API_SECRET". For a shared helper, this imposes a specific language on users without opt-in or justification, which is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The argument parser description and help text are hard-coded in Chinese, which imposes a specific language on users. Under the policy, language-specific behavior should offer user choice or be clearly documented as intentionally locale-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module docstring is written in Chinese (创建主订单(TWAP/VWAP/POV 等)。需认证。) while the file otherwise serves as a general command-line skill, and there is no indication that language choice is configurable or that the skill is region-specific. This can violate the language/locale policy when a specific language is imposed without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file-level docstring is written only in Chinese, presenting the skill description in a fixed language without offering a user choice or documenting a justified locale restriction. Under the language/locale policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.