T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:12
- Finding
- Xiaomi Account Password and Verification Code Exposed to an Unspecified MCP Server## Vulnerability Details **File Location**: `SKILL.md`, lines 12–21 **Vulnerability Type**: Sensitive credential exposure **Risk Level**: High ### Evidence The relevant instructions state: ```text Whenever a device-control request is received, first call xiaomi_auth_status to check authentication status. If the status is not_configured or not_authenticated: 1. Tell the user that a Xiaomi account and password are required. 2. After the user provides them, call xiaomi_setup(username, password, country) to initiate login. 3. If verification_required is returned, tell the user to check their phone or email for a verification code. 4. After the user provides the code, call xiaomi_verify(code). 5. Continue the original device-control request after authentication. ``` ### Technical Analysis The Skill instructs the user to disclose a Xiaomi account password and a second-factor verification code directly in the agent conversation. It then forwards both authentication factors to an MCP implementation that is not included in the audited project. The project provides no auditable guarantees concerning the MCP server's identity, transport security, credential storage, logging, retention, deletion, or access controls. It also does not warn the agent to prevent passwords and verification codes from appearing in conversation history, telemetry, or tool-call logs. This violates least-exposure principles for authentication secrets. A browser-based authorization flow or a narrowly scoped token would prevent the agent and MCP tool interface from handling the user's reusable account password. ### Attack Path 1. The user requests control of a Xiaomi smart-home device. 2. The Skill calls `xiaomi_auth_status`. 3. An unauthenticated status causes the Skill to request the user's Xiaomi username and password. 4. The agent forwards those credentials through `xiaomi_setup`. 5. The Skill subsequently requests a phone or e ...[truncated 941 chars]
- Remediation
- ## Remediation Suggestions - Replace direct password collection with Xiaomi's official browser-based OAuth, device authorization, or delegated token flow where available. - Do not place passwords or one-time verification codes in model-visible conversation content. - Use a trusted credential broker or operating-system secret store if direct credential handling is unavoidable. - Require a pinned and authenticated MCP server identity rather than relying on an unspecified implementation. - Document the MCP endpoint, transport encryption, credential-storage policy, retention period, logging behavior, and deletion procedure. - Use narrowly scoped and revocable tokens instead of reusable account passwords. - Redact authentication secrets from tool-call logs, application telemetry, errors, and conversation history. - Display a clear trust and privacy warning before transferring any authentication material to an external component.
