Back to skill

Security audit

Skill Optimizer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly purpose-aligned, but it needs review because it can search local agent skill/plugin areas and read untrusted skill instructions without a clear isolation rule.

Install only if you are comfortable with a skill that can inspect and edit SKILL.md files. Provide an explicit target path instead of letting it search local agent directories, treat target skills as untrusted text, and review every diff before approving writes.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:105
Finding

Untrusted Target Skill Content Can Hijack the Auditing Agent

Content
View full analysis
/original-SKILL.md`) so the user can diff the changes. Don't write back to a read-only path without copying first. ### Step 3: Run the audit Read the relevant reference checklist for each dimension as you go. Use the bundled `scripts/audit_skill.py` for the mechanical (Dimension 1) checks — it produces a structured pass/fail list. For Dimensions 2 and 3, do them by reading and applying the checklist; LLMs are better judges of content quality than regex. ``` ### Technical Analysis The workflow instructs the agent to read an arbitrary target `SKILL.md` in full. Such a file contains agent-facing instructions and may be controlled by an untrusted author. The optimizer does not establish an explicit trust boundary requiring the target content to be treated solely as data, nor does it prohibit following commands, role changes, safety overrides, file-access requests, or tool-use instructions embedded in the audited file. Because the target is itself an instruction document, directly loading it into the active agent context creates a prompt-injection path. A malicious target Skill could contain directives that attempt to override the audit objective, suppress findings, access unrelated workspace data, execute commands, or produce attacker-selected output. The bundled Python auditor does not itself execute target content. The risk arises from the broader agent workflow that directs an LLM to interpret the entire target file without explicit isolation. ### Attack Pa ...[truncated 1524 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description materially overstates the skill's behavior. The code is a specification-oriented validator for SKILL.md structure and file references, not a full skill optimizer. Its own docstring explicitly says it does NOT cover Best Practices or Description Optimization, directly contradicting the declared 3-dimension audit claim. It also does not implement improvement/polishing workflows or actual SKILL.md updates; it only reports issues and suggested fixes. The core purpose is therefore narrower and different from the declared end-to-end audit-and-improve capability.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This activation description is extremely broad and overlaps with common review/editing requests such as 'review this skill' or 'fix the description.' Because it also says to invoke the skill even when the user does not explicitly mention 'skill optimizer,' it increases the risk of unintended invocation for generic editing requests involving skills.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
- Any request to edit, polish, or refine an existing `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

md
- Any request to edit, polish, or refine an existing `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 51)May include surrounding context.

md
- Any request to edit, polish, or refine an existing `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 105)May include surrounding context.

md
- Any request to edit, polish, or refine an existing `SKILL.md`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 145)May include surrounding context.

md
- Any request to edit, polish, or refine an existing `SKILL.md`

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
94% confidence
Finding

The skill explicitly instructs the agent to search agent configuration and skill directories such as ~/.claude/skills/, ~/.agents/skills/, and plugin caches when the user does not provide a path. That creates an unnecessary discovery mechanism over potentially sensitive local configuration, enabling unintended exposure of private skills, prompts, API-related metadata, or other agent artifacts beyond the user's explicitly requested target.

Content

Scanner excerpt · SKILL.md (reported line 105)May include surrounding context.

md
### Step 2: Locate and snapshot

- Find the target `SKILL.md`. The user usually points at it directly. If not, search common locations: `~/.claude/skills/`, `~/.agents/skills/`, project-local `.claude/skills/`, plugin caches.
- Read the file in full before judging it.
- Snapshot the original (e.g., copy to `<workspace>/original-SKILL.md`) so the user can diff the changes. Don't write back to a read-only path without copying first.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/audit_skill.py (reported line 339)May include surrounding context.

python
"REF_MISSING",
            f"Referenced file does not exist: {r}",
            evidence=f"expected: {skill_path / r}",
            fix="Create the referenced file, or update SKILL.md to point to the correct path.",
        )

    return _result(findings, info)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README defines activation with a catch-all phrase covering essentially any request to edit, polish, or improve an existing SKILL.md. Overbroad trigger guidance can cause unintended invocation of this skill in contexts where a narrower or different skill should be used, increasing the chance of inappropriate file review or modification recommendations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow states that edits may be applied after approval, but this README does not clearly warn that the skill can modify user files. In agent settings, insufficient disclosure about write behavior can lead to surprising or unsafe file changes, especially if the user interprets the skill as advisory-only.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

md
- "Audit my skill against the spec" / "is this SKILL.md well formed?"
- "Improve the triggering of my skill" / "my skill isn't firing on the right prompts"
- "Make the description better" / "rewrite the frontmatter description"
- "This skill is too long, help me trim it"
- "Review this skill before I publish it"
- "Add examples and gotchas to my skill"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

These examples broaden activation to generic editorial requests without clearly distinguishing this skill from neighboring workflows. The phrase 'any request' is especially open-ended and lacks constraints or negative examples to prevent accidental matching.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
91% confidence
Finding

By telling the agent to search common skill and plugin cache locations, the skill encourages enumeration of installed skills and local agent setup. Even without exfiltration, this broad inventorying can reveal sensitive project names, internal tooling, or private skill presence that the user did not intend to disclose.

Content

Scanner excerpt · SKILL.md (reported line 105)May include surrounding context.

md
### Step 2: Locate and snapshot

- Find the target `SKILL.md`. The user usually points at it directly. If not, search common locations: `~/.claude/skills/`, `~/.agents/skills/`, project-local `.claude/skills/`, plugin caches.
- Read the file in full before judging it.
- Snapshot the original (e.g., copy to `<workspace>/original-SKILL.md`) so the user can diff the changes. Don't write back to a read-only path without copying first.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guidance explicitly recommends a "pushy catch-all" trigger phrase (e.g. activating even when the user does not explicitly mention the skill domain). That encourages over-broad skill activation, which can cause the agent to load unrelated instructions, override more appropriate skills, and increase the chance of unintended behavior in downstream workflows. In a skill-optimization reference, this is more dangerous than in general prose because it may be propagated into other skills as a recommended pattern.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The README lists trigger examples such as "Rewrite the frontmatter description" and "Review this skill before I publish it," plus a catch-all "Any request to edit, polish, or refine an existing SKILL.md." While scoped to existing SKILL.md files, the trigger guidance does not provide negative examples or explicit boundaries for nearby requests, which could make invocation conditions broader than intended in markdown guidance.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.