T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:258
- Finding
- Plaintext API and webhook credential storage<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 39–56, 258–268, and 282–299 **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: Medium The documented configuration instructs users to embed API credentials and notification webhook tokens directly in configuration files and source-style configuration objects. ```javascript { notification: { enabled: true, channels: { dingtalk: { enabled: true, webhook: 'https://oapi.dingtalk.com/robot/send?access_token=XXX', useMarkdown: true }, feishu: { enabled: false, webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/XXX' } } } } ``` ### Technical Analysis DingTalk and Feishu webhook URLs contain bearer-like credentials that grant access to notification bots. The documentation also directs users to place the CSQAQ API token directly in `config.json`. Storing these values in plaintext configuration creates a risk that they will be disclosed through: - Accidental source-control commits - Configuration backups or artifact archives - Debug output and exception logging - Support bundles or screenshots - Unauthorized local file access - Process or application diagnostics that print configuration values The project provides no documented environment-variable integration, secret-manager support, restrictive file-permission requirements, log redaction, or source-control exclusion rules. Although the displayed values are placeholders rather than live credentials, following the documented deployment pattern would result in real secrets being stored in plaintext. ### Attack Path 1. A user follows the setup instructions and replaces the placeholder API token or webhook URL with a real credential. 2. The resulting configuration file is committed to a repository, copied into an artifact, included in a backup, printed in logs, or read by another local user or process. 3. An attacker extracts the CSQAQ ...[truncated 965 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Load API tokens and webhook URLs from environment variables or a dedicated secret manager rather than storing them directly in tracked configuration: ```javascript const apiToken = process.env.CSQAQ_API_TOKEN; const dingtalkWebhook = process.env.DINGTALK_WEBHOOK_URL; const feishuWebhook = process.env.FEISHU_WEBHOOK_URL; ``` 2. Provide a non-sensitive configuration template containing only variable references or empty placeholders. 3. Add secret-bearing files such as `.env`, `config.local.json`, and production configuration files to `.gitignore`. 4. Document restrictive file permissions for any local secret file, such as owner-only read and write access. 5. Redact API tokens, webhook query parameters, and complete webhook URLs from logs, errors, monitoring data, and diagnostic output. 6. Validate required environment variables at startup without printing their values. 7. Use a repository secret scanner and a pre-commit hook to detect accidentally committed tokens and webhook URLs. 8. Rotate and revoke any credential that has already been stored in source control, logs, published artifacts, or shared backups. Removing a secret from the latest revision alone is insufficient because it may remain in repository history. ]]>
