T09 · Insecure Skill Coding Practices
- Location
scripts/generate_report.py:140- Finding
Windows Path Traversal Through Unsanitized Project Name
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mainly a Chinese real-estate report helper, but it writes generated reports to a hard-coded local path and sends project context to web search without clear user control.
Review this skill before installing in a sensitive business environment. Avoid using confidential deal names or internal project identifiers with its web-search workflow unless you are comfortable sending that context to external search providers, and do not run the report script until its output directory, filename sanitization, and HTML escaping are fixed.
scripts/generate_report.py:140Windows Path Traversal Through Unsanitized Project Name
scripts/generate_report.py:109HTML Injection Through Unescaped Project Name
').replace('\n- ', '
报告日期:{datetime.now().strftime('%Y.%m.%d')}
{html_body} """ ``` ### Technical Analysis The user-controlled `project_name` is interpolated directly into the HTML document without context-appropriate escaping. It is inserted into both the `` element and the document body. The same value is also incorporated into the Markdown report and then processed by a series of string replacements that do not sanitize HTML. Consequently, HTML metacharacters and active elements remain intact. An attacker can supply a project name containing closing tags and malicious HTML. Depending on the browser and local-file security policy, this can result in script e ...[truncated 1219 chars]The declared description presents this as a substantive professional skill for early-stage real-estate strategic analysis, including feasibility judgment, competitor analysis, product positioning, investment risk checks, and customer research. The supplied code does not implement those capabilities. Instead, it generates a preformatted report skeleton with placeholder fields and saves it locally as Markdown and/or HTML. There is no ingestion of project data, no market/competitor/customer analysis, no risk assessment logic, and no decision-making methodology beyond static text. Additionally, the code advertises Word/PPT support in the module docstring but does not implement those formats. The local file-writing behavior is also undeclared. Therefore, the description materially overstates what the code actually does.
The skill advertises generation of Word/PPT/PDF outputs and references scripts that create files, but it does not declare any explicit tool scope or permissions boundaries. In practice, undeclared file-write capability can lead to outputs being written to local storage without user awareness or policy enforcement, which is risky in an enterprise workflow handling potentially sensitive project materials.
The manifest states the skill activates when the user provides '项目名称+城市', which is a very common input pattern in many real-estate or research conversations and is not specific to this skill's intended task. Without narrower constraints or exclusion examples, this could cause unintended invocation outside explicit产策定位/竞品分析 requests.
The skill states that it will proactively perform web searches for planning, policy, competitors, and customer trends, but it does not warn users that project-related context may be sent to external services. For a real-estate pre-investment strategy skill, this can expose confidential deal intent, location targets, and internal research topics to third-party providers or logs.
The manifest description is entirely in Chinese and presents the skill as operating in that language, with no indication that users may choose another language or locale. This can violate language/locale policy when the skill effectively assumes a fixed language without explicit opt-in or documented regional justification.
The docstring, prompts, and user-facing output are entirely in Chinese, and the skill does not indicate that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. This is a natural-language policy concern because it imposes a specific language on users without opt-in.
The top-level docstring explicitly advertises support for Markdown, HTML, Word, and PPT. The rest of the file provides no Word or PPT generation or saving logic, so the documentation actively contradicts the code's real capabilities rather than merely omitting detail.
The file description and generated report content are entirely fixed in Chinese, and the HTML output explicitly sets lang="zh-CN". Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.
The module docstring states '支持 Markdown / HTML / Word / PPT', implying four output formats. However, the implemented generation and save paths only handle Markdown and HTML, and the CLI only exposes markdown/html/all modes, so the documented behavior materially overstates actual functionality.
The script writes output to a hard-coded desktop path on a specific local user profile, causing data to be written outside any caller-controlled workspace or sandbox. In an agent/skill context, this can leak generated reports containing potentially sensitive project information to an unintended host location, create privacy/compliance issues, and make behavior non-portable and hard to audit.
This markdown file presents the skill/reference content only in Chinese and does not indicate that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.
No suspicious patterns detected.