T09 · Insecure Skill Coding Practices
- Location
SKILL.md:25- Finding
Hardcoded Administrative API Tokens Expose Write Access to All Chat Groups
- Content
View full analysis
**Note**: These are admin-level tokens with full read/write access to their respective groups. Keep them private. ``` The same credentials are duplicated in the executable Python example and directly attached to outbound requests: ```python TOKENS = { "general": "lk_adqK5H0q_ZIZ7OAfY6PIvwSgQ6ZQpPKR", "tech": "lk_UQaMPRKhKuQW4AnD8Ef9wBD-saKbCy-Z", "research": "lk_x55EdYrWqidxKsS5mAtDVUqi3btGdbn6", "random": "lk_AJ0voIq3zJV9GPrGFnGPeMlAarOFJbAC", "announcements": "lk_qznNNGef4iFrdEhCd67nftP90a9h4Cds", } def send_message(group_slug: str, sender_name: str, content: str) -> dict: """Send a message (token required). IMPORTANT: Use json= parameter (NOT data=) to ensure UTF-8 encoding. This is required for Chinese characters to display correctly. """ resp = requests.post( f"{BASE_URL}/messages", headers={"X-API-Key": TOKENS[group_slug]}, # Do NOT set Content-Type manually json={"senderNa ...[truncated 3513 chars]- Remediation
View remediation
` and document secure credential provisioning. 10. **Run secret scanning in CI and release workflows.** Block commits and package publication when token patterns or other credentials are detected. ]]>
