Back to skill

Security audit

wx-112

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned but needs review because it can persistently record conversation-derived learnings and promote them into future agent instructions using broad automatic triggers.

Install only if you want persistent self-improvement memory. Keep hooks opt-in and scoped, avoid user-level always-on hook configuration, review every proposed write to agent instruction files, and do not promote conversation-derived content into CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, or Copilot instructions without trusted human approval.

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
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
scripts/activator.sh:8
Finding

Recurring Agent-Context Instruction Injection

Content
View full analysis
After completing this task, evaluate if extractable knowledge emerged: - Non-obvious solution discovered through investigation? - Workaround for unexpected behavior? - Project-specific pattern learned? - Error required debugging to resolve? If yes: Log to .learnings/ using the self-improvement skill format. If high-value (recurring, broadly applicable): Consider skill extraction. EOF ``` From `hooks/openclaw/handler.js:8-26,45-52`: ```javascript const REMINDER_CONTENT = ` ## Self-Improvement Reminder After completing tasks, evaluate if any learnings should be captured: **Log when:** - User corrects you → \`.learnings/LEARNINGS.md\` - Command/operation fails → \`.learnings/ERRORS.md\` - User wants missing capability → \`.learnings/FEATURE_REQUESTS.md\` - You discover your knowledge was wrong → \`.learnings/LEARNINGS.md\` - You find a better approach → \`.learnings/LEARNINGS.md\` **Promote when pattern is proven:** - Behavioral patterns → \`SOUL.md\` - Workflow improvements → \`AGENTS.md\` - Tool gotchas → \`TOOLS.md\` Keep entries simple: date, title, what happened, what to do differently. `.trim(); // Inject the reminder as a virtual bootstrap file // Check that bootstrapFiles is an array before pushing if (Array.isArray(event.context.bootstrapFiles)) { event.context.bootstrapFiles.push({ path: 'SELF_IMPROVEMENT_REMINDER.md', content: REMINDER_CONTENT, virtual: true, }); } ``` ### Technical Analysis The skill provides hooks that place skill-controlled imperative instructions directly into the agent's prompt ...[truncated 2243 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:366
Finding

Persistent Poisoning of Automatically Loaded Agent Instruction Files

Content
View full analysis
= 3` - Seen across at least 2 distinct tasks - Occurred within a 30-day window Promotion targets: - `CLAUDE.md` - `AGENTS.md` - `.github/copilot-instructions.md` - `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable Write promoted rules as short prevention rules (what to do before/while coding), not long incident write-ups. ``` From `SKILL.md:462-469`: ```markdown ## Best Practices 1. **Log immediately** - context is freshest right after the issue 2. **Be specific** - future agents need to understand quickly 3. **Include reproduction steps** - especially for errors 4. **Link related files** - makes fixes easier 5. **Suggest concrete fixes** - not just "investigate" 6. **Use consistent categories** - enables filtering 7. **Promote aggressive ...[truncated 2881 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:56
Finding

Manual Installation from an Unpinned Mutable Git Repository

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is about maintaining and using a learning/correction log for continuous improvement, especially after failures, corrections, or outdated knowledge. The supplied code does something materially different: it creates a new skill scaffold on disk under ./skills (or another relative output directory) and writes a templated SKILL.md file. While the template references a 'learning entry' and original learnings file, the script itself does not capture learnings, record errors/corrections, review prior learnings, or trigger on the described situations. Its primary purpose is skill extraction/scaffolding, not learning management. Therefore the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · references/hooks-setup.md (reported line 48)May include surrounding context.

Option 2: User-Level Configuration

Add to ~/.claude/settings.json for global activation:

json
{

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · references/openclaw-integration.md (reported line 181)May include surrounding context.

sessions_send

Send message to another session:

text
sessions_send(sessionKey="session-id", message="Learning: API requires X-Custom-Header")

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation guidance is very broad and can cause the skill to trigger on routine conversation patterns such as corrections, missing capabilities, or generic failures. Over-broad activation increases the chance the agent writes persistent logs or modifies workspace files when the user did not clearly request memory-like behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

The skill instructs creation of persistent files under ~/.openclaw/workspace/.learnings, which introduces cross-session retention of user interactions, errors, and derived metadata. Even though the skill warns against logging secrets, persistent storage of conversation-derived content still creates confidentiality and privacy risk, especially in shared or insufficiently trusted environments.

Content

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

└── FEATURE_REQUESTS.md

text

### Create Learning Files

```bash
mkdir -p ~/.openclaw/workspace/.learnings

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The feature-request trigger phrases are common user utterances and are not scoped to clear requests for persistent logging. This can cause the agent to interpret ordinary brainstorming as a signal to write durable records, creating privacy and consent issues and potentially polluting project state.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · references/examples.md (reported line 301)May include surrounding context.

When the above learning is extracted as a skill, it becomes:

File: skills/docker-m1-fixes/SKILL.md

markdown
---

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 · references/hooks-setup.md (reported line 15)May include surrounding context.

Option 1: Project-Level Configuration

Create .claude/settings.json in your project root:

json
{

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file documents "matcher": "" for UserPromptSubmit, which means the hook activates for any prompt rather than a constrained class of requests. That is an ambiguous and overly broad trigger scope likely to overlap with normal everyday usage, increasing unintended invocations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The guide suggests adding the hook to ~/.claude/settings.json for global activation while again using an empty matcher. Because this applies across all sessions and prompt types, the activation condition is insufficiently specific and may cause the skill to run in contexts where self-improvement capture is not intended.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Codex CLI section repeats the same UserPromptSubmit configuration with an empty matcher, causing the hook to activate for any submitted prompt. In a markdown setup guide, this is a vague trigger because it lacks specificity about intended contexts and exclusions.

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 · references/openclaw-integration.md (reported line 57)May include surrounding context.

openclaw hooks enable self-improvement

text

### 3. Create Learning Files

Create the `.learnings/` directory in your workspace:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The 'Detection Triggers' section lists very general conditions such as 'Knowledge gaps', 'API errors', and user corrections without clearly defining thresholds, exclusions, or when the skill should not act. In a markdown integration guide, these broad natural-language triggers can overlap with many ordinary interactions and make activation scope ambiguous.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

Although labeled as lower overhead, the minimal setup continues to use "matcher": "", so the hook remains active for every prompt. The documentation does not clarify boundaries or provide negative examples for when the hook should not trigger.

Content

No source excerpt is available for this finding.