T09 · Insecure Skill Coding Practices
- Location
scripts/generate_skill.py:142- Finding
Arbitrary File Overwrite Through Unrestricted Output Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a plausible expert-skill generator, but it needs review because it can process private documents and write persistent skill files without enough path, overwrite, or instruction-injection safeguards.
Install only after review. Run it in a limited workspace, provide only documents you intend to turn into skill material, avoid secrets or regulated data unless necessary, choose output paths carefully, and inspect every generated SKILL.md before installing or sharing it.
scripts/generate_skill.py:142Arbitrary File Overwrite Through Unrestricted Output Path
scripts/generate_skill.py:18Persistent Skill Instruction Injection Through Unsanitized Generated Content
该代码的核心功能是模板化生成SKILL.md文件,属于静态内容组装器。虽然与“自动生成专家Skill”这一大方向部分一致,但声明描述包含多项更强能力:数据采集、知识融合、提炼、验证、双Agent协作等,而代码中均未体现。代码也没有网络访问、外部知识读取、验证流程、Agent交互或推理编排逻辑。因此描述明显高于实际行为,存在实质性描述与行为不一致。
声明描述的是一个较完整的专家技能生成与知识加工工具链,而提供的代码片段只是其中非常有限的一步:文档解析与基于关键词的单标签分类。它没有生成任何Skill、没有执行多源知识融合、没有进行结构化框架提炼、质量校验或双Agent协作精炼。虽然代码与“用户私有知识”处理、以及“6维度”中的维度分类存在一定相关性,但其实际主功能与声明的整体能力范围相比明显更窄,属于实质性描述不符。
声明描述的是一个面向职业专家助手构建的综合生成工具,核心能力应包括知识采集、融合、提炼、生成与精炼。而提供的代码块只执行Skill目录结构与文档规范检查,属于狭义的格式/结构验证工具。虽然描述中提到“质量验证”,代码中的结构校验可被视为其中一个子环节,但该代码既不是生成器,也没有实现所宣称的大部分关键能力,因此主用途与实际行为存在明显不一致。
The skill describes reading user-provided files and generating/writing SKILL.md outputs, yet it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity: an agent may exercise file read/write capabilities more broadly than users expect, especially when private knowledge files and workspace paths are involved.
The trigger phrases are broad enough to match ordinary requests such as asking for advice or help in a domain, which can cause the skill to activate unexpectedly. In this skill, unexpected activation matters because it can lead to collection of private files, external research steps, and file-generation actions that the user did not clearly intend.
The skill explicitly encourages users to upload private knowledge files, but it does not present a clear warning about how those files will be processed, classified, retained, or exposed to downstream generation steps. Because the content may include sensitive proprietary or personal material, the lack of upfront disclosure increases the risk of unintended data exposure and misuse.
This markdown file is entirely framed in Chinese and describes the generated expert Skill's structure and behavior, but it does not indicate that language selection is optional or limited to a China-specific context. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy concern.
This markdown template hard-codes Chinese in the skill description and throughout the document structure, which can force a specific language on downstream skills created from it. The policy allows locale constraints only when users are given a choice or the constraint is explicitly justified, neither of which is present here.
The document explicitly gives highest priority to user private knowledge but does not define any safeguards for sensitive, personal, regulated, or confidential data handling. In a skill designed to ingest user-provided materials and synthesize expert knowledge, this omission can lead to over-collection, unsafe retention, or reuse of confidential content, especially when users upload internal documents, case materials, or regulated professional records.
This markdown file presents all guidance, headings, and examples exclusively in Chinese, which effectively forces a specific language for users consuming the skill content. The policy allows locale constraints only when users are given a choice or when the constraint is clearly documented and justified, neither of which appears here.
This markdown file contains natural-language instructions exclusively in Chinese and does not provide any user opt-in, alternative language option, or explanation that the skill is intentionally limited to a Chinese-speaking or region-specific context. Under the policy rules, forcing a specific language without user choice is a natural-language locale violation.
该 markdown 文档从标题开始即完全以中文编写,且全文未说明这是面向特定中文受众的区域化文档,也未提供语言选择或多语言选项。根据规则,若技能内容强制特定语言而没有用户选择或明确、合理的限定,属于自然语言层面的语言/区域政策问题。
The file presents the skill template entirely in Chinese and labels core template fields and headings accordingly, which implies a fixed language/locale for resulting skills. There is no opt-in, alternative language option, or explanation that this template is intended only for a Chinese-language or region-specific context.
The script hardcodes Chinese natural-language content throughout the generated SKILL.md and sets the expression style default to Chinese ('专业严谨'), which indicates a fixed language/locale behavior. The policy allows locale constraints only when the user opts in or the restriction is clearly documented and justified, neither of which is present here.
This Python file contains natural-language descriptions and outputs that assume Chinese as the required language, beginning with the module docstring and continuing throughout argument descriptions and result messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not present here.
The module docstring and all user-facing validation messages are written exclusively in Chinese, indicating the skill is designed to operate in a fixed language. The file does not offer any language/locale choice or explain that the tool is intentionally limited to a Chinese-only context, which matches the policy's language/locale violation criterion.
The examples show writing generated SKILL.md files to workspace paths, but the skill does not clearly warn users that invoking generation will create or overwrite files at specified locations. That omission can lead to unintended modification of project files, especially if the output path is user-controlled or defaults are broad.
This markdown file contains user-facing guidance exclusively in Chinese and does not indicate that the skill is intended only for Chinese-speaking users or provide any language/locale opt-in. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation.
This markdown file is entirely written in Chinese and presents the taxonomy as the reference to use in Phase 0, with no indication that other languages are supported or that Chinese is optional. Under the stated policy, a skill that effectively enforces a specific language without user opt-in is a natural-language policy concern.
This code writes generated content to a caller-specified path and creates parent directories if needed, but it does not prompt for confirmation or include any comment/docstring warning about possible overwrite or filesystem changes. For a code file, file-write behavior should have some visible disclosure unless it is explicitly documented as expected behavior in accompanying markdown, which is not present in this file.