Back to skill

Security audit

Skill Extractor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent local skill-memory tool, but it can persist raw conversation-derived instructions into future reusable skills without enough sanitization or retention controls.

Review generated skills before saving or reusing them. Do not run this on conversations containing secrets, credentials, private customer data, or untrusted third-party instructions unless the output is manually sanitized. Treat newly extracted skills as drafts until approved, and periodically delete old generated skills and the local search index if they are no longer needed.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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)

T02 · Agent Memory Poisoning

Error
Location
scripts/extract_skill.py:65
Finding

Stored Prompt Injection Through Unsanitized Skill Generation

Content
View full analysis
str: """生成 SKILL.md 格式的技能文档""" md = f"""--- name: {skill['name']} description: {skill['description']} --- # {skill['name'].replace('_', ' ').title()} ## When to Use - {skill['when_to_use']} ## Tools Used {', '.join(f'`{t}`' for t in skill['tools_used']) if skill['tools_used'] else '无特定工具'} ## Procedure """ for i, step in enumerate(skill["steps"], 1): md += f"{i}. {step}\n" md += f""" ## Notes - 自动提取自对话记录 - 提取时间: {skill['extracted_at'][:10]} --- *此技能由 skill-extractor 自动生成* """ return md def save_skill(skill: dict) -> str: """保存技能到仓库,返回文件路径""" filename = f"{skill['name']}_{skill['extracted_at'][:10]}.md" filepath = SKILLS_DIR / filename md = generate_skill_markdown(skill) filepath.write_text(md, encoding="utf-8") ``` ### Technical Analysis The extractor treats the task description and conversation history as trusted skill-authoring input. Content parsed from the conversation is placed directly into the generated `## Procedure` section, while task text is inserted into YAML frontmatter and the `## When to Use` section. No semantic validation, instruction filtering, frontmatter escaping, or trust-boundary marking is applied before the document is written to the persistent local skill repository. An attacker who can influence a conversation can include list items that look like legitimate procedural steps but contain instructions to override p ...[truncated 2724 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose emphasizes post-task extraction and storage of reusable skills, but the documented behavior also includes local skill search, Markdown parsing, SQLite/FTS5 indexing, and query/rebuild operations that materially expand the attack surface. This mismatch is dangerous because reviewers and policy engines may approve the skill under a narrower trust model while it actually processes local content and performs persistence-related operations with broader security implications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill describes reading and writing files, including storing generated skills under a user workspace path, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent setting, undocumented file capabilities increase the chance of overbroad filesystem access, accidental writes, or abuse through prompt-induced behavior because operators cannot clearly constrain what the skill may touch.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s user-facing description is written entirely in Chinese and presents the skill behavior in that language without stating that users may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill states that when a user describes a new task, it will automatically retrieve related skills, but it does not define meaningful scope limits, consent requirements, or matching constraints. In context, this can cause routine prompts to trigger access to locally stored skills and conversation-derived artifacts, increasing the risk of unintended data exposure, irrelevant injection from stored content, or privacy leakage across tasks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The only user-facing description is written in Chinese, with no indication that language is selectable or that the skill is intentionally region-specific. This can violate language/locale policy expectations when a skill imposes a language choice without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file's natural-language documentation and user-facing strings are written in Chinese, including the stated purpose, usage help, and runtime messages, with no indication that the user can choose another language. Under the stated policy, forcing a specific language without opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script persists conversation-derived content directly to disk, which can capture sensitive prompts, secrets, internal procedures, or prompt-injected content from untrusted conversations. In this skill's context, the saved output becomes a reusable knowledge artifact under a predictable local path, increasing the chance of long-term retention and later resurfacing of sensitive or malicious material.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill that, after task completion, stores reusable skill files and automatically retrieves them when similar tasks appear. In the implementation, --task and --conversation are always required by argparse, even when only --search is used, so the retrieval behavior is not actually exposed as an independent capability as described.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The user-facing argparse description, help text, and printed output are all hard-coded in Chinese. This creates a language/locale policy concern because the skill does not offer an opt-in choice or explain that it is intentionally region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring says the script can be run with --session-id <id> --check for an auto-check mode, but the argparse configuration only defines --task, --conversation, --auto, and --json. This is an active contradiction between documented intent and actual behavior, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script copies raw task text and extracted conversation steps directly into a generated skill preview, which can propagate secrets, personal data, internal identifiers, or sensitive operational details into reusable artifacts and console output. In this skill-extraction context, that risk is elevated because the feature is explicitly designed to transform transient dialogue into reusable documentation, increasing the chance of unintended retention and later disclosure.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script normalizes the idea of turning dialogue records into durable skill notes, creating a retention channel for user-supplied content that may have originally been shared only for a single task. In a system built to store and later retrieve these notes, this increases the blast radius of any sensitive information that slips into the conversation, making later disclosure or over-sharing more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly notes that Zotero API access requires a userID and API key, but it gives no guidance on secure handling, storage, masking, or consent around using those credentials with external services. In an agent setting, this can lead users or downstream tooling to expose secrets in prompts, logs, or untrusted network calls, making credential leakage or unintended external data access more likely.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This manifest description explains the skill's purpose but does not provide any concrete trigger phrases, activation boundaries, or exclusion conditions. For manifest files, that can make invocation criteria ambiguous and increase the chance of unintended activation in broad 'learning' or 'self-improvement' contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural language in a single language/locale: the usage examples, docstrings, help text, and runtime output are in Chinese. Because the skill does not offer any user opt-in or language selection, it can violate a language/locale policy requiring neutrality or user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

make_suggestion is annotated to take steps: int and formats output as a count, but analyze_complexity passes steps_found, which is a list, at L104. The produced text therefore describes the number of steps while actually interpolating the list representation, contradicting the function's stated contract and intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The skill name and all user-facing instructions are presented only in Chinese, with no indication that users may choose another language. This can violate language/locale policy when a skill implicitly forces a language without opt-in or documented regional justification.

Content

No source excerpt is available for this finding.