Back to skill

Security audit

技能诊所

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent skill-building assistant, but it tells agents to run unpinned remote commands and automatically persist failure context without enough user control.

Install only if you are comfortable reviewing each remote search and write action. Before use, pin or replace the `npx skills find` command, confirm any ClawHub or external searches before sending queries, and make feedback logging opt-in with redaction and clear deletion rules.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Error
Location
modules/03-precedent.md:9
Finding

Unpinned Remote Package Retrieval and Execution via npx

Content
View full analysis

Vulnerability Details

File Location: modules/03-precedent.md:9-12 and modules/03-precedent.md:40-43
Vulnerability Type: Unpinned third-party package execution
Risk Level: High

Vulnerable Code:

markdown
1. 从需求中提取关键词(功能域、输入输出、触发场景)
2. 本地搜索:`Glob + Grep` 扫描 `~/.codebuddy/skills/*/SKILL.md`
3. 远程搜索:`npx skills find <query>` 查 skills.sh
4. ClawHub 搜索:`clawhub search <query>`
bash
# skills.sh
npx skills find <query>

Technical Analysis

The Skill directs the Agent to invoke an unversioned package through npx. Depending on the local environment and cache state, npx can retrieve the package from a remote registry and execute package-controlled code, including installation lifecycle scripts.

No package version, lockfile, integrity hash, trusted registry restriction, or provenance check is specified. The Skill also grants access to Bash, so package code would run with the operating-system privileges and environment inherited by the Agent.

Although remote precedent discovery is relevant to the declared functionality, executing a dynamically resolved package is not the minimum privilege necessary for a search operation. A read-only registry API or preinstalled, verified client would provide a narrower trust boundary.

Attack Path

  1. A user triggers Skill creation or precedent research.
  2. The Skill loads the precedent-research workflow.
  3. The Agent runs npx skills find <query>.
  4. npx resolves an unpinned package from the configured package registry or cache.
  5. A compromised, substituted, or otherwise malicious package executes during installation or command startup.
  6. The package inherits the Agent process's filesystem, environment, and network access.
  7. Malicious code can read accessible files, inspect environment variables, alter workspace content, or initiate outbound connections.

Impact Assessment

Successful exploitation ...[truncated 504 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace npx execution with a documented, read-only registry API where possible.
  2. If a CLI is required, pin an explicitly reviewed package version, such as package-name@x.y.z.
  3. Commit and enforce a lockfile and verify package integrity and provenance before execution.
  4. Configure an allowlisted registry rather than inheriting arbitrary package-manager registry settings.
  5. Disable or ignore package lifecycle scripts where supported.
  6. Require explicit user approval before downloading or executing a package that is not already installed.
  7. Run the search client in a restricted environment without secrets, write access outside a temporary directory, or unnecessary network destinations.
  8. Document the expected package publisher, package identifier, version, and checksum so similarly named packages cannot be substituted silently.

T09 · Insecure Skill Coding Practices

Warning
Location
modules/04-feedback.md:3
Finding

Automatic Plaintext Persistence of Potentially Sensitive Failure Context

Content
View full analysis

Vulnerability Details

File Location: modules/04-feedback.md:3-18 and modules/04-feedback.md:33-38
Vulnerability Type: Unredacted sensitive-data logging
Risk Level: Medium

Vulnerable Code:

markdown
## 反馈类型

| 类型 | 触发时机 | 记录内容 |
|------|---------|---------|
| 使用反馈 | 用户主动反馈 | 技能名、问题描述、改进建议 |
| 失败信号 | 技能执行出错 | 技能名、错误信息、上下文 |
| 漂移信号 | 技能效果变差 | 技能名、评分变化、时间戳 |

## 存储格式

存储位置:`feedback/feedback.jsonl`

```json
{"ts":"2026-08-04T10:00:00Z","skill":"搬题姬","type":"failure","msg":"URL抓取超时","context":"AtCoder比赛页"}
{"ts":"2026-08-04T11:00:00Z","skill":"破晓","type":"feedback","msg":"早报格式很好,但新闻源太少","suggestion":"增加RSS源"}
text

```markdown
## 反馈收集方式

### 自动收集

- 技能执行出错时自动记录
- 诊断时自动记录评分变化

Technical Analysis

The feedback workflow automatically records error messages and execution context in feedback/feedback.jsonl. Error context commonly contains sensitive material such as local paths, command arguments, document excerpts, URLs with query credentials, request or response content, stack traces, and environment-derived values.

The workflow defines no consent boundary, redaction rules, field allowlist, retention period, file-permission requirements, or maximum record size. JSONL is plaintext, and the destination is inside the project tree, making accidental source-control inclusion or later disclosure more likely.

The repository's current feedback/feedback.jsonl file is empty, so no existing secret exposure was confirmed. The vulnerability is the instructed automatic collection behavior.

Attack Path

  1. A Skill operation fails while processing sensitive input or operating in a sensitive environment.
  2. The generated error message or context contains a credential, private path, user content, request data, or other confidential value.
  3. The feedback module automatically appends that data to feedback/feedback.jsonl.
  4. The plaintext record persists after the originating ...[truncated 726 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make failure-context collection opt-in and obtain user approval before persisting task data.
  2. Store only a minimal allowlist of fields, such as timestamp, Skill identifier, normalized error code, and sanitized summary.
  3. Redact credentials, authorization headers, cookies, tokens, URL query strings, personal data, filesystem paths, and environment values before writing.
  4. Avoid storing raw prompts, document contents, command lines, request bodies, response bodies, or stack-frame local variables.
  5. Set restrictive file permissions and keep feedback data outside distributable or source-controlled project content.
  6. Add feedback/feedback.jsonl and search caches to ignore and packaging-exclusion rules.
  7. Define retention limits, automatic expiration, maximum record size, and a user-visible deletion mechanism.
  8. Validate and safely serialize all fields before appending records.
  9. Document whether feedback remains local and prohibit uploading it unless the user separately gives informed consent.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (30)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description, keywords, triggers, and scoring guidance are predominantly written in Chinese, and the file does not state that language selection is optional. This can amount to a language/locale policy issue if the skill implicitly requires Chinese interaction without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill grants Bash execution even though its documented workflow is primarily reading, evaluating, creating, and editing skill files. This unnecessarily expands the attack surface: if later module content, user input, or repository data is interpreted into shell commands, the skill could execute unintended local commands with the agent's privileges.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list is broad and includes common terms such as 创建技能, 反馈, 查重, and 门禁, which may match ordinary user conversation and invoke the skill unintentionally. Unintended activation is risky here because the skill has write/edit capability and Bash access, so a mistaken trigger could lead to file modification or command execution in workflows the user did not intend.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file includes example trigger definitions such as “代码审查” and “code review” as standalone activators. These are common phrases that could overlap with ordinary user requests, and the example does not provide constraints, activation context, or negative examples to clarify when the skill should or should not invoke.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example defines triggers like “生成文档” and “docgen” without explaining invocation scope, required context, or non-trigger cases. “生成文档” is especially broad and could collide with normal requests unrelated to this specific skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The remote search example performs an external network action (npx skills find) without warning the user that data may leave the local environment or that remote code/package resolution may occur. In a skill context, undocumented network access is risky because users may assume the operation is local-only while queries, metadata, or environment context could be exposed externally.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The example invokes npx skills find without pinning a package version or verifying package provenance. If the package is updated maliciously, typo-squatted, or otherwise compromised, users following the example may execute untrusted code from the network on their machine.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill file is written in Chinese and provides no indication that users may choose another language or that the skill is intended only for a Chinese-language context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The simple skill template leaves trigger as a vague placeholder and provides no requirement that activation phrases be narrow, specific, or collision-resistant. In a skill-creation context, this can propagate overly broad triggers into downstream skills, causing accidental invocation, prompt-routing conflicts, or unintended execution of higher-privilege workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The complex template repeats the same unconstrained trigger guidance while also enabling tool-bearing skills, which increases risk because an ambiguously triggered skill may gain access to Read/Write operations unexpectedly. In this repository's context, broad triggers are more dangerous because this module is a generator pattern that can stamp insecure activation logic into many future skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

All user-facing instructions, triggers, and output examples in this file are exclusively in Chinese, with no indication that the user can choose another language. Under the policy, forcing a language without opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The documented command npx skills find <query> executes a package by name without pinning an exact version, which can pull whatever version is current at execution time. That creates a supply-chain risk: a compromised upstream package, typo-squatted dependency, or unexpected breaking update could execute arbitrary code on the user's machine when the skill is followed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module instructs remote searches via npx skills find, clawhub search, and clawhub inspect but gives no user-facing warning that the query text may be transmitted to external services. If the extracted keywords come from a user's private requirements, project names, internal file paths, or unreleased product terms, the skill can cause unintended data disclosure to third parties.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The remote-search example again references npx skills without version pinning, repeating the same unbounded package execution risk. Because this module is instructional, users or downstream agents may copy the command directly, turning documentation into an execution path for unreviewed remote code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module explicitly says errors and score changes are automatically recorded, while earlier examples show logging of error messages and execution context. Without notice, consent, minimization, or redaction guidance, this can capture sensitive user data, internal prompts, URLs, identifiers, or other operational context into persistent storage. In an operations-feedback skill, that makes accidental privacy leakage and over-collection more likely rather than hypothetical.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file falls under the vague-trigger category. The phrase '技能创建/修改后,自动运行质量门禁' describes activation broadly but does not specify what kinds of modifications count, who or what initiates the run, or any non-triggering cases, which could cause unintended invocations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The placeholder scanner flags generic words such as '示例' and '例子', which are legitimate content in documentation and examples. In a gatekeeping module, this can cause systematic false positives that block publication or incentivize users to remove useful examples, undermining the integrity and reliability of the release process.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file includes a natural-language policy constraint by presenting the skill criteria entirely in Chinese and framing the requirements accordingly. Under the policy, forcing a specific language or locale without user opt-in is a reportable issue unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all operational instructions in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. That can violate a language/locale policy when users have not opted into a specific language.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The documentation instructs use of npx skills find <query> without pinning an exact package/version, which can cause execution of whatever package version is current at runtime. If the upstream package is compromised, typosquatted, or changed incompatibly, users following the guide may execute untrusted code during remote skill discovery.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

This example again recommends npx skills find "code review" without a pinned version, creating a supply-chain risk for anyone copying the command. Because npx may fetch and execute remote package code, the skill context of searching/installing external resources makes this more dangerous rather than less.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger schema only describes triggers as free-form keywords without any constraints on specificity, namespace, collision avoidance, or activation precedence. In an agent skill ecosystem, overly broad triggers can cause unintended skill activation, misrouting of user requests, and invocation of higher-privilege workflows when ambiguous phrases match multiple skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains user-facing natural language exclusively in Chinese, including headings and guidance, but provides no opt-in, alternative language, or explanation that the skill is region-specific. Under the language/locale policy rule, forcing a specific language without user choice is a policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module table lists short triggers like “体检”, “创建”, “类似”, “反馈”, and “验证”, several of which are generic and context-dependent. Because the document does not define activation boundaries for these terms, the skill’s sub-functions may be invoked more broadly than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

All instructional content and examples in this file are written in Chinese, and the document does not indicate that the skill is region-specific or that users may choose another language. This can be a language/locale policy issue when a skill effectively forces a language without opt-in or justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.