Back to skill

Security audit

SDD Archive

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent manual archiving workflow, but it allows a custom feature path to reach a Bash move operation without clear validation and performs broad file changes without one final consolidated confirmation.

Review this skill before installing if your repository contains sensitive code or important spec files. Use it only on trusted feature directories, avoid the custom path option unless the path is clearly confined to spec/feature_*, and ask the agent to show a complete change plan before it writes files, generates images, deletes/merges domain docs, or moves the feature directory.

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:37
Finding
Unvalidated Custom Feature Path Reaches a Bash File Operation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 37–39 and 296–300 **Vulnerability Type**: Command injection and path traversal through unsafe path handling **Risk Level**: High ### Vulnerable Code Selection of an unrestricted custom path: ```markdown 4. 通过 `AskUserQuestion` 展示**最新的 3 个** feature 目录: - 每个选项显示目录名 - 用户可以通过 "Other" 输入自定义路径 - 所有问题文本用中文:"选择要归档的 feature:" 5. 读取选中 feature 的 `spec-design.md` ``` Use of the selected feature directory in a Bash operation: ```markdown ## Step 8: 执行归档 1. 如果不存在,创建 `spec/archive/` 目录 2. 移动整个 feature 目录:`spec/{feature_dir}/` → `spec/archive/{feature_dir}/` - 保留原始目录名 - 使用 Bash `mv` 命令 ``` ### Technical Analysis The skill permits the user to enter an arbitrary custom path through the “Other” option. It does not require the resulting path to be canonicalized, confined to `spec/`, or validated as a direct child directory whose name matches the expected `feature_*` pattern. The selected value is subsequently used to construct paths for reading feature files and is ultimately interpolated as `{feature_dir}` into a Bash `mv` operation. The instructions do not require shell-safe argument handling, quoting, use of `--`, or rejection of shell metacharacters. This creates two related attack surfaces: 1. **Path traversal:** Values containing `..`, absolute paths, or separators may escape the intended `spec/feature_*` scope and cause unrelated accessible files to be read or moved. 2. **Command injection:** If an implementing agent inserts the custom value directly into a shell command as instructed, shell metacharacters such as command substitutions, separators, or redirections may be interpreted by Bash. Successful shell injection depends on the exact command generated by the executing agent. However, the skill explicitly combines unrestricted path input with a Bash command and provides no mandatory validation or escaping controls. ### Attack Path 1. An attacker or untrusted user invok ...[truncated 1505 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Eliminate unrestricted path input** - Prefer selection only from directories discovered by the skill. - If custom selection is required, accept only a directory basename rather than an arbitrary path. 2. **Apply strict allowlist validation** - Require the basename to match a conservative pattern such as `^feature_[A-Za-z0-9._-]+$`. - Reject absolute paths, `..`, path separators, null bytes, control characters, newlines, and shell metacharacters. - Reject symbolic links unless they are explicitly required and safely resolved. 3. **Canonicalize and enforce containment** - Resolve both the selected source and intended archive destination to canonical paths. - Verify that the source is a direct child of the canonical `spec/` directory. - Verify that the destination is a direct child of the canonical `spec/archive/` directory. - Abort if either resolved path escapes its approved parent directory. 4. **Avoid shell execution** - Use a structured filesystem move API that accepts source and destination as separate path values. - Do not build a shell command by concatenating or interpolating user-controlled strings. 5. **Harden Bash use if it is unavoidable** - Pass validated paths as separately quoted arguments. - Use `mv -- "$source" "$destination"` so option-like path values cannot be interpreted as flags. - Do not use `eval`, command substitution, or a dynamically assembled command string. 6. **Validate archive state** - Require the source to exist and be a directory. - Require `spec-design.md` to be a regular file inside the validated source directory. - Refuse to overwrite an existing archive destination without explicit confirmation. - Revalidate paths immediately before the move to reduce symbolic-link and time-of-check/time-of-use risks. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
文件多处要求交互文本必须为中文,例如选择提示使用中文,且规则区明确规定“所有用户-facing 信息用中文”。这属于语言/locale 强制约束,但文档未说明用户可选择其他语言,也未给出需要中文的合规性或地域性理由。

Missing User Warnings

Medium
Confidence
95% confidence
Finding
技能会连续执行多步高副作用操作:修改多份全局文档、可能覆盖图片文件,最后移动整个 feature 目录,但缺少一次覆盖所有变更的统一最终确认。用户即使在前面确认了摘要或局部更新,也未必意识到最终将发生的完整写入与移动结果,容易导致误归档、数据丢失、错误知识库更新或不可预期的大范围文件变更。

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
该技能在归档主流程中引入了 `/gen-image` 调用,属于与核心文档归档无关的扩展能力。它会产生额外副作用(生成并覆盖图片文件、消耗资源、触发另一技能链),扩大了攻击面;如果提取出的描述中混入敏感内容,还可能被带入图像生成提示,造成不必要的数据外发或资源滥用。

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
L395 明确写明“所有用户-facing 信息用中文”,这是对交互语言的硬性规定。根据规则,强制特定语言而没有用户 opt-in 或充分的区域化理由,应视为自然语言策略违规。

Static analysis

No suspicious patterns detected.