T09 · Insecure Skill Coding Practices
Error
- Location
- validate-wecom-config.js:143
- Finding
- Plaintext Disclosure of WeCom Authentication and Encryption Secrets<![CDATA[ ## Vulnerability Details **File Location**: `validate-wecom-config.js:143-144` **Vulnerability Type**: Sensitive information exposure through console output **Risk Level**: High ### Vulnerable Code ```javascript console.log('3. Configure the message receiving server:'); console.log(' - URL: ' + wechatConfig.url); console.log(' - Token: ' + wechatConfig.token); console.log(' - EncodingAESKey: ' + wechatConfig.encodingAesKey); console.log('4. Save the configuration'); ``` ### Technical Analysis The validation utility reads WeCom configuration from a workspace-level `openclaw.json` file and prints the complete callback token and EncodingAESKey to standard output. These values are authentication and cryptographic secrets. Standard output is not an appropriate secret-handling channel because it may be captured by: - Terminal session recording - CI/CD logs - Centralized logging systems - Shell wrappers and process supervisors - Agent execution transcripts - Shared troubleshooting output The secret disclosure is unnecessary for configuration validation. The utility only needs to confirm whether the fields exist and whether the EncodingAESKey has the expected length. ### Attack Path 1. A user stores valid WeCom callback credentials in `openclaw.json`. 2. The user or an automated process runs `node validate-wecom-config.js`. 3. The script reads the workspace-level configuration file. 4. The complete callback Token and EncodingAESKey are written to standard output. 5. An attacker with access to retained terminal, CI, supervisor, or agent logs retrieves the values. 6. The disclosed material may be used to forge callback signatures or compromise the confidentiality of callback processing, depending on the surrounding WeCom integration. ### Impact Assessment The vulnerability does not independently grant operating-system privileges. It exposes credentials within the WeCom integration boundary. Potential impact includes: - Disclosure of callback a ...[truncated 449 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all output containing full tokens, secrets, encryption keys, or credentials. 2. Report only whether each secret is configured: ```javascript console.log(' - Token: configured'); console.log(' - EncodingAESKey: configured and length validated'); ``` 3. If identification is operationally necessary, use a non-secret identifier rather than a partial secret. 4. Require the configuration path to be explicitly supplied instead of automatically searching parent workspace directories. 5. Verify that the configuration file is readable only by the service account, such as mode `0600` on supported systems. 6. Redact secrets from CI logs, error telemetry, debug output, and process-supervisor logs. 7. Rotate the Token and EncodingAESKey if the validator has already been run in an environment where output may have been retained. ]]>
