T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:27
- Finding
- Plaintext Exchange API Credentials Disclosed to an Unverifiable Third-Party Telegram Bot## Vulnerability Details **File Location**: `SKILL.md`, lines 27-32 **Vulnerability Type**: Plaintext transmission of reusable trading credentials to an external service **Risk Level**: High The skill explicitly instructs users to send their API key, API secret, and passphrase in a Telegram message to an external bot: ```text ### 3. Connect via Telegram Open [@WEEXonTONbot](https://t.me/WEEXonTONbot) and send: ``` /connect YOUR_API_KEY YOUR_API_SECRET YOUR_PASSPHRASE ``` The bot deletes your message immediately for security. Keys are encrypted at rest. ``` ### Technical Analysis The API secret and passphrase are reusable authentication secrets that authorize signed requests to the user's exchange account. Sending all credential components through a chat message gives the receiving bot and its supporting infrastructure access to the complete credential set. The project contains only documentation and does not include the Telegram bot implementation, encryption implementation, storage controls, logging configuration, deletion logic, deployment configuration, or cryptographic key-management procedures. Consequently, the claims that messages are immediately deleted and credentials are encrypted at rest cannot be independently verified from the audited artifact. Deleting a Telegram message after receipt does not guarantee that its contents were not retained in application logs, exception reports, telemetry, database backups, message queues, process memory, or operator-controlled storage. Encryption at rest also does not protect credentials while the bot is actively using them or if the bot application or encryption keys are compromised. The recommendation to restrict the key to Spot Trading and disable withdrawals reduces the potential impact but does not eliminate it. A trading-enabled credential can still be used to inspect account information, place unauthorized orders, cancel legitimate orders, execute unfavorable trades, ...[truncated 1937 chars]
- Remediation
- ## Remediation Suggestions 1. **Do not collect secrets through Telegram messages.** Replace the `/connect KEY SECRET PASS` workflow with a dedicated authenticated enrollment interface that does not place secrets in chat history or bot-update payloads. 2. **Prefer delegated authorization.** Use an exchange-hosted OAuth or equivalent authorization flow if Weex supports one. Tokens should be narrowly scoped, revocable, and short-lived. 3. **Prefer local credential custody.** Where delegated authorization is unavailable, provide an auditable local client that signs exchange requests on the user's device so the API secret is never disclosed to the bot. 4. **Apply least privilege.** Require keys restricted to Spot Trading only, explicitly prohibit withdrawal permissions, apply exchange-supported IP allowlists, and use a dedicated key that is not shared with other applications. 5. **Implement secure secret handling if server-side custody is unavoidable.** - Use a reviewed secrets-management service or hardware-backed key-management system. - Encrypt each credential with authenticated encryption and per-record key material. - Keep decryption keys separate from credential storage. - Prevent secrets from entering application, proxy, audit, exception, or telemetry logs. - Redact Telegram updates and command arguments before logging. - Define automatic expiration, revocation, and secure deletion procedures. - Restrict production access and record all administrative access to secrets. 6. **Provide verifiable security evidence.** Include or publish the relevant bot source code, deletion logic, storage implementation, deployment model, and key-management design for independent review. Do not make unqualified claims about deletion or encryption without verifiable controls. 7. **Add user-facing risk disclosure.** Clearly state that the bot is a third-party custodian of trading credentials and that a trading-enabled key can caus ...[truncated 273 chars]
