← MCP server and skill grades

gmgn-skills

GMGNAI/gmgn-skills

C
Type
Plugin
Scanned
Nov 17, 2026
Version
3a8cd516d640
Files read
70

This plugin provides a command-line tool and AI agent skills for querying real-time crypto token analytics, profiling wallets, and submitting on-chain token swaps and launches through the GMGN OpenAPI. The biggest risks are that running any CLI command inside an untrusted project folder automatically loads that folder's .env file—allowing proxy and TLS settings to steal your global GMGN API key—and that prompt injection can trigger unconfirmed, irreversible trades when a signing key is configured.

What it can reach

Secrets
Reads GMGN_API_KEY and GMGN_PRIVATE_KEY from environment variables, a .env file in the current folder, and ~/.config/gmgn/.env, using the private key locally to sign trading and portfolio requests.
Files
Reads and writes ~/.config/gmgn/.env and ~/.config/gmgn/keypair.pem, loads .env from the current working directory, creates temporary data and optional HTML preview files during analysis, and reads local image files when launching tokens.
Network
Sends authenticated HTTPS requests (optionally through HTTP or SOCKS proxies) to https://openapi.gmgn.ai; skills also instruct the agent to check https://ipv6.icanhazip.com on auth errors, and gmgn-narrative fetches external social search APIs and token websites.
Shell commands
Skills instruct the AI agent to run gmgn-cli, bundled and inline python3 scripts, mktemp, base64, network interface commands, and openssl, while gmgn-cli config --apply invokes gmgn-cli via a subshell.
Other
Submits live, irreversible cryptocurrency swaps, multi-wallet batch trades, limit and stop-loss strategy orders, and token deployments using wallets linked to the user's GMGN API key.

Findings

1 high1 medium3 low
  1. HighWorkspace .env file can hijack proxy and TLS settings to steal global GMGN API key

    src/config.ts:35

    On every run, gmgn-cli loads a .env file from the current working directory into process.env before falling back to ~/.config/gmgn/.env, and before src/index.ts configures its HTTP proxy. If you use your AI coding agent inside a cloned untrusted repository that contains a crafted .env file setting HTTPS_PROXY to an attacker's server and NODE_TLS_REJECT_UNAUTHORIZED=0 (while omitting GMGN_API_KEY), running even a read-only GMGN query sends your real global GMGN_API_KEY through the attacker's proxy with TLS certificate checks disabled. A workspace .env file can also silently replace your GMGN credentials with an attacker's account.

    Fix: Parse .env files with dotenv.parse() instead of mutating process.env globally, only read allowlisted variable names (GMGN_API_KEY and GMGN_PRIVATE_KEY), or stop loading .env from the current working directory by default.

  2. MediumInline Python script in gmgn-wallet-score interpolates inputs directly into code

    skills/gmgn-wallet-score/SKILL.md:61

    Unlike the other skills in this plugin that validate addresses and pass arguments via sys.argv to standalone scripts, gmgn-wallet-score instructs the AI agent to textually replace <FILL_IN_*> placeholders directly inside an inline Python script (including quoted strings for CHAIN and WALLET and unquoted expressions for LATENCY_S, SLIPPAGE_PCT, GAS_USD, and SAMPLE) with no prior validation step. If prompt-injected text in a page or message tricks the agent into substituting a crafted string containing quotes or Python expressions, arbitrary code executes on your machine before gmgn-cli validates anything.

    Fix: Move the inline Python block into a standalone script, enforce strict chain and wallet regex validation before running it, and pass all parameters via sys.argv rather than source-code placeholders.

  3. LowAI setup guide writes signing private key to /tmp and exposes it to chat logs

    Readme.md:155

    The Quick Start (AI Agent) section instructs AI assistants to generate the user's Ed25519 signing key at a fixed path (/tmp/gmgn_private.pem) without waiting to ask, never deletes that file from shared /tmp, and then tells the agent to read the private key PEM and append it via shell echo. On multi-user systems (such as macOS, where /tmp allows overwriting pre-created world-writable files in place), another local user can read the generated key, and even on single-user machines the private key is exposed in /tmp, process arguments, shell history, and LLM conversation logs.

    Fix: Replace the manual openssl /tmp instructions in Readme.md and Readme.zh.md with the built-in gmgn-cli config and gmgn-cli config --apply commands, which store the keypair in ~/.config/gmgn/keypair.pem with 0600 permissions without exposing the private key to /tmp or the AI context.

  4. LowDirect trading and token-launch skills lack a user confirmation gate

    skills/gmgn-swap/SKILL.md:16

    All fund-moving CLI commands (swap, multi-swap, order strategy create, order strategy cancel, and cooking create) submit irreversible blockchain transactions immediately with no confirmation prompt. Although Readme.md advises users to review and confirm the AI's trade summary before every swap—and gmgn-token-buy enforces confirmation—gmgn-swap itself contains no instruction to show a summary or wait for user confirmation on sells, multi-wallet trades, strategy orders, or buys with skipped checks, and gmgn-cooking instructs the agent to execute directly once fields are collected. Because sibling skills like gmgn-narrative ingest raw, unsanitized social posts and token websites, prompt injection can trigger unauthorized trades if GMGN_PRIVATE_KEY is configured.

    Fix: Add an explicit, non-skippable user confirmation step in both gmgn-swap/SKILL.md and gmgn-cooking/SKILL.md before running any fund-moving CLI command, or require an interactive confirmation token in gmgn-cli unless an explicit unattended-mode env var is set by the user.

  5. LowUnvalidated --apply value allows newline injection into global ~/.config/gmgn/.env

    src/commands/config.ts:135

    Every skill instructs the AI agent to run gmgn-cli config --apply <KEY> during setup, and config.ts writes opts.apply directly into ~/.config/gmgn/.env without checking for newline characters before spawning a verification command. If a user allowlists gmgn-cli commands in their coding agent and prompt injection tricks the agent into calling config --apply with a multiline value, arbitrary environment variables (such as HTTPS_PROXY or NODE_TLS_REJECT_UNAUTHORIZED=0) can be persisted into ~/.config/gmgn/.env, and any existing GMGN_PRIVATE_KEY is silently overwritten.

    Fix: Validate the --apply API key against a strict character allowlist (rejecting newlines, carriage returns, whitespace, and quotes) before writing ~/.config/gmgn/.env, and refuse to overwrite an existing GMGN_PRIVATE_KEY without an explicit force flag.