Back to skill

Security audit

self-improving-meta

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed meta-logging and reminder tool, with user-gated helpers for creating learning files and skill scaffolds.

Install only if you want persistent infrastructure learning logs. Keep .learnings entries redacted, enable hooks only per project, avoid the optional PostToolUse output detector in untrusted workspaces, and review generated SKILL.md files before keeping or publishing them.

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/extract-skill.sh:97
Finding

Symbolic-Link Bypass of Output Directory Containment

Content
View full analysis
"$SKILL_PATH/SKILL.md" << TEMPLATE ``` ### Technical Analysis The script attempts to confine generated skills to a relative directory by rejecting absolute paths and lexical `..` path segments. This validation does not resolve the destination to its canonical filesystem path and does not reject symbolic links. A relative path can therefore pass the lexical checks while resolving outside the current project. For example, if `./skills` or a component supplied through `--output-dir` is a symbolic link to another writable directory, `mkdir -p` and shell redirection follow that link. The script then creates a skill directory and `SKILL.md` outside its documented containment boundary. The skill-name validation prevents direct path separators in the skill name, and the existing-directory check limits straightforward overwrites. Nevertheless, neither protection prevents out-of-project file creation through a symbolic-linked parent directory. ### Attack Path 1. An attacker who can modify the project workspace creates a symbolic link in an accepted relative output path, for example: ```bash ln -s /tmp/attacker-controlled-output skills ``` 2. A user or agent runs the documented write operation: ```bash ./scripts/extract-skill.sh generated-skill --write ...[truncated 1287 chars]
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is consistent with the general theme of infrastructure-learning/log-only reminders and it does not edit protected files. However, the declared description says project hooks fire only on explicit meta signals, and the optional bootstrap hook is session-start and not matcher-gated. This code instead appears to run on every UserPromptSubmit, which is a materially different trigger and broader activation pattern. It also explicitly directs logging to .learnings/, which is more specific resource access than the empty declared permissions suggest. Therefore the description does not accurately represent the actual hook behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says the skill is for logging agent-infrastructure issues and is log-only by default, with strong emphasis that it must not edit files unless the user requests a reviewed diff in-session. The supplied code is not an issue logger or hook-triggered monitor at all; its primary function is to generate a meta-skill scaffold. Although it is dry-run by default and requires an explicit flag to write, its actual behavior is file creation (mkdir and writing SKILL.md), which is materially different from logging infrastructure issues. This is a clear purpose mismatch, not just an implementation detail.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 463)May include surrounding context.

md
4. **Version prompt files** — track what changed and when
5. **Audit hooks monthly** — silent failures are the worst failures
6. **Prune memory aggressively** — stale entries cause drift
7. **Write skill descriptions as trigger conditions**, not feature lists
8. **Use structured formats** (tables, lists) over prose in prompt files
9. **Quote the problematic instruction** verbatim when logging ambiguity
10. **Log first, patch only on request** — never silently change prompt files, hooks, memory, or skills

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Extracted skills are untrusted until a human reviews the generated `SKILL.md`. Do not keep or publish an extracted skill without explicit user approval.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The security section claims the scripts 'only output text' and 'don't modify files or run commands,' yet the hook configuration explicitly executes shell scripts via command hooks. This mismatch can cause users to under-trust the risk of enabling hooks, leading them to run code with the agent's permissions under a false assumption of safety.

Content

No source excerpt is available for this finding.

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/extract-skill.sh (reported line 26)May include surrounding context.

sh
Options:
  --dry-run      Show what would be created without creating files (default)
  --write        Write SKILL.md under the output directory (requires explicit user request)
  --output-dir   Relative output directory under current path (default: ./skills)
  -h, --help     Show this help message

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
87% confidence
Finding

The skill instructs creation of persistent files under ~/.openclaw/workspace/.learnings, which modifies session-persistent state outside the immediate task context. Even though the intent is benign logging, persistence can accumulate sensitive operational details across sessions and may violate least-privilege expectations if enabled without explicit consent.

Content

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

└── FEATURE_REQUESTS.md

text

### Create Learning Files

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

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation repeatedly says Claude/Codex hooks should fire only on explicit meta signals and warns against generic matching. But the Advanced Setup config uses PostToolUse with matcher Bash, which would trigger on every Bash tool use, not just explicit meta signals, and then inspect output for meta-related terms. That directly conflicts with the stated intent-level restriction on hook activation scope.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% 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 · SKILL.md (reported line 647)May include surrounding context.

md
### Ownership Rules
- This skill writes only to `.learnings/meta/` in stackable mode.
- It may read other skill folders for cross-linking, but should not rewrite their entries.
- Standalone mode writes to this project's `.learnings/*.md` log files only.
- Stackable mode writes only to the namespaced folder above and must not rewrite other skills' log entries.
- Promotion into `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `MEMORY.md`, rules, hooks, or generated skills is not a logging write. Show a reviewed diff and apply only after explicit user approval.

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/examples.md (reported line 26)May include surrounding context.

md
wildly inconsistent behavior across sessions.

### Suggested Action
Rewrite the delegation rule with explicit thresholds:
- "Delegate to a sub-agent when a task requires more than 8 tool calls OR
  involves modifying files in 3+ directories OR touches both frontend and backend."

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest frames this skill as log-only by default and tightly limits when it may edit files, especially protected prompt/governance files. This guide explicitly introduces an extract-skill.sh --write mode, which indicates a broader file-writing capability than the manifest's core logging/reminder purpose and is not clearly scoped here to the same reviewed-diff constraints.

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 50)May include surrounding context.

Do not copy into ~/.openclaw/hooks/ (user-global). Keep hooks in this workspace:

bash
mkdir -p .openclaw/hooks
cp -r hooks/openclaw .openclaw/hooks/self-improving-meta

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The decision tree conflicts with the surrounding rule that governed files should only be changed after explicit user approval of a reviewed diff. By instructing direct updates to rule files and hook code, it can normalize unauthorized prompt or policy modification, which is risky because this skill operates in the sensitive control-plane for agent behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest for self-improving-meta emphasizes log-only behavior by default and says it does not edit skills unless the user requests a reviewed diff in the current session. This script's non-dry-run path creates directories and writes a new SKILL.md scaffold, which is a direct file-modifying capability rather than logging-only behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Earlier documentation states the optional OpenClaw agent:bootstrap hook is not matcher-gated, while the Hook Integration section later says 'Never use an empty matcher.' Those statements create an intent-level contradiction about acceptable hook configuration, especially because bootstrap hooks commonly lack matchers by design.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The header comment states 'Writes SKILL.md only with --write', implying the write side effect is limited to a single file. In practice, the script also executes mkdir -p "$SKILL_PATH", creating the target directory as an additional filesystem modification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.