T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:43
- Finding
- Plaintext Storage of WeCom Application Secrets and Webhook Credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 43–51 and 119–130 **Vulnerability Type**: Plaintext sensitive credential storage in configuration **Risk Level**: Medium ### Vulnerable Code ```yaml channels: wecom: enabled: true corpId: "wx1234567890abcdef" # Enterprise ID agentId: 1000001 # Application AgentId secret: "xxxxxxxxxxxxxxxxxxxxxxxx" # Application Secret ``` ```yaml channels: wecom: enabled: true corpId: "wx1234567890abcdef" agentId: 1000001 secret: "xxx" groupBots: - name: "Development Group" webhook: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx" - name: "Operations Group" webhook: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=yyy" ``` ### Technical Analysis The Skill instructs users to place real WeCom application secrets and webhook keys directly in `~/.openclaw/config.yml`. Although the displayed values are placeholders rather than exposed production credentials, users following the instructions would replace them with active credentials stored as plaintext. The documentation does not require restrictive file permissions, environment-variable substitution, integration with a secret manager, exclusion from version control, or credential rotation. A WeCom webhook key embedded in a URL acts as a bearer credential: possession of the complete URL may be sufficient to submit messages to the associated group. An application secret may also be exchanged for an access token within the permissions assigned to the WeCom application. This weakness becomes exploitable if the configuration is readable by another local account or process, copied into an insecure backup, included in diagnostic output, or accidentally committed to a repository. ### Attack Path 1. An administrator follows the Skill and inserts active WeCom application secrets and webhook URLs into `~/.openclaw/config.yml`. 2. The configuration remains sto ...[truncated 1416 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace literal secret values in configuration examples with environment-variable or secret-manager references, for example: ```yaml channels: wecom: enabled: true corpId: "${WECOM_CORP_ID}" agentId: "${WECOM_AGENT_ID}" secret: "${WECOM_APP_SECRET}" groupBots: - name: "Development Group" webhook: "${WECOM_DEVELOPMENT_WEBHOOK}" ``` 2. Document secure secret injection through a supported operating-system credential store, deployment-platform secret facility, or dedicated secrets manager. 3. Require restrictive permissions for any configuration that can contain credentials: ```bash chmod 700 ~/.openclaw chmod 600 ~/.openclaw/config.yml ``` 4. Explicitly warn users not to commit configuration files, webhook URLs, access tokens, or application secrets to source control. Provide an appropriate `.gitignore` entry where relevant. 5. Ensure logs, diagnostics, and support bundles redact application secrets, access tokens, and webhook query parameters. 6. Recommend least-privilege WeCom application scopes and the narrowest necessary application visibility range. 7. Document immediate revocation and rotation procedures for exposed application secrets and webhook keys. 8. Prefer separate credentials for development, testing, and production so that exposure in one environment does not compromise the others. ]]>
