Back to skill

Security audit

Xxyy Trade

Security checks for vulnerabilities and agentic risk

Overview

This crypto trading skill is coherent, but it needs review because it uses a wallet-authorizing API key with broad activation, automatic wallet discovery, and a configurable API destination.

Install only if you intend to let this skill use an XXYY API key that can spend wallet funds. Keep XXYY_API_BASE_URL unset unless you fully trust and control the destination, use XXYY IP allowlisting, rotate the key if it may have been sent to the wrong host, and manually verify wallet, chain, amount, fees, and launch parameters before any transaction.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:25
Finding
Trade-Authorizing Bearer Credential Can Be Redirected to an Arbitrary Server<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:25-30, 62`; duplicated in `skills/xxyy-trade/SKILL.md:26-31, 63` **Vulnerability Type**: Unrestricted credential destination **Risk Level**: High ### Vulnerable Code ```markdown - `XXYY_API_KEY` (required) -- Your XXYY Open API Key (format: `xxyy_ak_xxxx`). - `XXYY_API_BASE_URL` (optional) -- API base URL, defaults to `https://www.xxyy.io` ## Authentication All requests require header: `Authorization: Bearer $XXYY_API_KEY` ``` ```markdown `POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swap` ``` The same configurable base URL is used throughout the Skill for authenticated ping, wallet, token-query, trading, and token-launch requests. ### Technical Analysis The Skill permits `XXYY_API_BASE_URL` to control the destination of requests while requiring the wallet-authorized bearer credential to be attached to every request. It does not require HTTPS, validate the destination hostname, or define an origin allowlist. The Skill explicitly states that the API key can execute real on-chain trades using custodial wallet balances. Consequently, this is not merely a read-only information token: disclosure can grant an attacker authority to initiate financial operations. An attacker who can influence the inherited process environment, runtime configuration, container configuration, or launch command can set the base URL to an attacker-controlled endpoint. Subsequent Skill activation or use then transmits the bearer credential to that endpoint. ### Attack Path 1. The attacker gains the ability to set or influence `XXYY_API_BASE_URL` in the Agent's environment. 2. The attacker sets it to an endpoint under their control, such as `https://attacker.example`. 3. The user activates the Skill or requests any supported API operation. 4. The Agent constructs the request using the attacker-controlled base URL. 5. The Agent adds `Authorization: Bearer $XXYY_API_KEY`. 6. The attacker's server re ...[truncated 807 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the unrestricted `XXYY_API_BASE_URL` override in production and use a fixed API origin. 2. If configurability is required, validate the normalized URL before sending a request: - Require the `https` scheme. - Require an exact approved hostname, such as `www.xxyy.io`. - Reject embedded credentials, nonstandard ports, fragments, and unapproved subdomains. 3. Configure `curl` so credentials are never forwarded across cross-origin redirects, and reject redirects to unapproved origins. 4. Separate read-only data access from transaction-authorizing access by using distinct, scope-limited credentials. 5. Prefer short-lived credentials with explicit endpoint, wallet, chain, and transaction-value restrictions. 6. Retain IP allowlisting as defense in depth, but do not treat it as a replacement for destination validation. 7. Document credential rotation and revocation procedures for environments where an unsafe base URL may already have been used. 8. Apply the correction to both duplicated Skill definitions to prevent divergent security behavior. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:1027
Finding
Automatic Cross-Chain Wallet Enumeration Exceeds Activation-Time Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:1027-1038`; duplicated in `skills/xxyy-trade/SKILL.md:1028-1039` **Vulnerability Type**: Unnecessary privileged network access and account-data enumeration **Risk Level**: Medium ### Vulnerable Code ```markdown ## Onboarding Flow **Trigger**: Automatically execute once when the skill is first activated in a session. Run only once per session. ### Detection Logic 1. Check if `$XXYY_API_KEY` is set in the environment. 2. **Case A — No API Key**: Display a setup guide: - How to get a key: visit https://www.xxyy.io/apikey - How to set it: `export XXYY_API_KEY=xxyy_ak_xxxx` - Show the feature table (Trade, Feed, Token Query, Wallets) and available strategies list. - Stop here until user sets the key. 3. **Case B — API Key exists**: Silently call Ping API. - **Ping success**: Silently fetch wallets for all 4 chains (`sol`, `eth`, `bsc`, `base`) via List Wallets API. For each chain, pick the index-0 wallet as the default; if no wallet exists, show "N/A". ``` The credential model is described elsewhere as: ```markdown - **No read-only mode** -- The same API Key is used for both data queries (Feed, Token Query) and trading (Buy, Sell). There is currently no separate read-only key. ``` ### Technical Analysis The onboarding flow automatically performs authenticated network operations as soon as the Skill is activated. After a successful ping, it silently retrieves wallet information for all four supported chains, regardless of the user's requested operation or selected chain. This behavior exceeds minimum privilege for operations such as public token lookup, token safety analysis, feed scanning, or checking a transaction identifier. Those tasks do not inherently require enumeration of every wallet and balance associated with the account. The issue is amplified because the same credential used for these background queries can also authorize trades. Automatic activation therefore expose ...[truncated 1440 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make onboarding and wallet discovery opt-in rather than automatic. 2. Do not access wallet APIs for token queries, feed scans, transaction lookups, or other read-only operations that do not require wallet data. 3. Query only the chain needed for the user's current request. 4. Delay wallet selection and balance retrieval until the user initiates a transaction requiring a wallet. 5. Inform the user before authenticated account data is retrieved and describe exactly which chain and fields will be accessed. 6. Replace silent cross-chain enumeration with a targeted request after explicit consent. 7. Introduce separate read-only and transaction-authorizing API credentials with narrowly scoped server-side permissions. 8. Avoid displaying or retaining wallet balances unless needed for a confirmed transaction. 9. Apply the same changes to both copies of `SKILL.md`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:846
Finding
Token Launch Operations Lack a Dedicated Explicit Confirmation Gate<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:846-869, 968`; duplicated in `skills/xxyy-trade/SKILL.md:847-870, 969` **Vulnerability Type**: Incomplete authorization controls for irreversible financial operations **Risk Level**: Medium ### Vulnerable Code ```markdown ### Launch Token `POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/{chain}/launch` Launch (create) a new token on SOL or BSC chain. Optionally buy an initial amount of the newly created token. ``` ```markdown **buyAmount Limits:** - SOL: max 100 SOL, min balance = buyAmount + 0.01 SOL - BSC: max 20 BNB, min balance = buyAmount + 0.015 BNB ``` The general confirmation rule is limited to buy and sell wording: ```markdown ## Execution Rules 1. **Always confirm before trading** -- Ask user to confirm: chain, token address, amount/percentage, buy or sell ``` The launch endpoint can also apply additional configuration and costs, including metadata, fees, gas settings, tax allocation, and an initial purchase. However, no dedicated launch workflow requires the Agent to present and reconfirm all launch parameters immediately before submission. ### Technical Analysis Creating a token is an irreversible on-chain operation, and an optional initial purchase can spend up to 100 SOL or 20 BNB according to the documented limits. The existing confirmation rule asks for a token address and a buy-or-sell action, which does not map cleanly to token creation because the token address may not exist until after launch. The documentation does not explicitly require launch confirmation covering: - The source wallet and current balance. - The initial `buyAmount`. - Platform fees, gas price, priority fee, or tip fee. - Token metadata and external URLs. - BSC tax allocation values. - The tax recipient address. - The final chain and launch mode. Because the launch operation is documented separately from the direct buy/sell flow, an Agent could reasonably interpret the general conf ...[truncated 1398 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a dedicated launch workflow with mandatory explicit confirmation immediately before the request is sent. 2. Present a complete confirmation table containing: - Chain. - Wallet name, address, and balance. - Token name and symbol. - Initial purchase amount. - Estimated platform fee and network fees. - Gas, priority fee, tip fee, slippage, and execution model. - Metadata URI, image, website, Twitter, and Telegram URLs. - Every tax percentage and the recipient address. 3. Default `buyAmount` to zero and never infer a nonzero initial purchase. 4. Require a second explicit confirmation for unusually large initial purchases or nondefault fee values. 5. Validate that the confirmation applies to the exact serialized request payload; any later parameter change must invalidate confirmation. 6. Require the user to confirm recipient addresses in full when a tax recipient is configured. 7. Reject missing, ambiguous, or inferred financial fields rather than silently selecting values. 8. Show the irreversible nature of token creation and all known charges before approval. 9. Apply the same launch-confirmation controls to both duplicated Skill definitions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill advertises very broad trigger phrases such as "feed," "onboarding," and "get started," which can cause the trading skill to activate in conversations that are not actually requesting crypto operations. In this context, unintended activation is risky because the skill has access to a custodial trading API key and can query wallets, balances, IP information, and potentially prepare trade flows.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
2. **Display format** -- Show wallet name, address, native balance. Mark pinned wallets with ⭐.
3. **Token holdings** -- If user asks about specific token holdings, pass `tokenAddress` to show per-wallet balance.
4. **No wallets** -- If response returns empty list, guide user to create at: https://www.xxyy.io/wallet/manager?chainId={chain}
5. **Default wallet memory** -- After user selects a wallet, remember it as the default for that chain in the current session. Use this default for subsequent trades on the same chain without asking again.
6. **Single wallet query** -- When the user provides a specific wallet address and asks for its balance, use Wallet Info API instead of List Wallets. Also use Wallet Info to show balance before trade confirmation.
7. **Error handling** -- Same as other data query APIs (see Error Codes table).
Confidence
88% confidence
Finding
Remembering and reusing a default wallet for subsequent trades "without asking again" increases the chance of acting on the wrong wallet through stale session state or ambiguous user intent. In a custodial trading context, that can lead to unintended trades from a different account balance than the user expected.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Onboarding Flow

**Trigger**: Automatically execute once when the skill is first activated in a session. Run only once per session.

### Detection Logic
Confidence
90% confidence
Finding
Automatically executing onboarding on skill activation is a form of autonomous action that triggers network access and account discovery before the user has explicitly asked for setup or wallet inspection. Given this skill's access to a unified read/write trading API key, even seemingly read-only autonomous behavior meaningfully increases privacy and misuse risk.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The onboarding flow is configured to run automatically on first activation and, in the API-key-present case, silently pings the service and fetches wallets across four chains. Because activation itself is broadly scoped elsewhere in the skill, this can cause unsolicited external requests and exposure of wallet metadata in response to unrelated user prompts.

External Transmission

Medium
Category
Data Exfiltration
Content
| 8062 | Rate limited | All APIs — data query: retry after 2s; trade: retry after 1s (except swap, see Execution Rules #5) |
| 8063 | IP not in whitelist — use `get_ip` to check current IP, update whitelist at https://www.xxyy.io/apikey | All APIs |

## Example curl

```bash
# Buy
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger list is extremely broad and includes generic phrases like "feed," "monitor chain," "get started," and wallet-related commands. In a skill that can execute real trades with a custodial API key, broad activation increases the chance the skill is invoked for ambiguous requests and steers the session into high-risk financial actions or wallet/API-key workflows the user did not intend.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
2. **Display format** -- Show wallet name, address, native balance. Mark pinned wallets with ⭐.
3. **Token holdings** -- If user asks about specific token holdings, pass `tokenAddress` to show per-wallet balance.
4. **No wallets** -- If response returns empty list, guide user to create at: https://www.xxyy.io/wallet/manager?chainId={chain}
5. **Default wallet memory** -- After user selects a wallet, remember it as the default for that chain in the current session. Use this default for subsequent trades on the same chain without asking again.
6. **Single wallet query** -- When the user provides a specific wallet address and asks for its balance, use Wallet Info API instead of List Wallets. Also use Wallet Info to show balance before trade confirmation.
7. **Error handling** -- Same as other data query APIs (see Error Codes table).
Confidence
88% confidence
Finding
Remembering and reusing a default wallet "without asking again" reduces friction but weakens transactional intent verification in a financial skill. If the skill is triggered ambiguously or conversation context is manipulated, subsequent trades may be prepared against a previously selected wallet the user did not mean to use in the current request.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Onboarding Flow

**Trigger**: Automatically execute once when the skill is first activated in a session. Run only once per session.

### Detection Logic
Confidence
86% confidence
Finding
Automatically executing onboarding on first activation causes the skill to initiate authenticated API activity and enumerate wallets even before the user explicitly asks for those actions. In this context, silent pinging and wallet discovery increase data exposure and can normalize background operations in a skill tied to custodial trading authority.

External Transmission

Medium
Category
Data Exfiltration
Content
| 8062 | Rate limited | All APIs — data query: retry after 2s; trade: retry after 1s (except swap, see Execution Rules #5) |
| 8063 | IP not in whitelist — use `get_ip` to check current IP, update whitelist at https://www.xxyy.io/apikey | All APIs |

## Example curl

```bash
# Buy
Confidence
96% confidence
Finding
The skill is explicitly designed to send authenticated curl requests containing a bearer API key to an external service that can query wallets, reveal server egress IP, and execute real trades or token launches. External transmission is expected here, but it is still security-sensitive because the same key grants spending authority and there is no read-only mode, so any misuse, logging, or prompt-induced action can have direct financial consequences.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The instructions prescribe user commands in Chinese such as "修改默认钱包 {chain} {wallet name or address}" as part of the interaction flow, but do not state that language is optional or user-selectable. This can create a locale policy issue by implicitly privileging one language in command examples without an explicit opt-in or alternative guidance.

Static analysis

No suspicious patterns detected.