T09 · Insecure Skill Coding Practices
- Location
gate_crossex.sh:55- Finding
Shell Command Injection Through eval-Based curl Invocation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
gate_crossex.sh:55Shell Command Injection Through eval-Based curl Invocation
gate_crossex.sh:38API Secret Passed to OpenSSL Through Process Arguments
requirements.txt:1Unbounded Third-Party Dependency Version
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.
config_paths:
- ~/.openclaw/credentials/gate.json
- ~/.gate/credentials.json
binaries:
- openssl: 签名加密
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.
POST /orders
# 撤单
DELETE /orders
# 改单
PUT /orders/{order_id}
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.
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.
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### 基础信息
- **实盘交易**: `https://api.gateio.ws/api/v4/crossex`
### 主要功能模块
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### 基础信息
- **实盘交易**: `https://api.gateio.ws/api/v4/crossex`
### 主要功能模块
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"to": "BINANCE"
}
response = requests.post(
f"{host}{prefix}/wallet/transfers",
headers=headers,
json=transfer_data
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 设置正确的文件权限
chmod 600 ~/.openclaw/credentials/gate.json
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.
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
local headers=$(generate_signature "GET" "${API_PREFIX}${endpoint}" "$params" "")
eval curl -s -X GET \"${url}\" $headers
}
# 发送 POST 请求
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.
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.
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.
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.
requests>=2.31.0
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.