T09 · Insecure Skill Coding Practices
- Location
scripts/publish_article.py:80- Finding
Configurable API origin can disclose WeChat credentials and publishing data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its WeChat draft-publishing purpose, but it needs review because it handles account secrets and local media with weak endpoint validation and token-cache protections.
Install only after reviewing and controlling config.json. Keep apiBaseUrl fixed to https://api.weixin.qq.com, protect config.json and .tokens with owner-only permissions, avoid running scheduled workflows without review, and check which local images will be uploaded before creating drafts.
scripts/publish_article.py:80Configurable API origin can disclose WeChat credentials and publishing data
scripts/publish_article.js:102Node.js client trusts a configurable destination for secrets, tokens, and publishing data
scripts/publish_article.py:103Python access-token cache is written without restrictive permissions or account isolation
scripts/publish_article.js:115Node.js access-token cache relies on ambient filesystem permissions
SKILL.md:27Installation instructions use unpinned third-party dependencies without integrity verification
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## 功能
- 自动获取和缓存 Access Token
- 创建图文草稿到微信公众号
- 上传封面图片到素材库
- **自动上传正文图片并替换 URL**
The script writes the access token to a local JSON cache file without setting restrictive file permissions or using OS-backed secret storage. If the working directory is shared, backed up, committed accidentally, or readable by other local users/processes, the token could be stolen and used to access or act on the associated WeChat account until expiry.
expires_at: this.tokenExpiry
}, null, 2));
console.log(`✅ Access Token 获取成功`);
return this.accessToken;
}
The script persists the WeChat access token in plaintext to a local cache file without enforcing restrictive permissions or secure storage. If the host is multi-user, the working directory is shared, or filesystem access is compromised, another local process or user could reuse the token to act against the associated WeChat account until expiry.
'expires_at': self.token_expiry
}, f)
print(f"✅ Access Token 获取成功")
return self.access_token
async def upload_image(self, image_path: str, is_thumb: bool = False) -> dict:
The skill describes capabilities that read local files, write token caches/config-related data, and make network calls, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent environment this increases the chance of over-broad execution, unintended file access, or invocation with more privileges than the skill actually needs.
The trigger language is broad enough that an agent may activate the skill on loosely related publishing or content-formatting requests without clear user intent to publish. Because this skill can create drafts and drive external publication workflows, accidental invocation could expose credentials, upload private images, or create unwanted content in a public channel.
The example requests expand the activation surface to common phrases about publishing, scheduling, formatting, and image handling, but they do not define boundaries for when the skill must not run. In practice, that can cause the agent to treat ordinary content-editing requests as authorization to upload files or prepare publication artifacts.
The skill promotes scheduled and automated publication workflows but does not prominently require a human approval gate before content affecting the公众号 is created or published. Automation against a public-facing account amplifies mistakes: a misfire, poisoned prompt, or bad upstream content source could lead to unauthorized or reputationally damaging posts.
The README documents automatic upload of local images embedded in article HTML to WeChat, but the workflow does not prominently warn users that local files will be transmitted to a third-party service. This creates a real privacy and data-handling risk because authors may unintentionally upload sensitive local images when processing HTML content.
The script's user-facing description and all CLI/output strings are in Chinese, which effectively imposes a specific language on users. There is no opt-in, language selection mechanism, or documented justification that this skill is intended only for a Chinese-only audience or region-specific compliance context.
The file’s natural-language interface and description are entirely in Chinese, starting with the module docstring "发布文章到微信公众号", and the CLI help/output strings throughout the script are also Chinese-only. Under the policy rule, this is a language/locale constraint presented without user opt-in or an explicit justification that the skill is limited to a Chinese-language audience.
The example configuration uses a Chinese account name string ("我的公众号") as the default visible value, which implies a specific language/locale preference. The file does not indicate that language is configurable by user choice or that the locale is intentionally region-specific, so it may conflict with a policy requiring language neutrality or opt-in.
Detected: suspicious.exposed_secret_literal