T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:176
- Finding
- Plaintext Collection and Persistent Storage of Aster API Credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 176–249 **Vulnerability Type**: Plaintext sensitive-data handling and insecure credential persistence **Risk Level**: High ### Vulnerable Code ```markdown ### Share Credentials Users can provide Aster API credentials by sending a file where the content is in the following format: ```bash abc123...xyz secret123...key ``` ### Never Display Full Secrets When showing credentials to users: - **API Key:** Show first 5 + last 4 characters: `bb3b2...02ae` - **Secret Key:** Always mask, show only last 5: `***...ae1c` Example response when asked for credentials: Account: main API Key: bb3b2...02ae Secret: ***...ae1c Environment: Mainnet ### Listing Accounts When listing accounts, show names and environment only — never keys: Aster Accounts: * main (Mainnet) * trading (Mainnet) ### Transactions in Mainnet When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed. --- ## Aster Accounts ### main - API Key: your_mainnet_api_key - Secret: your_mainnet_secret - Testnet: false ### TOOLS.md Structure ```bash ## Aster Accounts ### main - API Key: abc123...xyz - Secret: secret123...key - Testnet: false - Description: Primary trading account ### trading - API Key: trade456...abc - Secret: tradesecret...xyz - Testnet: false - Description: Secondary trading account ``` ## Agent Behavior 1. Credentials requested: Mask secrets (show last 5 chars only) 2. Listing accounts: Show names and environment, never keys 3. Account selection: Ask if ambiguous, default to main 4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed 5. New credentials: Prompt for name, environment, signing mode ## Adding New Accounts When user provides new credentials: * Ask for account name * Ask: Mainnet? * Store in `TOOLS.md` with masked display confirmation ``` ### Technical Analysis The Skill ...[truncated 2257 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove instructions to place complete API credentials in `TOOLS.md` or any other project Markdown file. 2. Use an operating-system keychain, managed secret store, or similarly protected credential facility. Store only a non-sensitive account name or secret reference in `TOOLS.md`. 3. Request credentials through a dedicated secret-input mechanism rather than ordinary chat messages or plaintext file uploads. 4. Load credentials only when an authenticated request is performed and avoid retaining them longer than necessary. 5. Ensure credentials are excluded from source control, logs, transcripts, backups, generated reports, and diagnostic output. 6. Add repository ignore rules and automated secret scanning as defense-in-depth measures, while recognizing that ignore rules do not secure an already stored plaintext secret. 7. Recommend separate, narrowly scoped keys for read-only and trading operations. 8. Disable withdrawals and transfers by default, apply an IP allowlist, and enable only permissions needed for the requested operation. 9. Rotate any credential previously stored using the documented `TOOLS.md` format and securely remove residual copies from repository history, backups, and Agent workspaces. ]]>
