T09 · Insecure Skill Coding Practices
- Location
wechat_api.py:105- Finding
WeChat Access Token Stored in a Plaintext Cache File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is mostly a real WeChat publishing skill, but it needs Review because some bundled tests and helper scripts can perform live account-changing actions unexpectedly and credential handling is under-scoped.
Install only if you are comfortable granting it WeChat publishing credentials and image-provider API keys. Before use, remove or quarantine live tests, avoid running pytest against production credentials, disable or document browser automation, use a test WeChat account first, store tokens in a credential manager instead of .token_cache, and upgrade the image-processing dependency.
wechat_api.py:105WeChat Access Token Stored in a Plaintext Cache File
tests/test_debug.py:45Test Module Performs Live External Account Operations During Import
image_gen.py:107Configurable Image Provider Endpoints Receive Production API Credentials Without Origin Validation
publish.py:230User-Supplied Article HTML Is Rendered Without the Declared Sanitization Controls
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"appid": APPID,
"secret": APPSECRET
}
resp = requests.get(url, params=params)
data = resp.json()
if "access_token" in data:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
url = "https://api.weixin.qq.com/cgi-bin/get_api_quota"
params = {"access_token": token}
data = {"cgi_path": "/cgi-bin/draft/add"}
resp = requests.post(url, params=params, json=data)
result = resp.json()
if "quota" in result:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
f.write(encrypted)
import keyring keyring.set_password("wechat_mp", "access_token", self._access_token)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
f.write(encrypted)
import keyring keyring.set_password("wechat_mp", "access_token", self._access_token)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
f.write(encrypted)
import keyring keyring.set_password("wechat_mp", "access_token", self._access_token)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
f.write(encrypted)
import keyring keyring.set_password("wechat_mp", "access_token", self._access_token)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
f.write(encrypted)
import keyring keyring.set_password("wechat_mp", "access_token", self._access_token)
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The documented API surface goes beyond simple article drafting and publishing by advertising functions like publish_all and by referencing broader account operations in the core API wrapper description, while the high-level skill description frames the tool more narrowly as a publishing utility. Capability overreach in a content-publishing skill is dangerous because it may grant access to audience/account data or enable mass actions beyond what a user expects when invoking a publishing task.
The manifest describes a tool for publishing WeChat articles via official APIs with image selection, template rendering, and draft/publish modes. This file instead reads and rewrites local .log files to redact tokens, media IDs, draft IDs, and image URLs, which is a separate maintenance/sanitization function not reflected in the stated skill behavior.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
]
# 需要检查的文件扩展名
TARGET_EXTENSIONS = {'.py', '.json', '.yaml', '.yml', '.md', '.txt', '.env'}
# 需要跳过的目录
SKIP_DIRS = {'venv', '__pycache__', '.git', 'node_modules', '.venv'}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
]
# 需要检查的文件扩展名
TARGET_EXTENSIONS = {'.py', '.json', '.yaml', '.yml', '.md', '.txt', '.env'}
# 需要跳过的目录
SKIP_DIRS = {'venv', '__pycache__', '.git', 'node_modules', '.venv'}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 读取各图片源详细配置
providers_config = self.config.get('providers', {})
# 加载环境变量(支持 .env 文件)
from dotenv import load_dotenv
load_dotenv()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 读取各图片源详细配置
providers_config = self.config.get('providers', {})
# 加载环境变量(支持 .env 文件)
from dotenv import load_dotenv
load_dotenv()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 读取各图片源详细配置
providers_config = self.config.get('providers', {})
# 加载环境变量(支持 .env 文件)
from dotenv import load_dotenv
load_dotenv()
The skill metadata and file header claim an official-API-based publishing tool, but the implementation instead automates the WeChat admin web UI through a browser. This is dangerous because users may grant trust, credentials, and permissions under a false security model; UI automation is more brittle, may violate platform expectations, and can perform unintended state-changing actions in an authenticated session.
Pillow 10.2.0 is a true vulnerable dependency with multiple image-parsing and related advisories. This skill explicitly supports intelligent image handling, so untrusted or remotely sourced images are likely part of normal operation, which increases the chance that malformed image inputs could trigger denial of service, memory corruption, or other parser-level issues.
No suspicious patterns detected.