T09 · Insecure Skill Coding Practices
- Location
scripts/download_wechat_video.py:95- Finding
Unrestricted URL Handling Enables Server-Side Request Forgery
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears intended to download WeChat article videos, but its URL and output-file handling are too broad for that purpose.
Review this before installing if you expect strict WeChat-only behavior. Use it only with trusted mp.weixin.qq.com article links, avoid passing absolute or traversal output paths, and prefer a patched version that restricts allowed hosts, blocks private-network targets and redirects, confines downloads to a dedicated folder, and refuses overwrites by default.
scripts/download_wechat_video.py:95Unrestricted URL Handling Enables Server-Side Request Forgery
scripts/download_wechat_video.py:168Caller-Controlled Output Path Allows Arbitrary Writable-File Overwrite
The entire skill description is written in Chinese, including operational instructions and warnings, with no indication that other languages are supported or that Chinese is a required locale for compliance or regional scope. Under the policy for natural-language violations, forcing a specific language without user opt-in is a reportable issue.
The skill invokes shell commands and a local Python script but declares no explicit tool scope or permission boundaries. In an agent environment, this can enable broader-than-expected command execution, making accidental or unsafe invocation easier and reducing auditability of what the skill is allowed to do.
The trigger phrase includes the very broad term '下载视频', which can match many unrelated user requests and cause this skill to activate unexpectedly. Because the skill performs shell execution and downloads remote content, mis-triggering increases the chance of unintended network access, file writes, or use on non-WeChat URLs if routing is imperfect.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
else:
cmd.append(f"--{key}={value}")
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print(f"浏览器命令失败:{result.stderr}")
return None
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
]
print(f"开始下载视频到:{output_path}")
result = subprocess.run(cmd)
if result.returncode == 0:
file_size = os.path.getsize(output_path)
No suspicious patterns detected.