Back to skill

Security audit

Learning

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for learning projects, but it can create and install new skill files and package them with shell commands in ways that deserve review before use.

Review before installing. Use it only in a workspace where creating new skill directories and learning-project files is acceptable. Avoid adversarial or unusual topic names, prefer simple alphanumeric topics, and inspect generated paths before direct install or ZIP packaging. The publisher should add strict slug validation, secure temporary directories, structured ZIP invocation, and an explicit confirmation showing exact write targets.

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:105
Finding

Unvalidated Topic Slug Can Reach Filesystem Paths and Shell Commands

Content
View full analysis

Vulnerability Details

File Locations:

  • SKILL.md:105-106
  • SKILL.md:201-204
  • SKILL.md:217-223

Vulnerability Type: Command injection, path traversal, option injection, and unsafe temporary-file handling
Risk Level: High

Vulnerable Code

markdown
| `topic_slug`              | 从 topic 派生      | 转为适合文件命名和 name 字段的格式(小写、下划线、无空格,如 "distributed_systems") |
| `project_dir`             | 从 topic_slug 派生 | `learn_` + topic_slug + `/`(如 `learn_distributed_systems/`),项目文件的存放目录 |
markdown
1. 在当前工作空间内,按探测到的 `{skill_prefix}` 创建 skill 目录:`{skill_prefix}/learn_{{topic_slug}}/`
2. 将生成的 SKILL.md 写入该目录
3. 在该目录下创建 `references/` 子目录,写入 review_guide.md 和 framework_guide.md
4. 在当前工作空间根目录下创建项目文件目录 `learn_{{topic_slug}}/`
markdown
1. 在 /tmp/ 下创建临时目录 `learn_{{topic_slug}}_package/`
2. 在临时目录内按探测到的 `{skill_prefix}` 创建 skill 目录结构:`{skill_prefix}/learn_{{topic_slug}}/SKILL.md` + `{skill_prefix}/learn_{{topic_slug}}/references/`
3. 在临时目录内创建项目文件目录:`learn_{{topic_slug}}/`
4. 写入所有文件(同路径1步骤2-3)。同样使用文件写入工具,避免 Shell heredoc
5. 执行 zip 打包:`cd /tmp && zip -r learn_{{topic_slug}}.zip learn_{{topic_slug}}_package/`
6. 将 zip 文件移动到用户工作目录
7. 清理临时目录

Technical Analysis

The user-controlled learning topic is converted into topic_slug, which is subsequently interpolated into directory names, archive names, a predictable /tmp directory, and a Bash command. Although the instructions describe the desired slug as lowercase, underscore-separated, and without spaces, they do not define or enforce a strict character allowlist.

In particular, the Skill does not explicitly require the implementation to:

  • Reject path separators such as / or \.
  • Reject parent-directory components such as ...
  • Reject shell metacharacters and command substitutions.
  • Reject leading hyphens that may be interpreted as command-line options.
  • Enforce a maximum slug length.
  • Canonicalize generated paths an ...[truncated 3250 chars]
Remediation
View remediation

Remediation Suggestions

  1. Define and enforce a strict slug allowlist. Require topic_slug to match a narrow expression such as ^[a-z0-9_]{1,64}$. Reject invalid values instead of attempting to preserve or loosely normalize dangerous input.

  2. Use a trusted slugification routine. Convert the topic to normalized Unicode, transliterate where appropriate, lowercase it, replace separators with a single underscore, and remove every character outside the allowlist. Validate the final result again before use.

  3. Prevent path traversal. Resolve each destination to a canonical absolute path and verify that it remains beneath the approved workspace or temporary root before creating or writing files.

  4. Avoid interpolated shell commands. Invoke ZIP through a structured process API with a fixed executable and separate argument array. If Bash is unavoidable, apply robust shell quoting to every variable and use -- before user-derived positional arguments where supported.

  5. Use secure temporary directories. Create a unique temporary directory through a secure facility such as mktemp -d, apply restrictive permissions, avoid following symlinks, and clean it up in a guaranteed finalization step.

  6. Reject option-like names. Do not permit generated filenames or directory names to begin with -, even if a downstream command uses --.

  7. Limit filesystem scope. Permit writes only beneath the selected Skill installation directory, project directory, and securely created temporary directory. Abort delivery if any resolved path escapes those roots.

  8. Document validation as a mandatory security requirement. Add explicit validation and containment checks to the generation checklist so that Agents cannot interpret the current examples as merely advisory formatting guidance.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The trigger instructions are overly broad and include common conversational phrases like '继续' and '接下来', which can cause the skill to activate outside the user's actual intent to engage in a structured learning workflow. In context, this can lead to unintended tool use, file reads/writes, and workflow hijacking away from the user's immediate request.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger description is excessively broad, including generic phrases like '继续', '接下来', and '开始学习', which can cause the skill to activate in conversations that are not actually requesting this specific learning-project workflow. Because the skill has write, bash, and web_search tools and later instructs automatic file creation/loading, an overbroad activation condition increases the chance of unintended tool use, filesystem changes, and context hijacking from ordinary chat turns.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README advertises automatic saving, progress tracking, and cross-conversation recovery through ongoing local file writes, but does not present a strong upfront warning that installing and using the skill will continuously modify the workspace. In this context, the risk is elevated because the skill is designed for long-lived use and repeated automatic writes, so users may unintentionally expose sensitive learning notes, clutter repositories, or commit generated files without realizing the persistence model.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match normal learning-related conversation, which can cause the skill to activate when the user likely intended a one-off answer rather than installation or long-running workflow behavior. In this skill’s context, that matters because activation can lead to persistent project scaffolding and file-based state management, increasing the chance of unexpected agent actions beyond the user’s immediate intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are extremely broad and match ordinary requests like 'learn X' or '帮我制定学习计划', making accidental invocation likely. Because this skill writes files and may package archives, overbroad triggering can cause side effects in situations where the user expected only conversational guidance, increasing the chance of unintended file-system actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The delivery flow performs workspace file creation, temporary-directory writes, ZIP creation, and file moves, but the skill metadata and trigger description do not clearly disclose these side effects up front. Users may invoke it thinking it only provides a plan, not realizing it can modify the workspace and create archives on disk, which undermines informed consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs probing the user's home directory for global skill-installation paths, which exceeds the minimum access needed to install into the current workspace or create a package. This expands the read scope into unrelated user environment metadata and can reveal platform/tool usage patterns without a clear necessity for the requested task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file contains all instructional content in Chinese, with no indication that users may choose another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

All user-facing instructional content in this skill file is in Chinese, and the guide does not offer any language selection or indicate that Chinese is an optional or region-specific mode. That creates a natural-language locale constraint without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

文件中的自然语言说明整体以中文规定技能行为,且描述中未提供语言/locale 选择、切换方式或用户 opt-in。根据规则,若技能默认强制特定语言而没有用户选择机制,属于语言/区域策略风险。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template directs the agent to automatically create directories and save progress files without an explicit user-consent or notice mechanism at the point of persistence. In this skill's context, the written content may include personal learning goals, background, and progress data, so silent persistence increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill directs the agent to create directories and write multiple files automatically on first run without first warning the user or obtaining explicit consent for filesystem modifications. In context, this is more dangerous because the skill also uses broad activation logic, so an unintended invocation could silently produce persistent files, alter project state, and surprise the user with side effects beyond normal conversational assistance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The guide explicitly instructs the agent to update learning_plan.md, generate summary_module_N.md, and save the result, but it does not require explicit user confirmation before modifying persistent user data. In an agent setting, this can lead to unexpected or undesired file changes, especially if the user intended a discussion-only review rather than a write operation.

Content

No source excerpt is available for this finding.