T09 · Insecure Skill Coding Practices
- Location
README.md:57- Finding
WeChat credentials are globally exported to unrelated shell processes
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is purpose-aligned for creating WeChat drafts, but its credential setup and temporary-file handling create risks that warrant Review before installation.
Install only if you are comfortable giving the skill authority to create drafts and upload materials in your WeChat Official Account. Do not put the .env source command in a persistent shell startup file; load the secret only for the publishing command, restrict the .env file permissions, and consider rotating the AppSecret if it has already been broadly exported. Treat unpublished article HTML and cover images as sensitive until the temporary-file handling is hardened.
README.md:57WeChat credentials are globally exported to unrelated shell processes
SKILL.md:64Predictable temporary paths allow symlink-based overwrite and content disclosure
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cd ~/.openclaw/workspace/skills/mp-draft-push # 进入技能目录
cp .env.example .env
编辑 .env:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 微信公众号草稿箱发布工具 - 辅助脚本
# 使用方法: source scripts.sh
# 通过环境变量提供(推荐:使用 .env + `set -a; source .env; set +a`)
require_cmd() {
command -v "$1" >/dev/null 2>&1 || {
The README describes the skill entirely in Chinese and states its purpose in Chinese without indicating that other languages are supported. Under the policy criteria, forcing a specific language or locale without user opt-in is a natural-language policy violation unless a justified region-specific constraint is documented.
The skill invokes shell capabilities (bash, curl, jq, source ./scripts.sh) and performs networked publication actions, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of unintended or over-privileged execution, especially because the skill accepts caller-supplied content and file paths and may download or upload external resources during execution.
The trigger phrases are broad enough to match common publishing requests such as '发布文章' or '推送到公众号', which could cause the skill to activate in situations where the user did not intend immediate draft publication. Because the skill performs an external side effect—uploading content to a WeChat public account—mis-triggering can lead to accidental data disclosure or unauthorized publication workflows.
The natural-language description and operational instructions are presented entirely in Chinese and imply Chinese-specific interaction behavior, while also including only a limited English trigger phrase. There is no indication that users can choose their language or that the Chinese-only behavior is an intentional, documented locale restriction.
The script places WECHAT_SECRET directly in the URL query string when requesting a token. Query parameters are commonly captured by shell history, proxy logs, monitoring tools, and web server logs, increasing the chance of credential exposure even though the destination is legitimate.
require_cmd jq || return 1
require_env WECHAT_APPID || return 1
require_env WECHAT_SECRET || return 1
curl -s "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${WECHAT_APPID}&secret=${WECHAT_SECRET}" \
| jq -r '.access_token'
}
This shell script sends the WECHAT_APPID and WECHAT_SECRET environment variables to a remote API endpoint to obtain an access token. Although the function name and comments describe token retrieval, there is no explicit user-facing warning, confirmation, or disclosure that sensitive credentials will be transmitted over the network.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
local token=$1
local image_path=$2
curl -s -X POST \
"https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=${token}&type=image" \
-F "media=@${image_path}"
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
local token=$1
local image_path=$2
curl -s -X POST \
"https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=${token}&type=image" \
-F "media=@${image_path}"
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
require_cmd curl || return 1
local token=$1
local json_file=$2
curl -s -X POST \
"https://api.weixin.qq.com/cgi-bin/draft/add?access_token=${token}" \
-H "Content-Type: application/json" \
-d @"${json_file}"
The natural-language descriptions and user-facing output are written only in Chinese, which imposes a specific language without any opt-in or alternative. The policy requires flagging language or locale constraints unless the skill offers a choice or clearly documents a justified region-specific limitation.
No suspicious patterns detected.