T09 · Insecure Skill Coding Practices
- Location
- scripts/publish-remote.sh:96
- Finding
- WeChat credentials and unpublished content may be transmitted over plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/publish-remote.sh:96-105`; related insecure endpoint guidance at `SKILL.md:53-67` **Vulnerability Type**: Plaintext transmission of sensitive credentials to a configurable remote service **Risk Level**: High ### Vulnerable Code ```bash # Construct Publish Arguments PUBLISH_ARGS=$(jq -n \ --arg file_id "$FILE_ID" \ --arg theme_id "$THEME_ID" \ --arg app_id "$WECHAT_APP_ID" \ --arg app_secret "$WECHAT_APP_SECRET" \ '{file_id: $file_id, theme_id: $theme_id, wechat_app_id: $app_id, wechat_app_secret: $app_secret}') # Call remote MCP PUBLISH_RES=$(mcporter call wenyan-mcp.publish_article --config "$MCP_CONFIG_FILE" --args "$PUBLISH_ARGS" 2>/dev/null) ``` The documented MCP configuration explicitly recommends an unencrypted HTTP endpoint: ```json { "mcpServers": { "wenyan-mcp": { "name": "Remote WeChat Assistant", "transport": "sse", "url": "http://<your-remote-server-ip>:3000/sse", "headers": { "X-API-Key": "<optional-api-key>" } } } } ``` ### Technical Analysis The remote publishing script places the WeChat AppID and AppSecret directly into the arguments sent to `wenyan-mcp.publish_article`. It also uploads the unpublished Markdown article through the same configurable MCP service. Remote processing is part of the declared functionality, so transmitting publishing data to a remote server is functionally expected. However, transmitting it over plaintext HTTP is not necessary. The script does not reject non-TLS endpoints or otherwise enforce transport security. The MCP endpoint is selected through `$HOME/.openclaw/mcp.json` or a user-specified configuration file. Consequently, the confidentiality of the credentials and article depends entirely on the selected endpoint and network path. ### Attack Path 1. A user follows the configuration example and sets the MCP URL to an `http://` endpoint. 2. The user invokes `scripts/publish-remote.s ...[truncated 969 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require MCP endpoints to use HTTPS with valid certificate verification. 2. Reject `http://` URLs before transmitting article data or credentials. 3. Clearly disclose that the remote MCP operator receives both unpublished content and WeChat credentials. 4. Prefer storing the WeChat credential on a trusted, administrator-controlled MCP server instead of sending the AppSecret with every publication request. 5. Use narrowly scoped, revocable credentials where the WeChat platform supports them. 6. Authenticate the MCP service and protect API keys with restrictive file permissions. 7. Provide endpoint identity verification or certificate pinning for high-assurance deployments. 8. Rotate the WeChat AppSecret immediately if it has previously been transmitted through an untrusted or plaintext endpoint. ]]>
