T09 · Insecure Skill Coding Practices
- Location
NOTIFICATION_GUIDE.md:20- Finding
Plaintext WeCom application secret storage is recommended
- Content
View full analysis
Vulnerability Details
File Location:
NOTIFICATION_GUIDE.md:20-29
Vulnerability Type: Plaintext credential storage
Risk Level: Mediumjson { "default_settings": { "wechat_notification": { "enabled": true, "corp_id": "your_corp_id_here", "secret": "your_secret_here", "agent_id": 1000001 } } }Related instructions also appear in
README.md:71-80, while the corresponding plaintext field is defined inconfig.json:19-25.Technical Analysis
The primary configuration instructions direct users to put a live WeCom application secret directly in
config.json. Although the distributed configuration contains an empty value and the notification guide later recommends using environment variables, the documented setup process still encourages persistent plaintext credential storage inside the project directory.A project-level configuration file is commonly copied into backups, included in deployment artifacts, shared with other users, or accidentally committed to source control. The code then loads the secret directly from this file in the notification examples. No secret manager, environment-variable lookup, permission validation, or protection against source-control inclusion is implemented.
This finding does not indicate that the shipped project contains a real credential. The exposure arises when an operator follows the documented configuration process.
Attack Path
- An operator enables WeCom notifications.
- The operator follows the guide and writes the real CorpID and application secret into
config.json. - The configuration file is committed, archived, copied, or left readable by another local account.
- An attacker obtains the plaintext application secret.
- The attacker submits the CorpID and secret to the official WeCom token endpoint.
- Subject to the permissions assigned to that WeCom application, the attacker obtains an access token and can invoke authorized WeCom APIs.
Im
...[truncated 432 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
secretvalue from tracked project configuration. - Read the secret from an environment variable or an operating-system/cloud secret manager.
- Keep only non-sensitive values, such as
agent_id, in the regular configuration file. - Provide a sanitized
config.example.jsonrather than instructing users to modify a tracked configuration file with live credentials. - Add local secret-bearing configuration files to
.gitignore. - Restrict local secret-file permissions to the service account if file-based injection is unavoidable.
- Add startup validation that rejects placeholder, missing, or insecurely sourced credentials.
- Rotate any secret that has previously been committed or shared; removing it from the latest revision does not remove it from repository history.
- Update all examples to use a pattern such as:
python import os secret = os.environ["WECOM_APP_SECRET"]- Remove the
