Back to skill

Security audit

XT Exchange

Security checks for vulnerabilities and agentic risk

Overview

This XT.COM trading skill matches its stated purpose, but it handles live financial actions and credentials in ways users should review carefully before installing.

Review this as a high-risk financial automation skill. Use API keys with the minimum permissions needed, disable withdrawal permission unless required, prefer environment or platform-managed secrets over a plaintext credentials file, do not let the agent print credential values, and avoid using XT_HOST or XT_FUTURES_HOST with authenticated commands unless you fully trust the destination.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:47
Finding

Credential values are exposed through diagnostic commands

Content
View full analysis
/dev/null ``` ### Technical Analysis The documented credential checks print sensitive authentication material rather than merely checking whether it exists. The first command exposes the XT.COM access key, while the second can expose the complete credential file, including both the access key and secret key. When an AI agent executes these commands, their output may be retained in the agent transcript, terminal logs, debugging records, observability systems, or chat history. Credential presence can be verified without reading or displaying the values. Access to `~/.xt-exchange/credentials.json` is otherwise consistent with authenticated exchange functionality. The vulnerability is specifically the instruction to print its contents, which exceeds the minimum access necessary for checking credential availability. ### Attack Path 1. A user requests an authenticated account or trading operation. 2. The agent follows the Skill instructions and checks credential availability. 3. The agent executes `echo $XT_ACCESS_KEY` or `cat ~/.xt-exchange/credentials.json`. 4. The access key or complete credential pair appears in command output. 5. The output is captured in an agent transcript, terminal log, or monitoring system. 6. A party with access to those records obtains the credentials. 7. The exposed credentials are used against XT.COM within the API key's configured permissions. ### Impact Assessment Exposure of both the access key and secret key may allow an attacker to generate authenticated XT.COM requests. Depending on the API key permissions and exchange-side restrictions, this may expose account balances and order history or permit order placement, c ...[truncated 224 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/xt_spot.py:52
Finding

Spot API credentials can be redirected to an environment-controlled host

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/xt_futures.py:56
Finding

Futures API credentials can be redirected to an environment-controlled host

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:61
Finding

Python dependency is installed without version or integrity pinning

Content
View full analysis
Remediation
View remediation
--hash=sha256: ``` Install it through the intended interpreter: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` Additional controls: 1. Commit the lock or requirements file to the project. 2. Pin all transitive dependencies where the selected packaging workflow requires it. 3. Obtain hashes from reviewed artifacts and update them through a controlled process. 4. Use a trusted, explicitly configured package index. 5. Prefer a virtual environment rather than modifying the global Python installation. 6. Run dependency vulnerability and provenance checks during release preparation. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch specifically includes undeclared credential and file access, which is more serious than a simple documentation error. Claiming one scope while reading API keys from environment variables or ~/.xt-exchange/credentials.json can cause secrets exposure and authenticated account actions under false assumptions about what the skill does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This mismatch specifically includes undeclared credential and file access, which is more serious than a simple documentation error. Claiming one scope while reading API keys from environment variables or ~/.xt-exchange/credentials.json can cause secrets exposure and authenticated account actions under false assumptions about what the skill does.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill instructs the agent to obtain exchange API credentials from environment variables or a local credentials file. In a financial skill, credential access is highly sensitive because those keys may authorize balance queries, trading, transfers, or withdrawals; reading them without tightly scoped permissions and consent materially increases account-compromise risk.

Content

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

md
脚本优先读取以下凭证(按优先级):

1. **环境变量**(推荐):`XT_ACCESS_KEY` + `XT_SECRET_KEY`
2. **本地文件**:`~/.xt-exchange/credentials.json`

在执行需要认证的操作前,先检查凭证是否存在:

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The command cat ~/.xt-exchange/credentials.json explicitly reads a local secret file, which can expose API credentials to the agent runtime, logs, or downstream tools. In context, this is especially dangerous because the same skill also supports irreversible financial operations, so stolen or mishandled credentials could directly lead to account abuse.

Content

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

echo $XT_ACCESS_KEY

或检查本地文件

cat ~/.xt-exchange/credentials.json 2>/dev/null

text

若两者均未设置,引导用户:

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

Prompting users to store API keys in ~/.xt-exchange/credentials.json encourages persistence of high-value exchange secrets in a predictable local file path. While common in CLI tooling, this pattern is risky in an agent context because other skills, tools, or misconfigurations may access that file and use the credentials for authenticated trading or withdrawals.

Content

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

md
若两者均未设置,引导用户:

> 「需要 API Key 才能进行账户操作。请在 XT.COM 的 API 管理页面创建 Key,设置环境变量 XT_ACCESS_KEY 和 XT_SECRET_KEY,或将其保存到 ~/.xt-exchange/credentials.json。」

## 安装 Python 依赖

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The CLI exposes live futures trading and cancellation actions that immediately submit authenticated orders to the exchange with no confirmation prompt, dry-run mode, or explicit acknowledgement. In an agent skill context, this materially increases the chance of accidental or prompt-induced execution of real financial transactions, potentially causing direct monetary loss.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/xt_futures.py (reported line 5)May include surrounding context.

python
"""
XT.COM 现货交易 CLI
Base URL: https://sapi.xt.com (可由 XT_HOST 环境变量覆盖)
认证优先级:构造参数 > 环境变量(XT_ACCESS_KEY/XT_SECRET_KEY) > ~/.xt-exchange/credentials.json
"""
import argparse
import hashlib

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/xt_futures.py (reported line 23)May include surrounding context.

python
"""
XT.COM 现货交易 CLI
Base URL: https://sapi.xt.com (可由 XT_HOST 环境变量覆盖)
认证优先级:构造参数 > 环境变量(XT_ACCESS_KEY/XT_SECRET_KEY) > ~/.xt-exchange/credentials.json
"""
import argparse
import hashlib

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 5)May include surrounding context.

python
"""
XT.COM 现货交易 CLI
Base URL: https://sapi.xt.com (可由 XT_HOST 环境变量覆盖)
认证优先级:构造参数 > 环境变量(XT_ACCESS_KEY/XT_SECRET_KEY) > ~/.xt-exchange/credentials.json
"""
import argparse
import hashlib

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

python
"""
XT.COM 现货交易 CLI
Base URL: https://sapi.xt.com (可由 XT_HOST 环境变量覆盖)
认证优先级:构造参数 > 环境变量(XT_ACCESS_KEY/XT_SECRET_KEY) > ~/.xt-exchange/credentials.json
"""
import argparse
import hashlib

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The buy and sell commands place live orders immediately without disclosing that they will execute real trades or asking for confirmation. In an autonomous agent skill, this is dangerous because malformed inputs, manipulated conversation context, or user misunderstanding can cause unintended market or limit orders and direct financial loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The withdraw command submits a real withdrawal request immediately with user-supplied destination address and amount, but provides no interactive warning, dry-run, or confirmation step. In an agent-driven or conversational setting, a mistaken parse, prompt injection, or ambiguous user instruction could directly trigger irreversible asset loss to an attacker-controlled address.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares no explicit tool scope or permissions despite instructing access to environment variables, local credential files, package installation, and network-capable trading scripts. Missing scoping increases the chance an agent executes broader capabilities than users expect, especially in a financial-trading context where secrets and irreversible actions are involved.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill content is written as an instruction to operate in Chinese and specifies the invocation flow in Chinese text, without offering the user a language choice. This creates a locale/language policy issue because the skill appears to enforce a specific language by default rather than asking or allowing opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The request helper sends signed authenticated HTTP requests for balances, positions, orders, and trade actions to a remote exchange API, which necessarily transmits account identifiers and trading data over the network. While networking is part of the tool's purpose, the file lacks a visible user-facing warning or description that authenticated commands will send account and order information to XT.COM.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_futures.py (reported line 122)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_futures.py (reported line 125)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_futures.py (reported line 128)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 133)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 136)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 142)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 146)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/xt_spot.py (reported line 149)May include surrounding context.

python
# ── 公开接口 ──
    def ticker(self, symbol):
        return self._req("/future/market/v1/public/q/ticker", params={"symbol": symbol}, auth=False)

    def depth(self, symbol, limit=20):
        return self._req("/future/market/v1/public/q/depth", params={"symbol": symbol, "level": limit}, auth=False)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The bulk cancel command cancels open orders immediately and gives no prior disclosure or confirmation. While less severe than withdrawal, this can still disrupt active strategies, cause missed fills, or interfere with legitimate trading activity if invoked accidentally or via adversarial instruction injection.

Content

No source excerpt is available for this finding.