Back to skill

Security audit

Skill Sharpener

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate skill-quality auditor, but it can run local analysis and broadly modify skill files, and its file-tree scanner can escape intended boundaries through symlinks.

Install only if you are comfortable letting it read the target skill directory, run its local Python analyzer, and potentially edit skill files after confirmation. Use it on trusted skill folders, avoid directories containing secrets or symlinks to private locations, and review proposed changes before allowing rewrites or refactors.

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

Warning
Location
scripts/audit_skill.py:164
Finding
Unbounded Recursive Directory Traversal Through Symbolic Links## Vulnerability Details **File Location**: `scripts/audit_skill.py:164-173` **Vulnerability Type**: Unrestricted recursive traversal and symbolic-link following **Risk Level**: Medium ```python items = sorted(skill_dir.iterdir(), key=lambda p: (p.is_file(), p.name)) for i, item in enumerate(items): is_last = i == len(items) - 1 connector = "└── " if is_last else "├── " lines.append(f"{indent}{connector}{item.name}") if item.is_dir(): sub_indent = indent + (" " if is_last else "│ ") lines.append(build_file_tree(item, sub_indent)) ``` ### Technical Analysis The file-tree generator recursively traverses every item for which `Path.is_dir()` returns true. Because `Path.is_dir()` follows symbolic links, a symbolic link to a directory is treated as an ordinary directory. The implementation does not: - Reject symbolic links. - Track directories that have already been visited. - Enforce a maximum recursion depth or item count. - Resolve paths and verify that they remain inside the audited Skill directory. Consequently, an attacker-controlled Skill directory can contain a symbolic link to itself, an ancestor directory, or a large external directory. A cyclic link can cause repeated recursion until Python raises a recursion error or the process exhausts resources. A link to an external directory can make the analyzer enumerate filenames outside the intended project boundary. ### Attack Path 1. An attacker creates a Skill directory containing a symbolic directory link. 2. The link points to the Skill directory itself, one of its ancestors, or a large directory elsewhere on the filesystem. 3. A user invokes `python scripts/audit_skill.py <skill-directory>`. 4. `build_file_tree()` calls `item.is_dir()`, which follows the symbolic link. 5. The function recursively traverses the linked directory without cycle detection or boundary validation. 6. For a cyclic or very larg ...[truncated 889 chars]
Remediation
## Remediation Suggestions 1. Reject symbolic links before testing whether an item is a directory: ```python if item.is_symlink(): lines.append(f"{indent}[symbolic link skipped: {item.name}]") continue ``` 2. Resolve each candidate path and verify that it remains under the resolved Skill root: ```python root = skill_root.resolve() resolved = item.resolve() try: resolved.relative_to(root) except ValueError: raise ValueError(f"Path escapes the Skill directory: {item}") ``` 3. Track visited directories using resolved paths or `(device, inode)` identifiers to prevent cycles and repeated traversal. 4. Add explicit maximum-depth and maximum-entry limits so unusually large but non-cyclic directory trees cannot exhaust resources. 5. Handle traversal errors such as permission failures, broken links, and link loops without terminating the entire audit. 6. Add regression tests covering self-referential links, links to parent directories, links outside the project root, broken links, and deeply nested directory structures.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (12)

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md`(必读)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The natural-language description is presented entirely in Chinese, and the README does not indicate that language is selectable or that the skill is intentionally limited to Chinese users. Under the policy, forcing a specific language without user opt-in is a locale/language policy concern.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The README advertises 'one-click application of fixes' to existing skill files without warning users that files may be modified. In an agent-skill context, silent or poorly signposted write behavior can lead to unintended changes to local configuration or prompt assets, especially if users assume the operation is purely diagnostic.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill instructs reading multiple files (`SKILL.md`, reference files, and scripts) but does not declare any explicit tool scope such as `permissions` or `allowed-tools`. That mismatch can cause the skill to operate with implicit file-access expectations, making review and enforcement of least privilege harder.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The manifest description and main body are written entirely in Chinese, which implies the skill operates in a fixed language. The file does not offer a user language choice or explain that the skill is intentionally limited to a Chinese-speaking context, which matches the locale-policy violation criteria.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The skill directs execution of a local Python script against a user-supplied skill path, which expands it from document review into code execution. Even if the script is intended for benign auditing, running local code on arbitrary input increases the attack surface and may enable unintended file access or execution of unsafe logic in the local environment.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill is framed as an auditor, but it also offers to apply fixes, rewrite descriptions, and refactor the target skill. This broadens authority from assessment to content modification, which can lead to unintended or unauthorized changes to files the user may have expected to be analyzed only.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
There is a capability mismatch between the manifest, which emphasizes evaluation and recommendations, and the workflow, which includes directly modifying target files after backup. Hidden write behavior is dangerous because users or policy systems may authorize the skill for review purposes without realizing it can alter content.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
This markdown file is entirely framed as a normative checklist for skill authors, and L35 explicitly requires avoiding first/second-person forms using Chinese examples such as “我” and “你”. Combined with the document’s exclusively Chinese guidance, it imposes a language-specific authoring policy rather than offering a choice or documenting that the checklist is only for a Chinese-localized environment.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The module title, usage text, and output description are presented in Chinese only, which imposes a specific language on users. The file does not indicate any opt-in, fallback, or locale choice that would justify or mitigate this language constraint.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The script's printed status, error, and completion messages are all hard-coded in Chinese, including usage instructions and operational output. This is a language-policy concern because the tool does not give users a language choice or clearly document a justified locale restriction.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The examples encourage pointing the tool at user-local skill directories but do not warn that the analysis will read files from those paths. While reading a skill directory is expected for this tool, lack of disclosure can still surprise users and may expose sensitive local content to the reviewing agent or logs.

Static analysis

No suspicious patterns detected.