Back to skill

Security audit

Self-Improving Agent (ORBIT)

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent self-improvement logger, but it encourages persistent memory, broad hooks, and cross-session sharing without enough privacy scoping or user-control guardrails.

Install only if you want a persistent local learning/memory workflow. Before enabling hooks, prefer project-level configuration, replace empty matchers with narrower triggers, review the shell scripts, keep `.learnings/` out of version control unless intended, and avoid storing secrets, personal data, transcripts, credentials, proprietary details, or raw error output that may contain sensitive information.

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:107
Finding

Symbolic-Link Traversal Allows Writes Outside the Intended Workspace

Content
View full analysis

Vulnerability Details

File Location: scripts/extract-skill.sh, lines 107–121 and 171–177
Vulnerability Type: Symbolic-link path traversal and time-of-check/time-of-use weakness
Risk Level: Medium

Vulnerable Code

bash
# Validate output path to avoid writes outside current workspace.
if [[ "$SKILLS_DIR" = /* ]]; then
    log_error "Output directory must be a relative path under the current directory."
    exit 1
fi

if [[ "$SKILLS_DIR" =~ (^|/)\.\.(/|$) ]]; then
    log_error "Output directory cannot include '..' path segments."
    exit 1
fi

SKILLS_DIR="${SKILLS_DIR#./}"
SKILLS_DIR="./$SKILLS_DIR"

SKILL_PATH="$SKILLS_DIR/$SKILL_NAME"

# Create skill directory structure
log_info "Creating skill: $SKILL_NAME"

mkdir -p "$SKILL_PATH"

# Create SKILL.md from template
cat > "$SKILL_PATH/SKILL.md" << TEMPLATE

Technical Analysis

The script claims to constrain --output-dir to the current workspace. It rejects absolute paths and lexical .. path segments, but it does not resolve the canonical destination or inspect path components for symbolic links.

Consequently, a syntactically relative output directory can resolve to a location outside the current workspace. The checks validate only the user-provided string, while mkdir and shell redirection follow symbolic links during filesystem operations.

There is also a time-of-check/time-of-use window because validation and file creation are separate operations. A path component could potentially be replaced with a symbolic link after validation but before directory or file creation.

Attack Path

  1. An attacker who can create or modify entries in the working directory creates a symbolic link pointing outside the workspace:

    bash
    ln -s /home/victim/.config external
    
  2. The extraction helper is invoked using the relative symbolic-link path:

    bash
    ./scripts/extract-skill.sh injected --output-dir external
    
  3. The path passes validation because it is re ...[truncated 1061 chars]

Remediation
View remediation

Remediation Suggestions

  1. Resolve the current workspace to a canonical path before processing the destination:

    bash
    WORKSPACE_ROOT="$(realpath -e .)"
    
  2. Canonicalize the nearest existing parent of the requested output directory and verify that it remains beneath WORKSPACE_ROOT. Perform a path-component-aware comparison rather than a simple textual prefix check.

  3. Reject symbolic links in every existing output-path component. For example, walk each component with lstat or test -L before creating directories.

  4. Revalidate the canonical destination immediately before writing. Do not rely solely on rejecting absolute paths and .. segments.

  5. Reduce the race condition by using descriptor-relative, no-follow filesystem operations where available. A small helper implemented with openat/mkdirat and O_NOFOLLOW would provide stronger protection than ordinary shell redirection.

  6. Refuse existing destinations of unexpected types, including symbolic links and non-directory path components.

  7. Add regression tests covering:

    • An absolute output path.
    • A path containing ...
    • A relative symlink pointing outside the workspace.
    • A nested path containing a symlink component.
    • Replacement of a checked directory with a symlink before creation.
    • A valid relative directory wholly contained within the workspace.
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 (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is about capturing learnings, errors, corrections, and reviewing them to support continuous improvement. The supplied code does not implement learning capture, error/correction logging, review of prior learnings, or any mechanism for recording failed operations or user corrections. Instead, it is a helper utility for creating a new skill scaffold on disk from a skill name, including path validation and template generation. While the comments mention creating a skill from a learning entry and referencing .learnings/LEARNINGS.md in the generated template, the actual behavior is still file/directory scaffolding, not the described continuous-improvement learning system. This is a materially different primary purpose, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Directing users to modify ~/.claude/settings.json establishes persistent control in the agent's global configuration directory. In this context, that is security-relevant because it enables long-lived hook execution across all projects, amplifying the impact of any unsafe script behavior or future script modification.

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

sessions_send

Send message to another session:

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill repeatedly instructs the agent to write conversation-derived content to persistent files but does not require any notice, consent, or redaction step. This can lead to sensitive prompts, personal data, credentials, proprietary project details, or error output being stored locally or in repositories without the user's awareness.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
72% confidence
Finding

The skill promotes creation of persistent workspace storage under ~/.openclaw/workspace/.learnings, which extends retention beyond the current interaction. Persistent memory is not inherently unsafe, but in this context it becomes risky because the skill also encourages storing rich conversation and error context, increasing long-term exposure if the host is shared, synced, or later inspected.

Content

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

└── FEATURE_REQUESTS.md

text

### Create Learning Files

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

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The cross-session features explicitly mention viewing session history, reading transcripts, and sending learnings between sessions, creating a natural path for one session to access or relay data from another. Without strict consent and data-classification controls, this can expose prior user conversations or sensitive project context beyond the original session boundary.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The logging templates encourage storing full context, what was wrong, user feedback, related files, and other metadata in persistent markdown files. That creates a durable data-exfiltration and privacy risk because sensitive interaction details may be recorded verbatim and later read by other agents, users, or committed to source control.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The activation triggers are very broad and based on common conversational phrases, which can cause the skill to run in ordinary chats and persist data unexpectedly. In a system that auto-loads or auto-applies skills, this increases the chance of over-collection, noisy logging, and unintended retention of sensitive user content.

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
---

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file includes an example SKILL.md description stating "Use when docker build fails with platform mismatch errors." While somewhat domain-specific, it does not define trigger scope, allowed phrasings, or exclusion conditions, which can lead to unintended invocation when users discuss Docker build failures generally. Because this is a markdown file containing a manifest-style example, SQP-1 applies.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
77% confidence
Finding

Placing hook configuration in .claude/settings.json at the project root creates session-persistent behavior that automatically reappears in future agent runs. While persistence is not inherently malicious, it is dangerous here because it silently re-enables command hooks and ongoing learning capture unless users explicitly remove or audit the configuration.

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

An empty matcher on UserPromptSubmit causes the hook to trigger on every prompt, creating always-on execution of the configured script. In this skill context, that broad scope increases exposure to unnecessary script execution, data collection from all prompts, and accidental persistence of sensitive or irrelevant context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The user-level configuration installs the hook in ~/.claude/settings.json, making it globally active across projects and sessions with no scope restriction. In combination with an empty matcher, this creates persistent, broad command execution in diverse contexts, increasing the risk of sensitive prompt exposure and unintended cross-project behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Although presented as a 'minimal' setup, the configuration still uses an empty matcher and therefore executes on every prompt. That means the reduced hook count lowers overhead but not the fundamental overbreadth or privacy risk from universal activation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Codex CLI example repeats the same empty-matcher pattern, enabling prompt-wide automatic script execution. Because this is documentation for direct setup, users may copy-paste an insecurely broad configuration into another agent environment without recognizing the scope implications.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document states that the hook scripts 'only output text' and 'don't modify files or run commands,' but the configuration shown throughout the file explicitly invokes shell scripts via command hooks. This is a misleading security claim because any executed shell script can perform arbitrary actions with the agent's privileges, causing users to underestimate the trust and review required before enabling the hooks.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

Creating persistent .learnings/ storage in the workspace or skill directory introduces memory retention without guardrails on content sensitivity, retention period, or review. In this skill's context, persisted learnings may later be reinjected into prompts, causing accidental disclosure of prior session data and long-lived contamination from mistaken or malicious entries.

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:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation encourages promoting learnings into workspace files and sharing them across sessions, but it does not warn against storing secrets, personal data, proprietary code, or untrusted instructions. Because these files are later injected back into future sessions, sensitive or adversarial content can persist and influence subsequent agent behavior beyond the original context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list is broad enough that routine events like generic tool errors, user corrections, or vague 'knowledge gaps' may cause automatic logging of content without a clear relevance or sensitivity check. In a self-improvement skill that writes persistent notes, this increases the chance of over-collection, prompt-injection amplification, and recording sensitive context that was never meant to be retained.

Content

No source excerpt is available for this finding.