T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:92
- Finding
- Token Launch API Requires Transmission of a Solana Wallet Private Key<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:92-100`; supporting API specification at `references/marketplace.md:25-38` **Vulnerability Type**: Transmission of full wallet signing authority to a remote service **Risk Level**: High ### Complete Vulnerable Code Snippet From `SKILL.md:92-100`: ```python payload = { "name": "My Agent Token", "description": "Agent description", "ticker": "MAG", "private_key": "[1,2,3,...]" # Solana wallet private key } response = requests.post( "https://swarms.world/api/token/launch", ``` The corresponding API specification in `references/marketplace.md:25-38` states: ```markdown ## Token Launch API **POST** `https://swarms.world/api/token/launch` Creates agent listing + launches Solana token in single request. ### Required Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Agent display name (min 2 chars) | | `description` | string | Agent description | | `ticker` | string | Token symbol (1-10 chars, letters+numbers) | | `private_key` | string | Solana wallet key (JSON array, base64, or base58) | ``` ### Technical Analysis The documented token-launch workflow places a Solana wallet private key directly in an HTTP request body sent to `https://swarms.world/api/token/launch`. A private key provides full signing authority for its associated wallet and is not equivalent to a narrowly scoped API credential. HTTPS protects the request while it is in transit, but it does not protect the key from the receiving application, reverse proxies, request logging, observability systems, crash reports, compromised infrastructure, or personnel with access to server-side telemetry. The receiving service must process the plaintext key to use it, creating an avoidable high-value secret exposure. This behavior exceeds minimum privilege. A token-launch service only needs the user's public key and authorization for the specific transaction. It can construct an unsign ...[truncated 1199 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the `private_key` field from the token-launch API and all examples. - Have the server construct an unsigned or partially signed Solana transaction. - Return the transaction to the client for signing through a local wallet adapter, hardware wallet, or trusted local signer. - Submit only the signed transaction or signature to the remote service. - Use public keys and narrowly scoped authorization proofs instead of wallet secrets. - Reject requests containing private keys to prevent accidental disclosure. - Redact sensitive fields from request logs, traces, error reports, and monitoring systems. - Add explicit documentation warning users never to submit a funded wallet's seed phrase or private key to any remote API. - Advise existing users to rotate any wallet key previously submitted through this workflow and transfer remaining assets to a newly generated wallet. ]]>
