T09 · Insecure Skill Coding Practices
- Location
SKILL.md:86- Finding
Plaintext Storage of Account and Service Credentials
- Content
View full analysis
{baseDir}/bilibili-monitor.json << 'EOF' { "bilibili": { "cookies": "COOKIES值" }, "ai": { "openrouter_key": "OPENROUTER_KEY值或空", "model": "MODEL值" }, "email": { "smtp_email": "SMTP_EMAIL值", "smtp_password": "SMTP_PASSWORD值", "recipients": ["收件人1", "收件人2"] }, "report": {"num_videos": 10} } EOF ``` ### Technical Analysis The Skill initialization procedure writes a complete Bilibili cookie string, an OpenRouter API key, and a Gmail application password into an ordinary JSON file. The command does not establish owner-only file permissions, encrypt the secrets, or use a protected operating-system credential store. Excluding `bilibili-monitor.json` through `.gitignore` only helps prevent an accidental Git commit. It does not protect the credentials from other local users, insecure backups, directory sharing, endpoint malware, or a process that can read the project directory. This behavior also conflicts with the safer guidance in `README.md:64-82`, which states that sensitive credentials should be passed through environment variables rather than stored in the configuration file. ### Attack Path 1. A user follows the Skill initialization procedure. 2. The Skill creates `bilibili-monitor.json` containing reusable credentials in plaintext. 3. Another local account, backup reader, synchronization service, or compromised process obtains read access to the project directory. 4. The attacker reads the JSON file and extracts the Bilibili cookies, OpenRouter API key, and Gmail application password. 5. The attacker reuses the credentials against their corresponding services until the credentials expire or are revoked. ### Impact Assessment Exposure of the configuration file may allow: - Impersonation of the user's active Bilibili session within the ...[truncated 562 chars]- Remediation
View remediation
