Back to skill

Security audit

软件设计文档生成

Security checks for vulnerabilities and agentic risk

Overview

The skill’s document-generation purpose is coherent, but it uses user/file-derived names in shell file operations and moves uploaded files without strong path-safety controls.

Install only if you are comfortable with the skill inspecting recent uploaded files, reading their contents, moving them into a project folder, and creating a document/code skeleton. Before use, require safe folder names, exact path confirmation, and preferably copy uploads instead of moving them.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:48
Finding
Command Injection and Path Traversal Through Unsanitized Workspace Names## Vulnerability Details **File Location**: `SKILL.md`, lines 48–49 and 169–170 **Vulnerability Type**: Unsanitized user-controlled input in shell commands **Risk Level**: High The skill asks the user to confirm or provide a folder or project name and subsequently interpolates that value into shell command templates. ```text mkdir -p /workspace/{文件夹名} mv /inbound/xxx.docx /workspace/{文件夹名}/ ``` A second affected command block constructs directories and files from the project and subdirectory names: ```text mkdir -p /workspace/{项目名}/{子目录} touch /workspace/{项目名}/docs/01-概述.md # 创建空文件 ``` ### Technical Analysis The placeholders for the folder name, project name, and subdirectory are used in shell commands without mandatory input validation, shell-safe argument handling, quoting, or canonical-path verification. At least the folder name can be directly selected or corrected by the user. If these templates are executed through a shell after direct substitution, shell metacharacters in a supplied name can be interpreted as command syntax rather than filename data. Separately, traversal sequences such as `../` or absolute paths can cause filesystem operations to escape the intended `/workspace` directory. User confirmation does not provide a security boundary because the user controls the value being confirmed. The instructions also do not require the agent to reject unsafe characters or verify the resolved destination. ### Attack Path 1. The attacker invokes the skill with an otherwise valid request to generate a design document. 2. When asked to confirm the proposed folder name, the attacker supplies a name containing shell syntax or path traversal components. 3. The agent inserts the supplied value into the documented `mkdir`, `mv`, or `touch` command. 4. If a shell executes the interpolated command, shell syntax can invoke an unintended command. If traversal is used, the resolved path can point outside `/workspa ...[truncated 866 chars]
Remediation
## Remediation Suggestions 1. Treat every user-selected folder, project, and subdirectory name as untrusted input. 2. Apply a strict allowlist for names, permitting only necessary letters, digits, spaces, underscores, and hyphens. Reject shell metacharacters, control characters, path separators, `.` and `..` path components, and absolute paths. 3. Resolve the destination to a canonical path and verify that it remains strictly below the designated workspace root before performing any operation. 4. Prefer structured filesystem APIs or dedicated file-operation tools that accept paths as discrete arguments rather than constructing shell command strings. 5. If shell commands cannot be avoided, pass values as separately quoted arguments, use `--` before path arguments, and never build a command by direct string substitution. 6. Generate an internal safe directory identifier when the requested display name is unsafe, while retaining the original name only as metadata. 7. Copy inbound documents instead of moving them unless destructive relocation is explicitly required and confirmed. 8. Add negative tests covering command separators, command substitution, leading option characters, absolute paths, traversal sequences, embedded newlines, and Unicode separator variants.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad enough to overlap with ordinary requests for writing or summarization, which can cause the skill to activate unintentionally. In this skill, unintended activation is more concerning because activation leads to filesystem enumeration and later file movement/reading behavior, increasing the chance of surprising data access or workspace modification without clear user intent.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to list inbound files, move them into a new workspace directory, and read their contents, but the description does not clearly disclose these side effects up front. This is dangerous because users may believe they are only requesting document generation while the skill performs potentially irreversible file operations and accesses uploaded content, creating risks to confidentiality, integrity, and user expectations.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
整个技能的触发条件、流程提示、确认话术和输出模板均固定为中文,没有说明可根据用户偏好切换语言。若组织要求默认遵循用户语言或提供语言选择,这种单一语言约束属于自然语言层面的策略风险。

Static analysis

No suspicious patterns detected.