T09 · Insecure Skill Coding Practices
- Location
templates/publish.mjs:210- Finding
Workspace Path Traversal Allows Arbitrary Local File Upload
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for WeChat publishing, but it includes a fallback script that can post live content automatically and can upload unintended local files referenced through crafted Markdown image paths.
Install only if you are comfortable reviewing and modifying the publishing script first. Default to draft-only, add an explicit confirmation or mode check before formal publication, constrain image paths to the article directory, remove token-prefix logging, pin external dependencies, and run scheduled jobs under a least-privilege account with isolated directories and protected logs.
templates/publish.mjs:210Workspace Path Traversal Allows Arbitrary Local File Upload
templates/publish.mjs:379Fallback Publisher Bypasses Draft-Only Mode and Automatically Publishes Content
templates/publish.mjs:176WeChat Access-Token Material Is Exposed Through Persistent Logs
references/environment-and-config.md:113Mutable Upstream Repository and Unpinned Package Installation Create Supply-Chain Risk
Referenced artifact was not completely inspected
node templates/publish.mjs
Referenced artifact was not completely inspected
node templates/publish.mjs
Referenced artifact was not completely inspected
node templates/publish.mjs
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### 1. Technical success
Examples:
- access token retrieved
- image upload succeeded
- draft submission succeeded
- `media_id` returned
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### 1. Technical success
Examples:
- access token retrieved
- image upload succeeded
- draft submission succeeded
- `media_id` returned
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
console.log('=== 微信公众号文章发布脚本 ===\n');
// 加载环境变量
const envPath = join(__dirname, '.baoyu-skills', '.env');
if (!existsSync(envPath)) {
console.error(`错误: 找不到 .env 文件: ${envPath}`);
process.exit(1);
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
<project-dir>/
├─ .baoyu-skills/
│ ├─ .env
│ ├─ baoyu-image-gen/
│ │ └─ EXTEND.md
│ └─ baoyu-cover-image/
The description says to use the skill whenever the user wants a 'complete reproducible公众号自动发文 skill', alongside broad workflow language covering setup, drafting, publishing, and scheduling. In a manifest-scoped trigger description, this lacks clear constraints or exclusion conditions and could cause unintended activation for general WeChat publishing or content-workflow requests.
The skill supports automatic formal publication to a live WeChat account but does not present a strong, up-front warning that this can immediately post user-visible content to a production audience. In an automation context, insufficient safety gating around live publication increases the risk of accidental posting, reputational damage, and unintended distribution of incorrect or sensitive content.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
This reference is primarily written in English, but several operational sections switch to Chinese, including setup guidance and proxy handling. That imposes a specific language on users without opt-in or justification, which matches the language/locale policy concern for natural-language content.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
WECHAT_APP_ID=fill_in_valid_value_in_target_environment
WECHAT_APP_SECRET=fill_in_valid_value_in_target_environment
GOOGLE_BASE_URL=https://api.ikuncode.cc/
GOOGLE_API_KEY=fill_in_valid_value_in_target_environment
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
WECHAT_APP_ID=fill_in_valid_value_in_target_environment
WECHAT_APP_SECRET=fill_in_valid_value_in_target_environment
GOOGLE_BASE_URL=https://api.ikuncode.cc/
GOOGLE_API_KEY=fill_in_valid_value_in_target_environment
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
- 轮询间隔:3 秒
- 最大轮询次数:30 次(共 90 秒)
- 超时处理:记录 `publish_id` 供后续手动查询,不视为发布失败
- 轮询接口:`GET https://api.weixin.qq.com/cgi-bin/freepublish/get?access_token=TOKEN`,POST body 包含 `publish_id`
## 归档格式
This file is primarily written in English, but lines L41-L64 abruptly switch to Chinese and include locale-specific guidance for WeChat/公众号 workflows. That imposes a language/locale constraint in the documentation without stating that the skill is China-specific or offering an alternative language, which fits the natural-language policy violation criteria.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### 微信 AppSecret 保护
AppSecret 泄露可导致公众号被完全控制(包括群发消息、修改配置等)。建议:
- `.env` 文件权限设为 `600`(仅所有者可读写):`chmod 600 .env`
- 不要将 `.env` 提交到版本控制,确保 `.gitignore` 包含 `.env`
- 定期轮换 AppSecret
This markdown file is in scope for natural-language policy checks. The instruction to draft a WeChat article body, combined with repeated Chinese-only examples and formatting conventions, constrains output to a specific language/locale without any stated opt-in or alternative, which can violate language-choice policy.
The template content is entirely written in Chinese and structurally directs the author to produce a Chinese article, but it does not indicate that this locale restriction is optional or limited to a justified region-specific use case. That creates a natural-language policy concern because the skill appears to enforce a specific language without user opt-in.
This manifest-style file defines behavior defaults but provides no indication of when the skill should activate, what inputs it applies to, or any exclusion conditions. For manifest files, missing trigger specificity can cause unintended invocation because the activation scope is left implicit.
Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal