T09 · Insecure Skill Coding Practices
- Location
SKILL.md:145- Finding
WeChat Credentials Exposed in Command-Line URL Parameters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill matches its WeChat publishing purpose, but it asks users to handle account credentials and can upload or publish content without enough safety guidance.
Install only if you intend this agent to help operate a WeChat public-account publishing workflow. Use test or least-privilege credentials, avoid pasting real secrets into shell commands, review all generated images and article HTML before upload, and require a separate human approval before any API publication step.
SKILL.md:145WeChat Credentials Exposed in Command-Line URL Parameters
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
适合:封面/缩略图
curl -s -X POST "http://localhost:3710/api/content/render" \
-H "Content-Type: application/json" \
-d '{"cover_word":"标签","cover_title":"标题","cover_description":"描述","cover_emoji":"🤖"}'
The skill explicitly instructs acquisition and use of an access token derived from AppID and secret, but it does not provide secure handling practices for these credentials. In command-line workflows, secrets and tokens are commonly exposed through shell history, process listings, pasted transcripts, or logs, making this a genuine credential-safety issue.
# 获取Access Token
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=YOUR_APPID&secret=YOUR_SECRET"
返回值中的access_token有效期2小时
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
适合:封面/缩略图
curl -s -X POST "http://localhost:3710/api/content/render" \
-H "Content-Type: application/json" \
-d '{"cover_word":"标签","cover_title":"标题","cover_description":"描述","cover_emoji":"🤖"}'
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
HTML=$(cat /tmp/custom_image.html | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
curl -s -X POST "http://localhost:3710/api/content/render-text"
-H "Content-Type: application/json"
-d "{"html":$HTML,"width":750,"height":1200}"
The skill instructs users to obtain and use WeChat API credentials and then transmit generated content and media to a third-party platform, but it does not include explicit safety guidance about secret handling, authorization, or data-sharing implications. This creates a real risk of accidental credential exposure and unintended exfiltration of user content to external services.
The skill directs content and credentials to the WeChat API, which is an external service boundary and therefore a real data-transmission risk. In context this is expected behavior, but it still needs explicit disclosure and consent because user content and authentication material leave the local environment.
# 获取Access Token
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=YOUR_APPID&secret=YOUR_SECRET"
返回值中的access_token有效期2小时
The skill directs content and credentials to the WeChat API, which is an external service boundary and therefore a real data-transmission risk. In context this is expected behavior, but it still needs explicit disclosure and consent because user content and authentication material leave the local environment.
# 获取Access Token
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=YOUR_APPID&secret=YOUR_SECRET"
返回值中的access_token有效期2小时
This step uploads local image files to WeChat's permanent media store using an access token, which is a real outbound data transfer to a third party. The risk is not maliciousness but that unpublished or sensitive images could be sent externally without adequate user awareness or controls.
ACCESS_TOKEN="获取到的token"
# 封面图
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$ACCESS_TOKEN&type=image" \
-F "media=@/tmp/cover.png"
# 详情图
This second media-upload endpoint sends detail images to WeChat, again crossing a trust boundary and publishing content to an external platform. If the images contain confidential information, the skill provides no guardrails to prevent accidental disclosure.
-F "media=@/tmp/cover.png"
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$ACCESS_TOKEN&type=image"
-F "media=@/tmp/detail.png"
Uploading a thumbnail to WeChat is another external transfer of local content governed by the same risks as the full-image uploads. Because the skill automates the workflow, users may not notice that media is being persisted on a third-party platform.
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=$ACCESS_TOKEN&type=thumb" \
-F "media=@/tmp/cover.png"
返回的media_id用于文章配置的thumb_media_id字段
Creating a draft sends the full article HTML and referenced image URLs to WeChat, which is a clear external transmission of potentially sensitive content. The danger is increased by the workflow's one-click framing, which can normalize sending unpublished material off-system without adequate review.
} EOF
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/draft/add?access_token=$ACCESS_TOKEN"
-H "Content-Type: application/json"
-d @/tmp/article.json
This step submits a draft for publication via WeChat, turning prior content transmission into an externally visible publishing action. The security impact is higher because misuse or accidental execution could cause unauthorized public release of content, reputational damage, or compliance issues.
curl -s -X POST "https://api.weixin.qq.com/cgi-bin/freepublish/submit?access_token=$ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"media_id":"草稿media_id","pub_choose_type":1}'
No suspicious patterns detected.