T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:125
- Finding
- Sensitive One-Time Authorization Code Collected Through the Conversation## Vulnerability Details **File Location**: `SKILL.md`, lines 125-140 **Vulnerability Type**: Sensitive credential exposure through conversational input **Risk Level**: High ### Evidence The following is an English translation of the audited instruction segment: ```markdown ### Step 2: Ask the user for the Xinjianxue AI authorization code and complete binding The AI must stop and ask the user for the Xinjianxue AI authorization code. It is a one-time credential and may only be used to bind the license above to the user's account. POST /api/xinjianxue/ai/license/bind { "license": "XJX-AI-xxxxxxxxxxxxxxxx", "auth_code": "<the 8-character code supplied by the user>" } The AI authorization code is a sensitive one-time credential. It is case-sensitive and becomes invalid after binding. ``` ### Technical Analysis The skill explicitly classifies the authorization code as a sensitive one-time credential but requires the user to send it through the AI conversation. Conversation content can pass through model providers, agent middleware, observability systems, debugging traces, and chat-history storage before the credential is redeemed. The later prohibition against exposing credentials in conversations applies primarily to the generated `license_key` and `api_key`; it does not provide a protected input mechanism for the authorization code. Redaction after submission would also be insufficient if upstream components had already logged the original message. Because the binding endpoint accepts an independently obtained license and the user's authorization code, possession of an unredeemed code may allow another party to bind the user's service account to an attacker-controlled AI license. ### Attack Path 1. The skill instructs the user to paste the one-time authorization code into the conversation. 2. An attacker gains access to chat history, telemetry, middleware logs, debugging output, or another co ...[truncated 1154 chars]
- Remediation
- ## Remediation Suggestions 1. Replace conversational credential collection with an OAuth-style authorization-code or device-authorization flow. 2. Direct the user to enter the code only on an authenticated page controlled by the service. 3. Return a narrowly scoped, short-lived, revocable binding result to the agent rather than exposing the original code. 4. Bind authorization attempts to the intended license, session, agent identity, and a nonce before displaying the code. 5. Apply strict expiration, one-attempt redemption, rate limiting, and replay protection. 6. Ensure chat systems, middleware, telemetry, and error handlers never receive or log the authorization code. 7. Provide account-side visibility and revocation controls for bound AI licenses. 8. If migration cannot occur immediately, use a dedicated secret-input channel with end-to-end redaction instead of ordinary chat messages.
