T09 · Insecure Skill Coding Practices
- Location
generate_fullplan.py:354- Finding
Unsanitized Project Name Allows Output Path Traversal and Arbitrary File Overwrite
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a straightforward Chinese interior-design Markdown generator, but its output filename handling can write outside the intended Desktop location and overwrite writable files.
Review before installing. Use only trusted project names without slashes, backslashes, leading dots, or path-like text, and be aware it may overwrite an existing generated file. The safer fix is to sanitize the project name, force the resolved output to remain inside Desktop, and avoid silent overwrites.
generate_fullplan.py:354Unsanitized Project Name Allows Output Path Traversal and Arbitrary File Overwrite
The title and output requirements indicate the skill is designed around Chinese-language usage and specifically states the output should conform to domestic Chinese residential/commercial standards. There is no indication that users can choose another language or locale, which can violate a language/locale policy requiring opt-in or explicit justification.
The docstring says this is an '室内设计全案方案自动生成器' that generates output '按照隐室空间设计标准规范'. In practice, the script collects manual input, inserts preset text, and leaves major sections such as structure analysis, lighting analysis, traffic analysis, problem optimization, layouts, and construction extras blank at L311-L315 and L327-L354, which contradicts the claim of automatically generating a full standards-based plan.
The natural-language interface and generated content are fixed to Chinese, including prompts and template text, with no indication that the user can select another language. This can violate language/locale policy when a skill forces a specific language without user opt-in or justification.
The output filename is derived directly from untrusted user input (project) and then passed to open() for writing. If the project name contains path separators or traversal sequences, os.path.join can produce a path outside the intended Desktop directory, enabling overwrite of arbitrary files writable by the current user.
)
output_path = os.path.join(os.path.expanduser("~/Desktop"), f"{project}_全案方案.md")
with open(output_path, "w", encoding="utf-8") as f:
f.write(content)
print(f"✓ 全案方案已生成: {output_path}")
This code performs a file write to a user-visible location, creating or overwriting a file named from user input on the Desktop. Although it prints a success message afterward, there is no advance disclosure or confirmation before the write occurs.
The description and tags are written in Chinese and the keyword list explicitly includes "chinese", which suggests the skill may be intended to operate in a specific language/locale. The manifest does not state that users can choose another language or that the Chinese-only scope is required for a region-specific purpose.
No suspicious patterns detected.