Back to skill

Security audit

Cross-exchange trading platform

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Gate CrossEx trading skill, but it needs Review because it enables live financial actions and includes an unsafe shell helper that can execute unintended commands.

Install only if you intend to let an agent work with a live Gate CrossEx account. Use read-only keys unless trading is required, disable withdrawal permissions, use IP allowlists and a low-balance subaccount, and avoid sourcing gate_crossex.sh until the eval-based curl calls and confirmation gaps are fixed.

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

T09 · Insecure Skill Coding Practices

Error
Location
gate_crossex.sh:55
Finding

Shell Command Injection Through eval-Based curl Invocation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
gate_crossex.sh:38
Finding

API Secret Passed to OpenSSL Through Process Arguments

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Third-Party Dependency Version

Content
View full analysis
=2.31.0 ``` The README also recommends an unconstrained installation: ```bash pip install requests ``` ### Technical Analysis The lower-bound-only requirement allows installation of any future `requests` release that satisfies the version comparison. There is no lockfile or integrity hash to bind installation to a reviewed artifact. No malicious or currently known-vulnerable package was identified in the audited files. The risk is that future installations can resolve to code that was not part of this review, reducing reproducibility and weakening supply-chain controls. Dependency resolution can also vary over time or between environments due to transitive dependency changes. ### Attack Path 1. A user installs the project dependencies at a later date. 2. The package resolver selects a newer, previously unaudited release of `requests` or one of its transitive dependencies. 3. If that selected artifact is compromised, malicious installation or runtime behavior executes in the user's environment. 4. The compromised dependency may access the Skill process's API credentials, network traffic, and files available to the current user. This is a prospective supply-chain hardening issue; the audit found no evidence that the currently named `requests` package is malicious. ### Impact Assessment A compromised dependency executes with the same privileges as the Python process importing it. In this Skill's intended environment, that scope could include: - Access to Gate API credentials stored in environment variables. - Modification or interception of authenticated API requests. - Reading files accessible to the current user. - Arbitrary outbound network communication. - Arbitrary code execution under the invoking account. Actual impact depends on which ar ...[truncated 54 chars]
Remediation
View remediation
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (17)

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

The skill explicitly relies on locally stored API credentials in predictable filesystem paths and environment variables, while also enabling networked trading actions. In an agent setting, encouraging plaintext secret storage and automatic credential discovery increases the blast radius if the skill or surrounding tooling is compromised, because exchange API keys can authorize trades and internal transfers.

Content

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

md
config_paths:
  - ~/.openclaw/credentials/gate.json
  - ~/.gate/credentials.json

binaries:
  - openssl: 签名加密

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
86% confidence
Finding

The skill exposes destructive trade operations such as DELETE /orders within a generic unified trading interface. In an agentic environment, if tool parameters are influenced by ambiguous prompts, automation errors, or prompt injection from external market data/tasks, the skill could cancel legitimate orders or alter live positions, causing direct financial loss.

Content

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

md
POST /orders

# 撤单
DELETE /orders

# 改单
PUT /orders/{order_id}

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script uses eval to execute curl commands assembled from variables that include endpoint, query parameters, headers, and POST data. If any of these values contain shell metacharacters or crafted quoting, an attacker could achieve command injection and execute arbitrary shell commands in the user's environment, which is especially dangerous because API secrets are already loaded in the same process.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes a fund-transfer primitive that can move assets between accounts with no confirmation prompt, policy guardrails, allowlist, or dry-run mode. In an agent or automation context, this creates a high-risk financial action surface where mistaken inputs or downstream prompt/parameter injection could trigger unauthorized or unintended transfers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises account management, fund transfers, order placement, cancellation, and swap capabilities, but it does not clearly warn that these actions can move funds, open positions, or cause irreversible financial loss if invoked unintentionally. In a trading skill, missing prominent account-impact warnings increases the chance that users or downstream agents treat dangerous operations as routine API calls and execute them without adequate confirmation.

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 151)May include surrounding context.

md
### 基础信息

- **实盘交易**: `https://api.gateio.ws/api/v4/crossex`

### 主要功能模块

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 288)May include surrounding context.

md
### 基础信息

- **实盘交易**: `https://api.gateio.ws/api/v4/crossex`

### 主要功能模块

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 331)May include surrounding context.

md
"to": "BINANCE"
}

response = requests.post(
    f"{host}{prefix}/wallet/transfers",
    headers=headers,
    json=transfer_data

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 404)May include surrounding context.

bash
# 设置正确的文件权限
chmod 600 ~/.openclaw/credentials/gate.json

4. 最小资金原则

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

No manifest is available, so the skill's intended scope is unknown. The code explicitly reads API key and secret values from environment variables and refuses to run without them, which is a sensitive capability not justified by any stated purpose in the provided context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script reads API credentials from environment variables and uses them to generate authenticated request headers for outbound HTTPS requests. While it errors if the variables are missing, it does not clearly warn users that the loaded shell functions will access credentials and transmit authenticated account and transfer requests to an external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · gate_crossex.sh (reported line 60)May include surrounding context.

sh
local headers=$(generate_signature "GET" "${API_PREFIX}${endpoint}" "$params" "")

    eval curl -s -X GET \"${url}\" $headers
}

# 发送 POST 请求

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README content is written entirely in Chinese, including usage guidance and warnings, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy issue unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents the skill description, configuration steps, warnings, and operational guidance only in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation when no alternative locale or language choice is provided.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The inline example comment says '查询 BTC 价格' (query BTC price), but get_symbols calls the /rule/symbols endpoint and is documented elsewhere as querying symbol information. This is an active documentation mismatch that could mislead users about the function's intent and returned data.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified as requests>=2.31.0, which allows any newer release to be installed and makes builds non-reproducible. This can unintentionally pull in a vulnerable or breaking version later, and it prevents reviewers from verifying exactly which package version the skill will use.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

Because requests is not pinned to a specific version, it is impossible to determine from this manifest whether installation will resolve to a version affected by one of the known advisories for that package. This uncertainty weakens supply-chain review and could permit deployment of a vulnerable release depending on resolver behavior and environment state.

Content

No source excerpt is available for this finding.