T09 · Insecure Skill Coding Practices
- Location
scripts/gen_html.py:29- Finding
Path Traversal Allows Unauthorized Local Image Disclosure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s news-report purpose is plausible, but its included generator has unsafe local file and link handling plus hard-coded output paths that should be reviewed before installation.
Review this skill before installing or running it. It is meant to fetch public Chinese tech news and write a local HTML report, but the bundled script should be patched to use user-configurable paths, validate image keys, allow only http/https article links, and avoid using untrusted JSON input without checks.
scripts/gen_html.py:29Path Traversal Allows Unauthorized Local Image Disclosure
scripts/gen_html.py:114Unvalidated URL Schemes Permit Unsafe Links in Generated Reports
{esc(text_sp)}
The skill fetches content from third-party sources (IT之家 RSS, 快科技 pages, and article pages) without warning the user about outbound network access. This is dangerous from a transparency and privacy perspective because execution may disclose network metadata, trigger unexpected external requests, or violate restricted-environment policies even if the underlying purpose is legitimate news aggregation.
The skill explicitly instructs downloading images and generating HTML files on the local filesystem, but it does not warn the user that running it will create directories and write output files. While this appears to be normal functionality for a report-generation skill rather than overtly malicious behavior, undisclosed filesystem modification can surprise users, overwrite existing artifacts, or violate execution-environment expectations.
The entire document is written only in Chinese and specifies Chinese/CJK-specific formatting rules, with no indication that users may opt into another language or that the skill is explicitly limited to a Chinese-language context. This can violate language/locale policy when a skill implicitly requires a specific language without user choice.
The script's docstring, HTML lang attribute, title, and visible page text are all fixed to Chinese-language output such as "科技资讯日报" and "zh-CN". The file does not indicate that this locale is optional, user-selectable, or required for a region-specific purpose.
The module docstring states the generated HTML will be output 'in the same directory' as the script or data context, but the code later replaces that computed path with a hard-coded workspace path. This is an active contradiction between documented behavior and actual file-write location, not merely omitted detail.
This code overrides the computed output location with a hard-coded workspace path and then writes the generated HTML file there. Although the module docstring mentions an output file, the actual forced destination differs from the earlier description and there is no confirmation prompt or inline warning near the write operation.