T01 · Skill Instruction Hijacking
- Location
SKILL.md:14- Finding
Mutable Remote Rules Are Declared Highest-Priority Agent Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This wallet skill is not clearly malicious, but it needs Review because it persistently changes agent setup and handles wallet credentials, local binaries, signing, and automatic payments with weak scoping.
Install only if you fully trust the Gate wallet service and are comfortable with persistent agent configuration changes. Before use, verify the missing tx-checkin binaries and their provenance, review changes to MCP configs and CLAUDE.md/AGENTS.md, avoid sudo/global npm installation where possible, do not forward Authorization headers to arbitrary URLs, and require exact payment terms before any x402 payment or signing action.
SKILL.md:14Mutable Remote Rules Are Declared Highest-Priority Agent Instructions
references/tx-checkin.md:53Raw Wallet Authentication Token Is Extracted and Sent to a Secondary Domain
references/tx-checkin.md:40Signing Workflow Executes an Unverified Environment-Override Binary
install.sh:157Installer Persistently Injects Wallet Routing Rules into Agent Control Files
install_cli.sh:58Unpinned npm Package Is Installed Globally and Trusted with Wallet Credentials
references/x402.md:12x402 Auto-Payment Can Be Authorized Before Binding Approval to Payment Terms
references/x402.md:67Arbitrary URL and Authorization Header Forwarding Enables Credential Disclosure and SSRF
install.sh:97Cursor MCP Configuration Is Destructively Overwritten When jq Is Unavailable
The description presents an operational wallet-management skill with specific blockchain-related functions and safety requirements (including mandatory tx-checkin before signing). The actual code chunk is only an installation/configuration shell script for setting up the Gate DEX MCP server and skill routing in various AI clients. Its primary purpose is materially different from the declared runtime wallet functionality. It also performs undeclared local configuration actions and installs unrelated market/trade skills, while none of the core declared behaviors are implemented in this chunk. Therefore the description does not accurately represent what this code actually does.
The declared description presents a wallet-management skill with many runtime capabilities (auth flows, balance/history retrieval, transfers, x402 payments, wallet-connect, contract interactions, and CLI tooling). The supplied code chunk does not implement those wallet operations; its primary purpose is installation and local environment configuration for a CLI. That includes global npm installation, optional AK/SK credential capture, and editing local routing files—capabilities not described in the declared purpose. Additionally, the installer explicitly advertises and configures 'openapi-swap' and shows a swap command in quick start, which conflicts with the declaration that the skill is 'not for token swap execution.' Finally, the declaration emphasizes mandatory terminal tx-checkin for signing MCP calls, but this code neither performs nor enforces such a check. Overall, the code's actual behavior is materially different from the declared operational wallet skill, so this is a mismatch.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
mkdir -p "$skills_dir"
for skill in gate-dex-wallet gate-dex-market gate-dex-trade; do
if [ -d "$REPO_ROOT/$skill" ]; then
rm -rf "$skills_dir/$skill"
cp -r "$REPO_ROOT/$skill" "$skills_dir/$skill"
echo -e "${GREEN} ✓${NC} Installed: $skill → $skills_dir/$skill"
else
Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.
if claude mcp add --transport http gate-dex --scope project https://api.gatemcp.ai/mcp/dex 2>/dev/null; then
echo -e "${GREEN} ✓${NC} MCP server added successfully via CLI"
else
cat > .mcp.json << 'EOF'
{
"mcpServers": {
"gate-dex": {
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
if codex mcp add gate-dex --transport http --url https://api.gatemcp.ai/mcp/dex 2>/dev/null; then
echo -e "${GREEN} ✓${NC} MCP server added successfully via CLI"
else
local config_file="$HOME/.codex/config.toml"
mkdir -p "$(dirname "$config_file")"
if [ -f "$config_file" ] && grep -q '\[mcp\.gate-dex\]' "$config_file"; then
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
transport = "http"
url = "https://api.gatemcp.ai/mcp/dex"
EOF
echo -e "${GREEN} ✓${NC} ~/.codex/config.toml updated"
fi
fi
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
echo "gate-wallet CLI requires Node.js >= 18"
echo "Installation methods:"
echo " • macOS: brew install node"
echo " • Linux: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install -y nodejs"
echo " • Or visit: https://nodejs.org/"
exit 1
fi
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
echo "gate-wallet CLI requires Node.js >= 18"
echo "Installation methods:"
echo " • macOS: brew install node"
echo " • Linux: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install -y nodejs"
echo " • Or visit: https://nodejs.org/"
exit 1
fi
Listing all MCP tools and pairing that with direct-call guidance exposes the available backend capability surface to the agent, making enumeration and subsequent misuse easier. In this context, tool discovery is especially risky because the skill already handles authentication and potentially sensitive wallet operations, so hidden or admin-like tools could become reachable indirectly.
|---------|-------------|
| `chain-config [chain]` | Chain configuration |
| `rpc --chain <c> --method <m> [--params '<json>']` | JSON-RPC call |
| `tools` | List all MCP tools |
| `call <tool> [json]` | Call any MCP tool directly |
---
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
---
name: gate-dex-transfer
version: "2026.3.31-2"
updated: "2026-03-31"
description: "Gate Wallet transfer execution module. Builds transactions, signs, and broadcasts. Use when the user wants to send tokens to an address, including single and batch transfers. Includes mandatory balance verification, user confirmation gate, and terminal tx-checkin before signing. Supports EVM multi-chain and Solana native/token transfers."
---
# Gate DEX Transfer
> Transfer module — gas estimation, transaction preview, balance verification, **terminal tx-checkin before signing**, signing, and broadcasting. Includes mandatory user confirmation gates. 4 MCP tools + 1 cross-skill
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
- **tools/tx-checkin**: Fixed gateway base URL to **`https://webapi.w3-api.com/api/web/v1/web3-gv-api`** (check-in POST: **`.../api/v1/tx/checkin`**). Prebuilt binaries in **`tools/tx-checkin/bin/`** rebuilt.
- **tools/tx-checkin**: Optional **`TX_CHECKIN_GATEWAY_BASE`** env (automation/CI only; not user-facing in skill docs) overrides the gateway URL prefix.
- **references/cli.md**: version `2026.4.3-1`; tx-checkin integrated as mandatory step in On-Chain Operation Flow (preview → confirm → tx-checkin → execute); `send`, `swap`, `openapi-swap` commands annotated with tx-checkin requirement; new "tx-checkin Binary for CLI Operations" section with step-by-step flows; Security Rules updated (rule 3: terminal tx-checkin before signing); Common Pitfall #24 added; Capability Boundaries updated with signing prerequisite note
- **install.sh**: Removed misleading placeholder Bearer token from Cursor and Codex MCP configs (OAuth login populates at runtime); Claude Code install now appends to existing CLAUDE.md instead of overwriting; Codex config.toml checks for existing gate-dex entry before appending; AGENTS.md uses same append-not-overwrite logic; OpenClaw removed hardcoded default API key and unused key prompt
- **install_cli.sh**: OpenAPI credential input now escaped via `jq` (with `sed` fallback) to prevent JSON injection from special characters in API keys
## [2026.3.31-2] - 2026-03-31
The README explicitly says the wallet skill is triggered by broad conversation mentions of wallet operations, which can cause the skill to activate in contexts where the user is only discussing concepts rather than requesting execution. In a wallet-management skill that can authenticate, transfer assets, sign messages, and interact with DApps, overbroad activation increases the risk of unintended high-sensitivity actions being initiated or suggested.
The installation script is described as auto-detecting AI platforms and creating MCP configuration files, which establishes persistent changes to user environments and can silently enable future remote wallet-service access across tools. In the context of a financial wallet skill, session persistence is more dangerous because it can broaden the trust boundary and leave durable integrations that users may not fully understand or later forget remain active.
**MCP Installation Script Features**:
- 🔍 Auto-detect installed AI platforms (Cursor, Claude Code, Codex CLI, OpenClaw)
- ⚙️ Create corresponding MCP Server configuration files for each platform
- 🔗 Configure `gate-wallet` MCP Server connection
- 📦 Install all Gate DEX Skills (wallet, market, trade)
The listed trigger keywords include generic terms such as "login," "transfer," "approve," and "authorization," which commonly appear in ordinary conversation and in unrelated technical contexts. Because this skill has access to sensitive wallet functions, ambiguous trigger terms raise the likelihood of accidental invocation, misrouting, or prompting users into risky financial actions without a clearly scoped request.
The skill explicitly instructs the agent to perform terminal-based check-in flows and references prebuilt binaries under tools/tx-checkin/bin/, but the manifest declares no allowed-tools or permissions boundary. In a wallet-management skill that can reach signing paths, omitting an explicit shell/tool scope weakens containment and can let the agent invoke local execution capabilities without clear least-privilege constraints.
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.
## General Rules
⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.
Do NOT select or call any tool until all rules are read. These rules have the highest priority.
→ Read [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)
## Signing gate — terminal tx-checkin (mandatory)
The manifest states this skill is not for token swap execution, but the CLI routing row includes openapi-swap and hybrid swap as intents handled by this skill's CLI module. That creates a direct mismatch between the declared boundary and the documented routing behavior.
The manifest description explicitly says the skill should not be used for token swap execution, yet the MCP connection probe treats dex_tx_quote and dex_tx_swap as identifying tools for this skill. That ties the skill operationally to swap functionality rather than keeping it confined to wallet/account management.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
existing_config=$(cat "$config_file")
fi
echo "$existing_config" | jq '.mcpServers["gate-dex"] = {
"url": "https://api.gatemcp.ai/mcp/dex"
}' > "$config_file"
else
cat > "$config_file" << 'EOF'
No suspicious patterns detected.