Back to skill

Security audit

Gate Exchange Simple Earn

Security checks for vulnerabilities and agentic risk

Overview

This Gate Simple Earn skill is mostly purpose-aligned, but it delegates highest-priority runtime rules to a mutable remote file and has conflicting safeguards around financial actions.

Review this skill before installing, especially if your Gate MCP has Earn:Write enabled. It can perform real financial actions, and the package should pin or vendor its shared runtime rules and make every write path require a fresh, explicit confirmation showing the final product, amount, rate or term, and consequences before execution.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:12
Finding
Mutable Remote Instructions Are Granted Highest Priority## Vulnerability Details **File Location**: `SKILL.md:12-14` **Vulnerability Type**: Remote instruction hijacking through a mutable external document **Risk Level**: Critical ### Vulnerable Code ```markdown ⚠️ 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) ``` ### Technical Analysis The Skill requires the Agent to retrieve and obey an external instruction document hosted on a mutable Git branch. The URL targets the repository's `master` branch rather than an immutable commit. More importantly, the Skill declares that the retrieved rules have the “highest priority.” This creates an instruction-precedence vulnerability: content outside the audited package can attempt to alter the Agent's session goals, safety constraints, output behavior, and tool-selection rules after the Skill has already been reviewed or installed. Although the current project does not contain local malicious scripts, the effective behavior of the Skill is not fully represented by the audited files. Anyone who can modify the remote document or its delivery path can change the instructions followed by future Skill invocations without modifying this package. ### Attack Path 1. An attacker compromises or otherwise obtains write access to the repository or branch containing `gate-runtime-rules.md`. 2. The attacker adds instructions that weaken confirmation requirements, request sensitive information, redirect tool calls, or override the Skill's documented restrictions. 3. A user activates this Simple Earn Skill. 4. The Agent follows `SKILL.md` and retrieves the mutable remote document. 5. Because the remote rules are declared to have the “highest priority,” the Agent may treat the injected content as authoritative. ...[truncated 773 chars]
Remediation
## Remediation Suggestions 1. Include the complete runtime rules inside the audited Skill package and reference them using a local relative path. 2. If remote retrieval is unavoidable, pin the URL to an immutable commit rather than `master`. 3. Verify the downloaded document against a cryptographic digest stored in the audited package. 4. Do not grant externally retrieved Skill content priority over system, developer, platform-security, or current user instructions. 5. Treat remote documents as untrusted reference data rather than executable instructions. 6. Fail closed if the pinned document is unavailable or fails integrity verification. 7. Include the pinned runtime rules in future security reviews so the complete effective instruction set can be audited.

T09 · Insecure Skill Coding Practices

Error
Location
references/mcp.md:48
Finding
State-Changing Minimum-Rate Tool Is Classified as Read-Only## Vulnerability Details **File Location**: `references/mcp.md:36-58`, specifically `references/mcp.md:48` **Vulnerability Type**: Incorrect security classification of an authenticated mutation **Risk Level**: High ### Vulnerable Code ```markdown ### Read tools - `cex_earn_list_uni_rate` - `cex_earn_get_uni_currency` - `cex_earn_get_uni_interest` - `cex_earn_list_user_uni_lends` - `cex_earn_list_earn_fixed_term_products` - `cex_earn_list_earn_fixed_term_products_by_asset` - `cex_earn_list_earn_fixed_term_lends` - `cex_earn_list_earn_fixed_term_history` - `cex_earn_change_uni_lend` ### Write tools - `cex_earn_create_uni_lend` - `cex_earn_create_earn_fixed_term_lend` - `cex_earn_create_earn_fixed_term_pre_redeem` ## 6. Execution SOP (Non-Skippable) 1. Classify query vs action. 2. For actions, pre-check product/amount eligibility. 3. Show **Earn Action Draft** (asset, amount, product, expected constraints). 4. Require explicit confirmation. 5. Execute write call and re-query state. ``` ### Technical Analysis `cex_earn_change_uni_lend` changes the minimum lending rate for an authenticated user position. It is therefore a state-changing operation, not a read-only query. The same file makes action classification the entry point for eligibility checks, action-draft generation, explicit confirmation, and post-action verification. Placing this mutation in the read-tool list can cause an implementation following the authoritative MCP specification to skip those controls. Other project files correctly describe this tool as changing lending settings and requiring confirmation, but the contradictory classification appears in `references/mcp.md`, which `SKILL.md` designates as the authoritative execution layer. The conflict makes enforcement dependent on which instruction an Agent follows. ### Attack Path 1. A user request is routed to the minimum-rate adjustment workflow. 2. The Agent consults the a ...[truncated 1045 chars]
Remediation
## Remediation Suggestions 1. Move `cex_earn_change_uni_lend` from the read-tool list to the write-tool list. 2. Explicitly state that changing a minimum lending rate is a financial action subject to the complete non-skippable SOP. 3. Require a fresh action draft containing the asset, current rate, proposed rate, and applicable constraints. 4. Require explicit immediate confirmation after displaying that draft. 5. Re-query the position after execution and verify that the returned rate matches the confirmed value. 6. Add an automated documentation validation rule that rejects known mutating MCP methods from read-only lists. 7. Resolve the classification consistently across `SKILL.md`, `README.md`, `references/mcp.md`, and the scenario documentation.

T09 · Insecure Skill Coding Practices

Error
Location
references/scenarios.md:198
Finding
Fixed-Term Subscription Scenario Directs a Financial Write Without Explicit Confirmation## Vulnerability Details **File Location**: `references/scenarios.md:198-209` **Vulnerability Type**: Missing confirmation step in a financial transaction workflow **Risk Level**: High ### Vulnerable Code ```markdown ## Scenario 3: Fixed-term manual subscribe (Fixed Earn manual subscription) **Context**: User wants to subscribe a fixed amount of a currency to a fixed-term product (e.g. 7-day, 30-day). Create one fixed-term lend order. **Prompt Examples**: - "Subscribe 100 USDT to Fixed Earn for 7 days" / "Buy 0.01 BTC Fixed Earn for 30 days" **Expected Behavior**: 1. Extract or ask for the currency, amount, and term (e.g. 7 days); resolve to `product_id` (e.g. via the product list by asset + lock_up_period). **Only use products with status=2 (subscribing).** 2. Call `cex_earn_create_earn_fixed_term_lend` (gate-d-e) with `product_id`, `amount`, `year_rate` (from product), and other required body fields. 3. Output success: Subscription submitted! You have successfully subscribed to the {amount} {currency} Fixed Earn {lock_up_period}-day product {order_id}. ``` ### Technical Analysis The scenario proceeds directly from parameter extraction and product resolution to the authenticated subscription call. It does not instruct the Agent to show an action draft or obtain fresh, explicit user confirmation immediately before submitting the order. This conflicts with `SKILL.md`, which requires confirmation for fixed-term subscriptions, and with the non-skippable action SOP in `references/mcp.md`. Because `SKILL.md` specifically routes read and transaction behavior through the scenario documentation, an Agent may follow this more specific workflow literally and submit the transaction based only on the user's initial request. The initial request should not be treated as equivalent to an immediate confirmation after the Agent has resolved the exact product ID, current annual rate, lock period, amount restrictions, and redemption con ...[truncated 1055 chars]
Remediation
## Remediation Suggestions 1. Add an eligibility pre-check for product status, visibility, minimum amount, maximum amount, available capacity, and account eligibility. 2. Display a final action draft containing the asset, amount, product ID, term, exact annual rate, reinvestment selection, redemption destination, and early-redemption constraints. 3. Require a fresh explicit response such as `Confirm action` after displaying the final draft. 4. State that the initial transaction request does not constitute final confirmation. 5. Abort or regenerate the draft if the product rate, availability, or resolved product changes before execution. 6. After execution, re-query current fixed-term positions and verify the resulting order rather than treating an empty response body alone as proof of success. 7. Make the scenario explicitly subordinate to the non-skippable action SOP in `references/mcp.md`.

T09 · Insecure Skill Coding Practices

Error
Location
references/scenarios.md:214
Finding
Fixed-Term Early Redemption Scenario Directs a Financial Write Without Explicit Confirmation## Vulnerability Details **File Location**: `references/scenarios.md:214-225` **Vulnerability Type**: Missing confirmation and constraint review before early redemption **Risk Level**: High ### Vulnerable Code ```markdown ## Scenario 4: Fixed-term early redeem (Fixed Earn manual early redemption) **Context**: User wants to early-redeem a fixed-term order by order_id. **Prompt Examples**: - "Redeem order number 123456 Fixed Earn order" **Expected Behavior**: 1. Extract or ask: `order_id`. 2. Call `cex_earn_create_earn_fixed_term_pre_redeem` (gate-d-e) with `order_id` (string). 3. Output success: Early redemption submitted! You have successfully early-redeemed the Fixed Earn {lock_up_period}-day product {order_id}; redeemed principal {principal}. ``` ### Technical Analysis This workflow instructs the Agent to call the early-redemption tool immediately after obtaining an order ID. It does not require the Agent to query and verify that the order belongs to the user, determine whether early redemption is supported, disclose the applicable loss of interest or other constraints, or request immediate confirmation. The scenario conflicts with `SKILL.md:176`, which requires confirmation of the order ID, and with the action SOP in `references/mcp.md`. The omission is especially significant because an order ID alone does not communicate the asset, principal, term, maturity status, or consequences of early redemption. ### Attack Path 1. A request contains or supplies a fixed-term order ID. 2. The Agent routes the request to Fixed Earn Scenario 4. 3. The Agent extracts the order ID but does not fetch and present the corresponding order details. 4. Following the scenario, the Agent invokes `cex_earn_create_earn_fixed_term_pre_redeem`. 5. The fixed-term position is redeemed without a fresh confirmation of the exact order and redemption consequences. ### Impact Assessment Successful exploitation can prematurely redeem ...[truncated 407 chars]
Remediation
## Remediation Suggestions 1. Query the order before redemption and verify its ownership, current status, principal, asset, term, maturity, and early-redemption eligibility. 2. Display an action draft identifying the exact order and all known redemption consequences, including potential interest or bonus forfeiture. 3. Require fresh, explicit confirmation immediately before the redemption call. 4. Reject redemption when the product does not support it or the order is not in an eligible state. 5. Do not treat an order ID contained in the initial request as final confirmation. 6. Re-query the position or redemption history after execution and report verified state. 7. Align this scenario explicitly with the non-skippable confirmation requirements in `SKILL.md` and `references/mcp.md`.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` keeps routing and business constraints.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
Skill: Simple Earn (Uni) flexible. Scenarios map to **MCP tools**; for tool arguments and response see **`earn-uni-mcp-tools.md`**.

**Display rule (all Uni scenarios)**: User-facing answers must **not** include time-related fields from MCP (no dates, timestamps, or time columns). See `earn-uni-mcp-tools.md` § “User-facing output”.

| Purpose | MCP tool | Auth |
|---------|----------|------|
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata scopes this skill to Simple Earn, but the scenario file also documents Fixed Earn discovery, subscription, redemption, history, and compliance flows. This creates a scope-expansion vulnerability: an agent selecting this skill for a Simple Earn request could be induced to perform unrelated Fixed Earn operations, including authenticated transactional actions the user did not intend under this skill boundary.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This markdown file includes natural-language statements that the skill references and docs are 'English-only' and were converted to English to satisfy validation. A forced language constraint can violate language/locale policy when it does not offer user choice or explain a region-specific need.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The changelog records mutually contradictory guidance about whether subscribe/redeem operations are disabled or enabled. In a financial-management skill, this can cause the agent or maintainers to implement unsafe state-changing behavior inconsistently, potentially allowing unintended asset subscriptions or redemptions despite earlier restrictions. The skill context makes this more dangerous because the affected actions can move user funds, so ambiguity around whether write operations are permitted materially increases operational risk.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
## 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)
- **Only call MCP tools explicitly listed in this skill.** Tools not documented here must NOT be called, even if they
  exist in the MCP server.
Confidence
80% confidence
Finding
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.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The trigger conditions include very broad standalone terms like "interest," "subscribe," and "positions," which can cause this finance skill to activate for unrelated user requests. In a write-capable trading/earn context, misrouting is more dangerous because it can steer the agent into collecting transaction parameters or preparing account-affecting actions when the user did not intend to use Gate Simple Earn.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill exposes an authenticated subscription action that commits user funds into a fixed-term product, yet it lacks any instruction to warn the user, verify balance/terms, or obtain explicit confirmation before execution. Because this changes account holdings and may lock assets for a term, an agent could perform financially significant actions based on ambiguous or manipulated prompts.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill documents an authenticated redeem operation that can liquidate or alter a user's fixed-term position, but it provides no requirement for explicit user confirmation, no warning about financial consequences, and no guardrails such as verifying the order details before execution. In an agent setting, this creates a real risk of unintended or prompt-induced account actions because the tool is directly usable for state-changing account operations.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
Line L005 says user-facing answers for all Uni scenarios must not include dates, timestamps, or time columns. Later documentation explicitly requires time-range handling and timestamp-bearing tables for Fixed Earn scenarios, creating contradictory documentation within the same skill file about what should be shown to users.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The instructions require displaying subscription and maturity times specifically in UTC+0 format for user-facing output. This imposes a locale/timezone presentation choice without offering the user an alternative or opt-in, which matches the policy concern about forced locale settings.

Static analysis

No suspicious patterns detected.