Back to skill

Security audit

Auto Create Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to create and edit reusable agent skills, but it needs Review because it can persistently modify skill directories and uses broad triggers plus unsafe shell-style command templates.

Install only if you intentionally want an agent to create and modify persistent skills. Before enabling generated skills, review their triggers, paths, AUTO steps, and any shell or Git commands; require explicit confirmation for writes, deletes, commits, pushes, and installation into agent skill directories.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:100
Finding
Command Injection and Path Traversal Through Unvalidated Skill Names<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:100-103` **Vulnerability Type**: OS command injection and arbitrary file-path manipulation **Risk Level**: High ### Vulnerable Code ```bash mkdir -p $SKILL_DIR/<skill-name> cat > $SKILL_DIR/<skill-name>/SKILL.md << 'SKILL_EOF' <Skill content> SKILL_EOF ``` ### Technical Analysis The workflow instructs the agent to substitute a user-influenced skill name directly into shell commands. Although the documentation says skill names should use kebab-case, it does not require validation before command construction. The destination path is also unquoted. A crafted value containing shell metacharacters, command substitutions, whitespace, path separators, or traversal sequences could change the meaning of the generated command. For example, shell control operators could append another command, while `../` sequences could direct the file write outside the intended skill directory. Because these commands are intended to be executed by the agent, exploitation occurs with the operating-system permissions assigned to the agent process. ### Attack Path 1. An attacker asks the agent to create a workflow and supplies a malicious skill name. 2. The skill accepts or derives that name without applying a mandatory allowlist. 3. The agent replaces `<skill-name>` in the documented shell sequence. 4. The shell interprets attacker-controlled metacharacters or traversal components. 5. The injected command executes, or `SKILL.md` is written outside the intended skill directory. The attack depends on the agent following the documented shell-based creation procedure without independently sanitizing the value. ### Impact Assessment Successful exploitation could: - Execute arbitrary shell commands with the agent's privileges. - Create or overwrite files writable by the agent. - Write persistent skill instructions outside the intended destination. - Corrupt other skills or agent configuration files. - Expose or modify ...[truncated 238 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce the documented kebab-case requirement before any filesystem or shell operation: ```python import re if not re.fullmatch(r"[a-z0-9]+(?:-[a-z0-9]+)*", skill_name): raise ValueError("Invalid skill name") ``` 2. Explicitly reject path separators, `..`, control characters, whitespace, shell metacharacters, and command-substitution syntax. 3. Build the destination with a filesystem API, resolve it to a canonical path, and verify that it remains beneath the approved skill root: ```python from pathlib import Path root = Path(skill_dir).resolve() destination = (root / skill_name / "SKILL.md").resolve() if root not in destination.parents: raise ValueError("Destination escapes the skill directory") destination.parent.mkdir(parents=True, exist_ok=True) destination.write_text(skill_content, encoding="utf-8") ``` 4. Prefer direct filesystem APIs over shell-generated `mkdir` and heredoc commands. 5. If shell execution is unavoidable, pass values as separate process arguments without `shell=True`; do not concatenate user-derived values into command strings. 6. Refuse to overwrite an existing skill unless the user explicitly confirms the canonical destination. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/workflow-skill-template.md:214
Finding
Command Injection Through Unvalidated Workflow Parameters in Generated Git Commands<![CDATA[ ## Vulnerability Details **File Location**: `references/workflow-skill-template.md:214-225` **Vulnerability Type**: OS command injection through generated Git workflow commands **Risk Level**: High ### Vulnerable Code ```bash # Create and switch to the bugfix branch git checkout -b bugfix/{jira_id} # Add modified files git add <modified files> # Commit with a message containing the Jira ID git commit -m "fix({jira_id}): <brief description of the BUG title>" # Push to the remote git push origin bugfix/{jira_id} ``` ### Technical Analysis The template places workflow parameters directly into executable shell commands. The `jira_id`, modified-file list, and bug-title-derived commit message can originate from user input or external issue data, but the template does not require validation or safe process invocation. The branch commands use `{jira_id}` as an unquoted shell token. If the generated workflow substitutes a value containing shell control operators, command substitutions, whitespace, or option-like content, the resulting shell command can be altered. The commit message is enclosed in double quotes, which do not prevent shell command substitution such as `$(...)` or backtick expressions. Consequently, malicious issue-title content incorporated into the placeholder could be evaluated by the shell when the agent executes the generated command. The `git add <modified files>` pattern is also unsafe if implemented by joining attacker-influenced paths into one shell command. Crafted filenames could be interpreted as command syntax or Git options. ### Attack Path 1. An attacker supplies a crafted Jira ID, issue title, or filename through the workflow input or an issue record consumed by the generated skill. 2. The generated skill substitutes that content into the template's Git command strings. 3. The agent executes the resulting strings through a shell. 4. The shell evaluates injected control operators or command-substitution syntax. 5. Arb ...[truncated 843 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate Jira identifiers against the organization's exact format, for example: ```python if not re.fullmatch(r"[A-Z][A-Z0-9]+-[1-9][0-9]*", jira_id): raise ValueError("Invalid Jira ID") ``` 2. Construct branch names from validated data and additionally check them with `git check-ref-format --branch`. 3. Execute Git without a shell and pass every value as a separate argument: ```python subprocess.run( ["git", "checkout", "-b", branch_name], check=True, shell=False, ) subprocess.run( ["git", "commit", "-m", commit_message], check=True, shell=False, ) subprocess.run( ["git", "push", "origin", branch_name], check=True, shell=False, ) ``` 4. Pass `--` before file paths and provide each path as a distinct argument: ```python subprocess.run(["git", "add", "--", *validated_paths], check=True) ``` 5. Resolve file paths and verify they belong to the expected repository before staging them. 6. Treat issue titles and other external metadata as untrusted data. Never interpolate them into shell command strings, even when surrounded by double quotes. 7. Preserve the existing user-confirmation checkpoint immediately before commit and push, showing the validated branch, staged files, commit message, and remote destination. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
声明描述的是一个高层自动化 Skill 生成与编辑器:应能根据对话抽取工作流、创建 Skill,并修改 Skill 的流程结构。实际代码只是一个注册表管理脚本,负责在几个候选路径中选择可写 JSON 文件,并维护 Skill 条目的元数据。虽然其中的 list 和部分 update 能力与“列出已创建 skill”“更新某个 skill 的描述/参数/路径”有一定相关性,但核心功能明显缺失:没有任何会话分析、工作流抽取、Skill 文件生成、步骤级流程编辑或自动化逻辑。因此描述与代码行为存在实质性不匹配。

Vague Triggers

High
Confidence
96% confidence
Finding
The trigger conditions are broad enough to activate on ordinary discussion about repetitive work or automation, causing the skill to run in contexts where the user did not intend persistent skill creation or modification. Because this skill can write files and maintain a registry, accidental activation can lead to unwanted state changes and persistence.

Ae1

High
Category
analysis-evasion
Content
文件名必须是 `SKILL.md`(全大写)**。这不是建议,是硬性要求,否则 Claude Code
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Agent Config Directory Access

High
Category
Agent Snooping
Content
用 `references/workflow-skill-template.md` 作为参考模板,生成 SKILL.md。

生成前请先阅读模板文件(路径根据 auto-create-skill 自身安装位置而定):
- Claude Code: `cat ~/.claude/skills/auto-create-skill/references/workflow-skill-template.md`
- Claude.ai: `cat /mnt/skills/user/auto-create-skill/references/workflow-skill-template.md`

生成 Skill 时遵循以下原则:
Confidence
90% confidence
Finding
Reading from ~/.claude/skills accesses the agent's configuration/skill area, which is sensitive because it reveals locally installed skills, templates, and potentially operational conventions. In this skill's context, the access is framed as normal setup, making it more dangerous because it conditions the agent to inspect config directories as part of routine execution.

Vague Triggers

High
Confidence
96% confidence
Finding
The instruction to make generated descriptions as trigger-happy as possible encourages future skills to contain vague, expansive activation phrases. That propagates unsafe auto-invocation behavior into newly generated skills, amplifying the risk of unintended execution across later conversations.

Agent Config Directory Access

High
Category
Agent Snooping
Content
```bash
# ✅ 正确:先建子目录,再在里面写 SKILL.md
mkdir -p ~/.claude/skills/<skill-name>
cat > ~/.claude/skills/<skill-name>/SKILL.md << 'SKILL_EOF'
---
name: <skill-name>
description: ...
Confidence
98% confidence
Finding
Writing directly into ~/.claude/skills creates or alters persistent agent behavior by installing a new skill in the agent config directory. This is especially sensitive because it changes future execution semantics across sessions, effectively creating a persistence mechanism that could be abused to plant overbroad or malicious instructions.

Agent Config Directory Access

High
Category
Agent Snooping
Content
# 验证文件路径是否正确
if [ -f "$HOME/.claude/skills/<skill-name>/SKILL.md" ]; then
  echo "✅ Skill 文件路径正确"
  head -5 "$HOME/.claude/skills/<skill-name>/SKILL.md"
else
  echo "❌ 错误:SKILL.md 未在正确位置创建!"
  # 检查是否误创建为平铺文件
Confidence
87% confidence
Finding
Verification by reading and displaying the first lines of a file in ~/.claude/skills still normalizes access to the agent config directory and may expose metadata or instruction content from persistent skills. While less severe than writing, it reinforces a pattern of interacting with sensitive configuration paths without strict scope controls.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill explicitly instructs file reads and writes, including persistent writes to skill directories, but does not declare any tool scope restrictions such as allowed-tools or permissions. That creates unnecessary ambient authority: if invoked, the agent may perform filesystem operations beyond what users expect, increasing the blast radius of prompt injection or accidental misuse.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The natural-language content and required user-facing messages are written entirely in Chinese, including quoted text the skill tells the agent to present to users. There is no opt-in, language selection mechanism, or justification that this is a Chinese-only regional skill.

Skill Enumeration

Medium
Category
Agent Snooping
Content
# ❌ 错误:文件名不对
~/.claude/skills/fix-easy-bug/fix-easy-bug.md
~/.claude/skills/fix-easy-bug/skill.md

# ❌ 错误:路径层级不对
~/.claude/skills/SKILL.md
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Session Persistence

Medium
Category
Rogue Agent
Content
**创建文件时必须使用以下命令序列**(不可省略 mkdir):
```bash
mkdir -p $SKILL_DIR/<skill-name>
cat > $SKILL_DIR/<skill-name>/SKILL.md << 'SKILL_EOF'
<Skill 内容>
SKILL_EOF
Confidence
97% confidence
Finding
The same persistence mechanism applies to the Claude.ai output path: generating downloadable skill artifacts allows unsafe instructions to be packaged for later reinstallation and reuse. Even if the sandbox is ephemeral, the exported files create durable artifacts that can reintroduce risky behavior outside the current session.

Session Persistence

Medium
Category
Rogue Agent
Content
**创建文件时必须使用以下命令序列**(不可省略 mkdir):
```bash
mkdir -p $SKILL_DIR/<skill-name>
cat > $SKILL_DIR/<skill-name>/SKILL.md << 'SKILL_EOF'
<Skill 内容>
SKILL_EOF
Confidence
97% confidence
Finding
The same persistence mechanism applies to the Claude.ai output path: generating downloadable skill artifacts allows unsafe instructions to be packaged for later reinstallation and reuse. Even if the sandbox is ephemeral, the exported files create durable artifacts that can reintroduce risky behavior outside the current session.

Skill Enumeration

Medium
Category
Agent Snooping
Content
1. **必须创建子目录,然后在子目录内创建 SKILL.md 文件**(不可直接在 skills 目录下创建 .md 文件):
```bash
# ✅ 正确:先建子目录,再在里面写 SKILL.md
mkdir -p ~/.claude/skills/<skill-name>
cat > ~/.claude/skills/<skill-name>/SKILL.md << 'SKILL_EOF'
---
name: <skill-name>
Confidence
85% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
else
  echo "❌ 错误:SKILL.md 未在正确位置创建!"
  # 检查是否误创建为平铺文件
  ls -la "$HOME/.claude/skills/" | grep "<skill-name>"
fi
```
Confidence
92% confidence
Finding
Listing ~/.claude/skills enumerates installed skills in the agent configuration area, which can leak capability inventory and operational context. In combination with direct write capability and broad triggers, this information can help target persistent modifications or identify high-value skills to tamper with.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The template explicitly instructs authors to enumerate triggers as broadly as possible ('宁多勿少'), which encourages overbroad activation conditions. In a skill-generation context, this can cause unintended invocation of automation on loosely related user requests, increasing the chance of acting without sufficient user intent or scope confirmation.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The example trigger phrases such as '修复 BUG / 修 bug' are overly generic and could match many requests that do not intend to invoke this specific workflow. Because the skill supports automated code changes and push operations in later steps, broad triggering raises the risk of accidental execution of impactful actions.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code file contains natural-language instructions and status messaging only in Chinese, including the module docstring and later CLI output. Under the policy, forcing a specific language without opt-in or documented regional justification is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
该文件中的标题、说明和示例均以中文固定给出,没有声明这是面向特定中文团队的区域化模板,也没有提供用户可选择其他语言的方式。按规则,强制特定语言而无用户 opt-in 属于自然语言策略风险。

Static analysis

No suspicious patterns detected.