Back to skill

Security audit

Poke Perps

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated trading purpose, but its live-funds execution path is under-scoped and exposes a Solana keypair to an unpinned external MCP package.

Install only in read-only mode unless you are prepared for real Solana mainnet trades. For execution, use a dedicated low-balance wallet, pin and verify the MCP package version, review every transaction before signing, and do not let an agent autonomously deposit, withdraw, or open leveraged positions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Error
Location
SKILL.md:33
Finding
Unpinned Third-Party MCP Package Is Granted Access to a Solana Keypair<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:33-49`; duplicated in `llms.txt:51-67` **Vulnerability Type**: Unpinned executable dependency with access to private signing material **Risk Level**: High ### Vulnerable Code ```json { "mcpServers": { "pokeperps": { "command": "npx", "args": ["@pokeperps/mcp"], "env": { "POKEPERPS_KEYPAIR": "/path/to/your/keypair.json" } } } } ``` The corresponding environment-variable documentation confirms that the value is a path to a Solana keypair: ```markdown | `POKEPERPS_KEYPAIR` | Path to Solana keypair JSON | (none - read-only mode) | ``` The same configuration is repeated in `llms.txt`: ```json { "mcpServers": { "pokeperps": { "command": "npx", "args": ["@pokeperps/mcp"], "env": { "POKEPERPS_KEYPAIR": "/path/to/keypair.json" } } } } ``` ### Technical Analysis The recommended configuration runs `@pokeperps/mcp` through `npx` without an exact package version, package lockfile, integrity hash, or locally auditable implementation. Depending on the local npm configuration and cache state, `npx` can retrieve and execute the current registry release at invocation time. In execution mode, the launched package receives the filesystem path of a Solana keypair. Because the package runs with the invoking user's permissions, it can normally read the referenced file directly. It also has the network access required by the Skill. A compromised maintainer account, malicious package update, registry compromise, or unexpected future release could therefore access and transmit the private key or use it to sign transactions. The wallet capability is necessary for unattended trading as currently designed, but exposing raw private-key material to a remotely mutable dependency is not the minimum privilege necessary. An external wallet or narrowly scoped signing interface could authorize individual transactions without giving the MCP ...[truncated 1438 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the MCP dependency to an exact reviewed version rather than using `"@pokeperps/mcp"` without a version. 2. Distribute and install it through a lockfile with verified integrity hashes instead of dynamically resolving it during each `npx` invocation. 3. Publish the MCP source and reproducible-build information so users can verify that the distributed artifact matches reviewed code. 4. Do not expose raw keypair files to the MCP process. Prefer an interactive Solana wallet, hardware wallet, remote signer, or capability-limited signing service that displays and approves each transaction. 5. If unattended signing is unavoidable, use a dedicated low-balance wallet with no unrelated assets or authorities. 6. Run the MCP server in a sandbox with restricted filesystem access and an outbound-network allowlist. 7. Require explicit user confirmation for deposits, withdrawals, and position changes. Display the program ID, token mint, destination accounts, amounts, leverage, and fees before signing. 8. Document package provenance and the exact supported version in both `SKILL.md` and `llms.txt`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/EXAMPLES.md:134
Finding
Trading Examples Sign Transactions Containing Unverified Backend-Supplied Accounts<![CDATA[ ## Vulnerability Details **File Location**: `references/EXAMPLES.md:134-138, 221-222, 283-288, 331-335`; security requirement documented at `references/TRANSACTIONS.md:267-279` **Vulnerability Type**: Incomplete client-side validation of financial transaction accounts **Risk Level**: Medium ### Vulnerable Code The deposit example trusts backend-provided exchange, vault, and token-program accounts: ```typescript const ix = new TransactionInstruction({ programId: PROGRAM_ID, keys: [ { pubkey: new PublicKey(params.accounts.userAccount), isWritable: true, isSigner: false }, { pubkey: new PublicKey(params.accounts.exchangeState), isWritable: true, isSigner: false }, { pubkey: new PublicKey(params.accounts.vault), isWritable: true, isSigner: false }, { pubkey: userTokenAccount, isWritable: true, isSigner: false }, { pubkey: wallet.publicKey, isWritable: true, isSigner: true }, { pubkey: new PublicKey(params.accounts.tokenProgram), isWritable: false, isSigner: false }, ], data: Buffer.from(data), }); ``` The open-position example derives some PDAs but still trusts other backend values: ```typescript keys: [ { pubkey: expectedUA, isWritable: true, isSigner: false }, { pubkey: expectedPos, isWritable: true, isSigner: false }, { pubkey: expectedMarket, isWritable: true, isSigner: false }, { pubkey: new PublicKey(params.accounts.exchangeState), isWritable: true, isSigner: false }, { pubkey: new PublicKey(params.accounts.oracleState), isWritable: false, isSigner: false }, { pubkey: wallet.publicKey, isWritable: true, isSigner: true }, { pubkey: new PublicKey("11111111111111111111111111111111"), isWritable: false, isSigner: false }, { pubkey: SYSVAR_INSTRUCTIONS, isWritable: false, isSigner: false }, ], ``` The close-position example trusts additional writable accounts: ```typescript keys: [ { pubkey: expectedUA, isWritable: true, isSigner: false }, { pubkey: expectedPos, isWritable: true, isSigner: false } ...[truncated 4839 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Independently derive and compare every PDA documented in `references/TRANSACTIONS.md`, including exchange, vault, insurance fund, oracle, market, user account, and position accounts. 2. Reject the response before transaction construction if any backend-provided address differs from the locally derived address. 3. Hard-code and compare canonical program addresses, including the SPL Token Program, System Program, Ed25519 Program, and Instructions Sysvar. Never accept these addresses solely from an API response. 4. Derive and validate the user's associated USDC token account locally against the fixed USDC mint and wallet owner. 5. Validate all instruction arguments locally, including product ID, side, size, leverage, amount, oracle price, timestamp, and message encoding. 6. Confirm that the decoded signed oracle message exactly matches the product ID, price, and timestamp included in the trading instruction. 7. Display a human-readable transaction summary and require explicit user approval before signing, particularly for deposits and withdrawals. 8. Add automated tests that replace each backend account with an attacker-controlled address and verify that the client refuses to sign. 9. Audit the Solana program to confirm that it enforces PDA seeds, account owners, token mint, token authority, canonical program IDs, and signer constraints for every instruction. 10. Update all examples—not only the narrative security section—so that the recommended implementation consistently performs complete account validation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (10)

Ae1

High
Category
analysis-evasion
Content
- [references/EXAMPLES.md](references/EXAMPLES.md) — Complete code examples (TypeScript, Python, cURL)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

High
Confidence
97% confidence
Finding
The examples implement real mainnet deposit, open-position, close-position, and withdraw flows against Solana mainnet and a production backend, but provide no warning that these actions move real funds and create irreversible on-chain transactions. In an agent skill context, examples are often reused verbatim; this materially increases the chance a user or downstream tool executes loss-inducing trades without informed consent or sufficient safeguards.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The invocation guidance says to use the skill when the user asks about Pokemon card trading, perpetual futures, or PokePerps, which is broad enough to trigger this execution-capable skill for general informational queries about Pokemon cards. Because the skill includes wallet-linked trading and fund-moving operations, overly broad activation increases the chance an agent routes benign research requests into a high-risk financial toolchain and takes inappropriate preparatory or transactional steps.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill explicitly supports leveraged perpetual futures trading, deposits, withdrawals, and position execution, but the top-level invocation guidance and capability description do not require an explicit risk warning, user consent checkpoint, or confirmation before executing financially consequential actions. In an agent setting, broad execution capabilities combined with missing confirmation controls can lead to accidental or unauthorized trades, fund movement, and substantial losses, especially given support for up to 50x leverage.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The file explicitly documents execution-capable tools such as open_position, close_position, deposit, and withdraw, including how to enable them with a local Solana keypair, but it does not include any clear warning about irreversible on-chain actions, leverage risk, or the need for explicit user confirmation before trading. In an AI-agent context, this increases the chance that an assistant could autonomously facilitate or trigger financially harmful actions, especially given the platform supports up to 50x leverage and blockchain transactions are difficult or impossible to reverse.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file documents endpoints that retrieve user account balances, deposits, withdrawals, positions, and portfolio data keyed by wallet address. While the file notes authentication requirements for read-only endpoints, it does not warn users that querying or subscribing to wallet-address-based endpoints can reveal sensitive financial activity and account information.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The transaction section documents endpoints that prepare actions with direct financial consequences, including deposits, withdrawals, opening leveraged positions, closing positions, and adding margin. Although it says the user must build, sign, and submit the transaction themselves, it does not explicitly warn about irreversible financial risk, leverage risk, or the need for user review before signing.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The examples send wallet addresses and account/trading metadata to a remote backend without any privacy notice or data-minimization guidance. While wallet addresses are public on-chain, correlating them with off-chain research, account existence, positions, and behavior through a centralized API can create avoidable privacy leakage and user profiling risk.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Health check
curl https://backend.pokeperps.fun/api/system/health

# Get tradable products
curl https://backend.pokeperps.fun/api/trading/tradable
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The document provides step-by-step instructions for depositing funds, opening leveraged positions, closing positions, and withdrawing, but it does not include prominent warnings about liquidation risk, leverage amplification, oracle/pricing dependency, transaction finality, or the possibility of permanent financial loss. In a skill explicitly designed to facilitate perpetual futures trading, omission of these safety disclosures can materially increase the chance that users execute risky on-chain actions without informed consent.