T01 · Skill Instruction Hijacking
- Location
SKILL.md:169- Finding
Mandatory Unrelated Source URL Injected into Published Articles
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This WeChat automation skill has a coherent purpose, but it needs Review because it can affect a real WeChat account while using under-scoped credential handling, URL fetching, and hardcoded attribution behavior.
Install only if you are comfortable giving this skill WeChat account authority to upload media, create and possibly publish drafts, read account/user/analytics data, and send content to third-party research or image services. Review or change the hardcoded source URL, avoid untrusted remote image URLs, restrict local credential-file permissions, and use narrowly scoped API keys where possible.
SKILL.md:169Mandatory Unrelated Source URL Injected into Published Articles
src/publish.py:254Server-Side Request Forgery Through Article Image URLs
src/skills/image_generator.py:258Shared API Credentials Can Be Forwarded to Unvalidated Provider Endpoints
src/first_time_setup.py:68WeChat AppSecret Stored Without Explicit Owner-Only Permissions
src/token_manager.py:78WeChat Bearer Access Token Cached Without Explicit Restrictive Permissions
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"api_key": api_key
}
resp = requests.post(url, json=payload, headers=headers, timeout=20)
if resp.status_code == 401:
raise ValueError("Tavily API Key 无效或已过期")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"api_key": api_key
}
resp = requests.post(url, json=payload, headers=headers, timeout=20)
if resp.status_code == 401:
raise ValueError("Tavily API Key 无效或已过期")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"TAVILY_API_KEY"
],
"alsoReads": [
".env"
]
},
"paths": {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"TAVILY_API_KEY"
],
"alsoReads": [
".env"
]
},
"paths": {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_credentials(self) -> Tuple[Optional[str], Optional[str]]:
"""
获取凭证 - 优先级:配置文件 > 环境变量 > .env
"""
app_id = None
app_secret = None
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_credentials(self) -> Tuple[Optional[str], Optional[str]]:
"""
获取凭证 - 优先级:配置文件 > 环境变量 > .env
"""
app_id = None
app_secret = None
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
class TokenManager:
"""Access Token 管理器"""
TOKEN_CACHE_FILE = Path.home() / ".cache" / "wechat-mp-auto" / "token.json"
The README advertises automatic draft publishing and network-based duplicate checking but does not clearly warn that article content may be transmitted to third-party services or pushed to a WeChat public account. In an AI-orchestrated skill, this is risky because users may trigger outbound data sharing or publication effects without realizing the operational consequences.
The skill is presented entirely as a WeChat public-account article automation skill in Chinese, and the workflow/prompt conventions prescribe Chinese article structure, labels, and examples without offering any user language choice. This can violate language/locale policy when a skill mandates a specific language by default rather than allowing opt-in or clearly documenting a justified locale restriction.
The skill instructs sending topics, generated content, images, and publication artifacts to third-party research, image, and WeChat services without an explicit user-facing warning or consent checkpoint. This creates a real data-handling risk because sensitive or proprietary article content may be transmitted externally unexpectedly.
The workflow directs the agent to call an undefined upload_thumb tool, creating an inconsistency between declared and expected capabilities. In practice, this can cause runtime failure, misrouting to an unintended similarly named tool, or unsafe fallback behavior by an orchestrating agent trying to satisfy the instruction.
This code reads sensitive credentials from environment variables and a local .env file, which is a safety-relevant operation under the warning criteria for code files. While there are internal log messages for successful reads, there is no docstring, comment, confirmation, or user-facing disclosure warning that the skill accesses stored secrets from these sources.
All user-facing messages and setup instructions in this file are hardcoded in Chinese, including status and prompt text. The file does not provide any language selection, fallback, or explanation that the skill is intentionally limited to a Chinese-speaking or region-specific audience.
The code stores app_secret in a plaintext JSON file under the user's home directory without any protection, permission hardening, encryption, or user warning. If the local system is compromised, backups are exposed, or file permissions are too broad, an attacker could recover the WeChat AppSecret and use it to access or abuse the associated account/API integration.
The module docstring and command descriptions are entirely in Chinese, and the tool presents its interface and status messaging in that locale only. This is a language/locale restriction in natural-language UX with no opt-in or alternative language path documented.
The script automatically downloads attacker-controlled external image URLs and re-uploads them using the publisher's WeChat credentials, without explicit consent or any allowlist. This creates unannounced outbound network access, can leak operational metadata/IP, and can be abused to make the system interact with arbitrary remote hosts or relay untrusted content through the publisher account.
The method sends analytics query data to a remote endpoint via self.post(...), and similar behavior appears again for user statistics retrieval. In this file there is no confirmation prompt, logging/print statement, or explanatory comment/docstring warning that article and user analytics data will be transmitted to an external API.
The call to self.post("/cgi-bin/analysis/get_user_summary", data) fetches user-summary analytics, which can be privacy-sensitive. This file does not include any visible warning, confirmation, or explanatory documentation telling the user that account/user analytics will be requested from a remote service.
This code file contains user-facing natural-language descriptions, docstrings, log messages, and error text entirely in Chinese, such as the module description and method documentation. Under the policy rule for language/locale, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy concern.
Natural-language strings, documentation, and user-facing messages in this file are exclusively in Chinese, with no indication that users may opt into another language or locale. Under the stated policy, forcing a specific language without user choice can be a policy violation unless clearly justified as region-specific.
No suspicious patterns detected.