← MCP server and skill grades

agent-trade-kit

okx/agent-trade-kit

C
Type
MCP server
Scanned
Nov 17, 2026
Version
7fb7ba139c8b
Files read
350

OKX Agent Trade Kit connects AI assistants to your OKX cryptocurrency exchange account so they can check market data, run trading bots, and place real trades. Because it handles real money—even overriding demo mode in some features—and automatically downloads and runs unverified programs, package updates, and third-party add-ons without asking, a tricked AI or tampered download could make unauthorized trades or run malicious code on your computer.

What it can reach

Secrets
Reads and saves your OKX API keys, secret keys, passphrases, and login tokens in ~/.okx/ or environment variables, and reads optional Telegram bot tokens and Lark webhook URLs.
Network
Connects to OKX servers and proxy hosts to view balances and trade, downloads helper programs and add-on skills from OKX content servers (static.okx.com, static.coinall.ltd, and static.jingyunyilian.com), checks the npm registry for updates, and sends optional alerts to Telegram or Lark.
Files
Reads and writes account settings, trade logs, and cached programs in ~/.okx/, edits AI assistant configuration and skill folders (including Claude Desktop, Cursor, Windsurf, VS Code, and ~/.agents/skills/), reads local .npmrc files, creates macOS background job files in ~/Library/LaunchAgents/, and can save downloaded skill packages to any folder.
Shell commands
Runs downloaded helper programs (okx-auth and okx-pilot), runs npm and npx commands to install updates and third-party skills, runs setup commands for Claude Code, and schedules background shell scripts via cron or macOS launchctl.
Browser
Opens your default web browser to the OKX API management page during interactive setup.
Other
Views your exchange balances and executes live financial actions on OKX, including spot and derivatives trades, internal fund transfers, trading bots, and Earn subscriptions.

Findings

1 high6 medium1 low
  1. HighSkill install and removal run unpinned npx skills in the current working directory

    packages/cli/src/commands/skill.ts:228

    When installing or removing a marketplace skill (which the bundled earn-hunter skill also instructs the agent to run automatically during preflight), okx skill add and okx skill remove invoke npx with an unpinned package name (skills) in the current working directory. Because npm exec searches node_modules/.bin from process.cwd() upward first and honors any local .npmrc registry setting, running this command while an AI coding agent is inside an untrusted cloned repository executes repo-controlled binaries or packages; even in a clean folder, it downloads and runs unpinned latest third-party code from npm at runtime.

    Fix: Depend on a pinned version of the installer library directly or pass --package with an exact version, and set cwd to os.homedir() or os.tmpdir() with --userconfig so untrusted workspace node_modules/.bin and .npmrc files are ignored.

  2. MediumSkill signature verification passes when unsigned extra files are present or SKILL.md is omitted

    packages/core/src/skills/verifier.ts:80

    verifySkillSignature only checks SHA-256 digests for files listed in signing.files and treats any additional files in the extracted directory as a non-fatal note while still returning status verified; it also never asserts that signing.files is non-empty or covers SKILL.md. A tampered skill archive or modified ~/.agents/skills/<name> directory containing injected unsigned scripts or reference files therefore passes okx skill add and okx skill verify without --force and gets installed into local AI agents.

    Fix: Fail verification whenever extraFiles is non-empty or when SKILL.md is absent from signing.files, requiring explicit --force to install any package with unsigned files.

  3. MediumBundled skills instruct the AI agent to silently self-upgrade global npm packages before commands

    skills/_shared/preflight.md:14

    All six core SKILL.md files instruct the AI agent to execute skills/_shared/preflight.md once per session before running any OKX command, even read-only market price queries. Step 1 tells the agent to run okx upgrade without asking the user, which executes npm install -g @okx_ai/okx-trade-mcp @okx_ai/okx-trade-cli to pull unpinned latest packages from npm and run their postinstall scripts, overriding any version pinning the user configured.

    Fix: Change the preflight step to okx upgrade --check (read-only check) and require explicit user confirmation before running npm install -g.

  4. MediumPostinstall and runtime updater fetch closed-source binaries from unpinned CDN URLs without signature checks

    packages/core/src/auth/update-check.ts:83

    Both scripts/postinstall-notice.js (run during npm install) and ensureAuthBinaryLatest (run automatically every 2 hours on okx auth commands) download closed-source native executables (okx-pilot and okx-auth) into ~/.okx/bin/ from unpinned URLs on static.jingyunyilian.com, static.okx.com, and static.coinall.ltd. Verification only compares the binary against a checksum.json fetched from the same mutable CDN host in the same session, with no pinned hash in the package and no public-key signature verification, so compromise of any of those CDN hosts leads to arbitrary native code execution.

    Fix: Pin versioned binary URLs and SHA-256 digests in each npm release or verify binaries against a hardcoded Ed25519 public key, and make runtime binary updates opt-in.

  5. MediumPilot proxy fallback rewrites the API base URL to an unvalidated hostname while sending API credentials

    packages/core/src/pilot/manager.ts:184

    When a direct request to OKX encounters a network error, or when ~/.okx/pilot-cache.json contains a proxy entry, PilotManager rewrites the request baseUrl from *.okx.com to node.host without checking node.host against a domain allowlist. Because the URL hostname itself is replaced, TLS certificate verification validates node.host rather than *.okx.com while OkxRestClient still attaches OK-ACCESS-KEY, plaintext OK-ACCESS-PASSPHRASE, OK-ACCESS-SIGN, or OAuth Bearer tokens, exposing credentials if the cache or resolver output is poisoned and routing data through undocumented proxy domains.

    Fix: Validate node.host against a strict allowlist of trusted OKX-owned domains before applying it, reject path or authority characters in node.host, and document or gate Pilot proxy fallback behind an explicit setting.

  6. MediumDefault-enabled skills_download MCP tool writes unverified marketplace archives to arbitrary directories

    packages/core/src/tools/skills.ts:132

    Although README.md states only spot, swap, and account are enabled by default, DEFAULT_MODULES also enables the skills module, including skills_download. Unlike okx skill add, skills_download skips Ed25519 signature verification, sets destructiveHint to false, and writes <name>.skill or <name>.zip into any caller-supplied targetDir (overwriting existing files), letting a prompt-injected agent drop unverified third-party skill packages directly into agent skill folders.

    Fix: Restrict targetDir to a dedicated downloads directory under ~/.okx/, run verifySkillSignature before saving, set destructiveHint to true, and remove skills from DEFAULT_MODULES to match documentation.

  7. MediumAutomatic startup update check reads .npmrc from the current working directory

    packages/core/src/utils/update-check.ts:87

    On startup, both okx-trade-mcp and the okx CLI call checkForUpdates, which walks upward from process.cwd() reading registry= entries from any .npmrc file. Starting the MCP server or CLI inside an untrusted repository containing a crafted .npmrc automatically sends an HTTP GET request to the attacker-specified URL (SSRF or tracking beacon) and lets that server spoof a newer version number during okx upgrade.

    Fix: Only read user (~/.npmrc) and global (/etc/npmrc) configuration for global package update checks, ignoring .npmrc files inside process.cwd() and its parent project directories.

  8. LowCredentials config (~/.okx/config.toml) and audit logs are written with world-readable default permissions

    packages/core/src/config/toml.ts:80

    writeFullConfig creates ~/.okx and writes ~/.okx/config.toml without setting restrictive POSIX file modes (0o700 and 0o600), leaving plaintext API keys, secret keys, passphrases, and proxy credentials readable (0644 under a standard 0022 umask) to other local users or unprivileged processes. TradeLogger similarly writes ~/.okx/logs/trade-YYYY-MM-DD.log with default permissions.

    Fix: Create ~/.okx and ~/.okx/logs with mode 0o700, write config.toml and log files with mode 0o600, and enforce chmodSync(path, 0o600) when updating existing files.