T09 · Insecure Skill Coding Practices
- Location
scripts/wx-publish.js:29- Finding
WeChat Access Token Stored Without Explicitly Restrictive Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a WeChat publishing helper, but it includes under-scoped draft deletion, account-token handling, dependency, and local-record update behaviors that users should review before installing.
Review this skill before installing if it will use a real WeChat account. It needs WeChat credentials and can create, publish, list, and delete drafts; avoid running the rebuild script unless you understand the hardcoded media IDs and paths. Store ~/.config/wx-mp securely, tighten token-file permissions, and prefer a consistent HTTPS lockfile before use.
scripts/wx-publish.js:29WeChat Access Token Stored Without Explicitly Restrictive Permissions
scripts/package-lock.json:6Dependency Lockfile Uses an Insecure Source and Conflicts With the Package Manifest
The documented purpose and the detected behavior do not align: the skill claims a narrow Markdown-to-WeChat publishing workflow, while the surfaced capabilities/functions suggest additional operations and omit some advertised processing steps. This mismatch is dangerous because users and orchestrators may grant trust or permissions based on the description, while the actual implementation can perform different state-changing actions such as deletion or broader publication helper behavior.
Referenced artifact was not completely inspected
`wx-publish.js` 内置自动去除:`content.replace(/^---\n[\s\S]*?\n---\n/, '')`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
});
}
// ── Access Token ─────────────────────────────────────────
async function getToken() {
const cache = loadTokenCache();
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
});
}
// ── Access Token ─────────────────────────────────────────
async function getToken() {
const cache = loadTokenCache();
The skill documents command execution and environment-dependent behavior but does not declare an explicit tool scope such as allowed-tools or permissions. That makes the execution boundary ambiguous, increasing the chance an agent invokes shell or environment access beyond what a user would reasonably expect from a publishing skill.
The skill description and invocation scope are entirely framed around publishing WeChat public-account articles in Chinese, and later sections prescribe fixed Chinese wording and formatting. This creates a locale/language constraint without explicitly offering the user a choice or documenting an opt-in, which matches the policy category for language/locale violations.
The skill expands from article publishing into research, article drafting rules, and maintenance of local knowledge and analytics files. This broadens the operational scope from a bounded publishing task into data collection and persistent local modification, which can lead to unintended access or writes unrelated to the user’s immediate request.
The documentation instructs the agent to use web_search for fact-checking even though the stated skill purpose is publishing to WeChat. Unnecessary networked research increases attack surface, may expose user topics or drafts to external services, and grants the skill a broader capability than users would infer from a publishing tool.
The skill directs maintenance of local fact files and article metadata beyond the narrow publication workflow. Persistent writes to local knowledge bases can alter user data, create integrity issues, and leak or entrench information unrelated to the current publication request.
The instructions describe updating article-tracker.json and other local records without a clear warning that the agent will modify user data. Silent or implicit persistent writes are risky because they can change records unexpectedly, introduce incorrect analytics, or normalize broader file modification behavior under a publishing skill.
The title and entire guidance are framed specifically for WeChat Official Account publishing in Chinese, and the document does not offer any language or locale choice. Because the policy category covers language/locale constraints, this reads as a forced locale/language assumption rather than an explicit opt-in.
The manifest describes a publishing skill that converts Markdown and publishes drafts to a WeChat public account, but it does not mention reading secrets from local configuration files or token caches in the user's home directory. While network publication is expected, credential harvesting from dot-config paths is a separate capability that should be explicitly declared if part of the skill's intended behavior.
The script deletes existing WeChat drafts via /draft/delete before recreating them, but the skill description only promises publishing, Markdown conversion, cover upload, and draft creation. This hidden destructive capability can remove user content unexpectedly if the mapping is wrong, stale, or manipulated, causing data loss and violating user expectations for a publishing tool.
The manifest describes Markdown-to-WeChat publishing features such as conversion, cover upload, draft creation, publish submission, and error handling. This file also exposes management operations to enumerate existing drafts and delete drafts, which are not mentioned in the stated skill scope and go beyond the described publishing flow.
The del-draft command performs an irreversible destructive action immediately after receiving a media_id, with no confirmation prompt, dry-run mode, or safety interlock. In an agent/automation context, a mistaken argument, prompt-injected instruction, or operator misunderstanding could silently delete legitimate draft content.
The dependency uses a caret range (^12.0.0), which permits automatic installation of newer 12.x releases rather than a single vetted version. In a publishing skill that converts untrusted Markdown to HTML, unexpected upstream changes or a compromised package release could alter parsing behavior or introduce a supply-chain issue, though this file alone does not show active exploitation.
"version": "1.0.0",
"description": "微信公众号发布脚本",
"dependencies": {
"marked": "^12.0.0"
}
}
This markdown file presents all user-facing content exclusively in Chinese, and there is no indication that the user opted into that language or that the skill is intended only for a Chinese-language audience. Under the language/locale policy rule, forcing a specific language without opt-in can be a natural-language policy violation.
The script hard-codes toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) and all user-facing CLI messages are in Chinese, which forces a specific language/locale behavior without opt-in. This can violate language/locale policy where tools are expected to respect user preferences or provide a choice.
Detected: suspicious.exposed_secret_literal