Back to skill

Security audit

Auto Skill Extractor

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to automate skill creation, but it can persist transcript-derived instructions into active agent skills with weak review and path controls.

Only install this in a workspace where automatic skill creation is acceptable, and review generated drafts before promotion. Avoid feeding it sensitive transcript summaries, and set AUTO_SKILL_WORKSPACE explicitly because the default locations are inconsistent. Treat active skills produced by this package as untrusted until a human has checked the generated SKILL.md content and lifecycle metadata.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
scripts/auto-skill-trigger.py:75
Finding

Persistent Agent Instruction Injection Through Untrusted Transcript Summaries

Content
View full analysis
str: """Generate a meaningful SKILL.md from transcript data.""" # Extract key actions from summary actions = [] for line in transcript_summary.split('\n'): line = line.strip().strip('- •').strip() if line and len(line) > 10 and not line.startswith('#'): actions.append(line) # Build tags section tag_str = "" if tags: tag_str = "\n".join([f" - {t}" for t in tags]) # Title from name title = skill_name.replace('-', ' ').title() md = f"""# {title} Auto-extracted skill from subagent work. ## Description {transcript_summary[:500]} ## When to Use {chr(10).join(['- ' + a[:100] for a in actions[:5]]) if actions else '- [Fill in conditions where this skill applies]'} ``` The generated content is subsequently written to a persistent skill file: ```python # Generate SKILL.md skill_md = generate_skill_md(skill_name, transcript_summary, tool_calls, complexity, tags) (draft_dir / "SKILL.md").write_text(skill_md) # Create meta.json (sanitized) meta = { ``` ### Technical Analysis The `transcript_summary` value comes directly from caller-supplied JSON and is embedded verbatim into a persistent `SKILL.md`. The implementation does not escape Markdown, identify instruction-like content, redact sensitive values, or establish a trust boundary between quoted transcript data and executable Agent instructions. The limited processing used to derive the “When to Use” section is not a security control. An attacker can place malicious instructions directly in the first 500 characters of the summary, and ordinary instruction lines can also be copied in ...[truncated 1590 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/skill-lifecycle.py:211
Finding

Draft Skills Can Be Promoted Without Verified Successful Re-Invocations

Content
View full analysis
= PROMOTE_THRESHOLD: skill_name = meta.get("skill_name", draft_name) if not promote_skill(draft_dir, skill_name): logger.error(f"record_invocation: promotion failed for {skill_name}") return False return True ``` The CLI exposes both the unverified counter increment and a direct threshold bypass: ```python elif action == "invoke": if len(sys.argv) < 3: print("Usage: skill-lifecycle.py invoke ") sys.exit(1) record_invocation(sys.argv[2]) print(f"Recorded invocation for {sys.argv[2]}") elif action == "promote": if len(sys.argv) < 3: print("Usage: skill-lifecycle.py promote ") sys.exit(1) draft_dir = AUTO_DRAFT_DIR / sys.argv[2] if draft_dir.exists(): meta = load_meta(draft_dir) skill_name = meta.get("skill_name", sys.argv[2]) if promote_skill(draft_dir, skill_name): print(f"Promoted {skill_name}") else: print("Promotion failed") ``` ### Technical Analysis The lifecycle design claims that a draft requires three successful re-invocations before promotion. However, `record_invocation()` increments `invocation_count` solely because the CLI command was called. It does not verify that the skill was actually invoked, that exec ...[truncated 1739 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/skill-lifecycle.py:72
Finding

Path Traversal in Draft Invocation and Promotion Operations

Content
View full analysis
bool: """Atomic promotion with rollback protection.""" try: dest_dir = AUTO_DIR / skill_name # Check collision if dest_dir.exists() and any(dest_dir.iterdir()): logger.error(f"Skill '{skill_name}' already exists. Aborting.") return False ``` The invocation path is constructed directly from a CLI argument: ```python def record_invocation(draft_name: str): """Record that a draft skill was used.""" draft_dir = AUTO_DRAFT_DIR / draft_name if not draft_dir.exists(): return False meta = load_meta(draft_dir) meta["invocation_count"] = meta.get("invocation_count", 0) + 1 meta["last_used"] = datetime.now().isoformat() save_meta(draft_dir, meta) ``` The manual promotion path also trusts the CLI argument and mutable metadata: ```python elif action == "promote": if len(sys.argv) < 3: print("Usage: skill-lifecycle.py promote ") sys.exit(1) draft_dir = AUTO_DRAFT_DIR / sys.argv[2] if draft_dir.exists(): meta = load_meta(draft_dir) skill_name = meta.get("skill_name", sys.argv[2]) if promote_skill(draft_dir, skill_name): print(f"Promoted {skill_name}") else: print("Promotion failed") else: print(f"Draft not found: {sys.argv[2]}") ``` ### Technical Analysis The script does not validate `draft_name`, `sys.argv[2]`, or the `skill_name` loaded from `meta.json`. Python `pathlib` composition does not confine paths to the left-hand directory: - `..` components can traverse above the intended root. - An absolute right ...[truncated 2237 chars]
Remediation
View remediation
Path: if not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", name): raise ValueError("Invalid skill name") root = root.resolve() candidate = (root / name).resolve() if candidate.parent != root: raise ValueError("Path escapes the permitted directory") return candidate ``` 5. Do not trust `skill_name` stored in mutable `meta.json`; derive the canonical name from a validated directory name or verify both values match. 6. Reject symlinks for draft directories and sensitive files, and use file operations designed to resist time-of-check/time-of-use races where practical. 7. Before `shutil.rmtree()`, repeat the resolved containment check and ensure the target is a direct child of `AUTO_DRAFT_DIR`. 8. Run the lifecycle process under an operating-system account with write access only to the required skill directories. 9. Add tests covering absolute paths, nested traversal, symlinks, crafted metadata, and destination collisions. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly describes automatic creation of draft skills and later promotion to active skills based on observed agent behavior, which modifies the user's skill set and filesystem without an explicit consent/approval step. Even if intended as productivity automation, autonomous persistence and activation of new capabilities can create an unsafe trust boundary: mistaken, overbroad, or adversarially influenced drafts may become active and affect future agent behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The security note states that transcript content is not persisted to disk, but the code derives persistent artifacts from transcript data via transcript_summary in generate_skill_name() and stores that result in directory names, SKILL.md, meta.json, and the queue file. Even if the full transcript is not written, sensitive terms, identifiers, or customer/project names from the summary can be retained on disk, creating a privacy and data-handling mismatch that can expose information and mislead operators about actual storage behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script automatically creates draft skill directories and writes SKILL.md and meta.json into the workspace whenever its extraction criteria are met, without any user confirmation, approval gate, or even an explicit warning in its output beyond returning JSON. Because the content is derived from transcript_summary and tags, a subagent or upstream component can cause persistent files to be created in the operator's workspace, which is a risky side effect and can enable unwanted persistence, workspace pollution, or seeding of later-consumed content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

process_drafts can automatically promote drafts or archive them based on metadata thresholds, which results in moving directories and, for promotion, deleting the original draft directory. The code reports summary results afterward, but there is no prior user-facing warning in the CLI that process will modify the filesystem and may remove draft directories from their original location.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The promote CLI action triggers promote_skill, which moves files into the auto skills directory and deletes the original draft via shutil.rmtree. Although the module has general docstrings and logs, the user-facing CLI path does not warn that promotion is destructive or irreversible before performing it.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module-level documentation and CLI output imply a safer or different default workspace behavior, but the code actually defaults AUTO_SKILL_WORKSPACE to the hardcoded absolute path "/home/wahaj/.openclaw/workspace" when the environment variable is unset. This directly conflicts with the help text at L243 that says the default is the current directory, which can mislead operators about what filesystem location will be read and modified.

Content

No source excerpt is available for this finding.