T09 · Insecure Skill Coding Practices
- Location
scripts/start.mjs:300- Finding
WeChat bot credentials exposed through an unauthenticated network service
- Content
View full analysis
{ server.listen(HTTP_PORT, () => { log(`HTTP service started: http://localhost:${HTTP_PORT}`); resolve(server); }); }); ``` ```js case 'confirmed': updated.message = 'Login successful!'; updated.connected = true; updated.botToken = data.bot_token; updated.ilinkBotId = data.ilink_bot_id; updated.ilinkUserId = data.ilink_user_id; updated.baseUrl = data.baseurl; break; writeStatus(updated); ``` ### Technical Analysis The login-status endpoint serializes and returns the complete status object. After successful pairing, that object contains the WeChat bot token, bot identifier, user identifier, and API base URL. The HTTP server calls `server.listen(HTTP_PORT)` without specifying a loopback address. Node.js can therefore listen on all available interfaces rather than exclusively on `127.0.0.1`. The endpoint has no authentication or session authorization. It also sets `Access-Control-Allow-Origin: *`, allowing cross-origin browser code to read the response where browser private-network controls do not block the request. The browser UI only requires pairing state and a human-readable message. Returning the token and account identifiers exceeds the minimum data required by the declared functionality. ### Attack Path 1. A user starts the Skill, which opens TCP port 8765. 2. The user scans and confirms the WeChat QR code. 3. The WeChat API returns `bot_token`, `ilink_bot_id`, and `ilink_user_id`. 4. The Skill writes those values into the status object. 5. An attacker able to reach the ...[truncated 857 chars]- Remediation
View remediation
