T09 · Insecure Skill Coding Practices
- Location
scripts/auth-manager.js:193- Finding
Reusable Authentication Token Disclosed Through Standard Output
- Content
View full analysis
{ console.log(token) ``` Both the authorization-status command and the normal authorization flow write the complete token to standard output. ### Technical Analysis The authentication token is a reusable credential sent as the `X-Auth-Token` header by the API client. Printing it to standard output exposes it outside the intended credential-storage boundary. Standard output is commonly captured by: - AI Agent execution transcripts - Parent processes and automation wrappers - CI/CD and diagnostic logs - Terminal recording and monitoring systems - Shell redirection - Centralized log collection services The `check` command only needs to report whether authorization exists, but it returns the credential itself. The normal authorization command also prints the token after retrieving and saving it. This unnecessarily expands the number of locations in which the secret may persist. ### Attack Path 1. A user or Agent invokes `node scripts/auth-manager.js check` or starts the default authorization workflow. 2. The script reads or retrieves the complete authentication token. 3. The token is printed to standard output. 4. An Agent transcript, process wrapper, terminal recorder, or logging service captures the output. 5. An attacker with access to that captured output obtains the token. 6. The attacker supplies the token as `X-Auth-Token` in requests to the Wangxiaobao API. 7. The attacker can access data and operations permitted by the com ...[truncated 897 chars]- Remediation
View remediation
{ console.log('Authorization completed successfully.') }) ``` ]]>
