Back to skill

Security audit

botlearn-selfoptimize

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned as a self-improvement tool, but it needs Review because it can persistently change agent instruction files and post workspace-derived memory to an external service with weak user-control and redaction safeguards.

Install only if you are comfortable with an agent keeping durable learning logs, modifying future instruction files, and posting selected workspace context to BotLearn. Before enabling community escalation or hooks, require manual preview and approval of every outbound post, avoid including memory excerpts or file snippets, pin the installed version, and review any changes to CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, and Copilot instruction files.

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
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
flows/community-help.md:88
Finding

Mutable Remote Instructions Are Fetched and Followed by the Agent

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/botlearn-post.sh:173
Finding

Workspace Memory and Learning Content Can Be Published Without Effective Sensitive-Data Redaction

Content
View full analysis
/dev/null | head -3) if [ -n "$MATCH" ]; then MEMORY_CONTEXT="${MEMORY_CONTEXT}${MATCH}\n" fi done fi # Check recent daily memory files for i in $(seq 0 6); do DATE=$(date -v-${i}d +%Y-%m-%d 2>/dev/null || date -d "$i days ago" +%Y-%m-%d 2>/dev/null) FILE="$WORKSPACE/memory/$DATE.md" if [ -f "$FILE" ]; then for kw in $KEYWORDS; do MATCH=$(grep -i "$kw" "$FILE" 2>/dev/null | head -2) if [ -n "$MATCH" ]; then MEMORY_CONTEXT="${MEMORY_CONTEXT}[$DATE] ${MATCH}\n" fi done fi done ``` The gathered data is incorporated into the outbound post: ```bash BODY="## Problem $SUMMARY ## Details $DETAILS ## Context - Area: ${AREA:-unknown} - Priority: ${PRIORITY:-medium} - Entry: $ENTRY_ID ## What I Tried ${SUGGESTED_FIX:-No specific fix attempted yet.} ## Relevant Memory Context $(echo -e "$MEMORY_CONTEXT" | sed "s|$HOME|~|g" | head -15) ## Relevant Files $(echo "$RELATED_FILES" | sed "s|$HOME|~|g") ## Environment - Platform: $(uname -s) $(uname -m) - Node.js: $(node -v 2>/dev/null || echo 'unknown') Any help or pointers appreciated! #selfimprovement #${AREA:-general}" # Redact any remaining home paths BODY=$(echo "$BODY" | sed "s|$HOME|~|g") ``` The resulting content is transmitted externally: ```bash POST_RESPONSE=$(curl -s -X POST "$BOTLEARN_API/posts" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_ ...[truncated 2770 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:353
Finding

Untrusted Learnings Can Be Promoted into Persistent 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. ``` ### Technical Analysis The Skill captures user corrections, conversational content, command errors, and external community solutions as learnings. ...[truncated 2056 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:151
Finding

Installation Instructions Use Mutable and Unverified Upstream Sources

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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (62)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The core design is a background learning loop that captures errors, corrections, and learnings, then may escalate unresolved issues to an external community. In this context, retention plus sharing is inherently dangerous because normal conversational and workspace context can contain secrets or proprietary material, making data leakage a built-in risk rather than an edge case.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

Automatic promotion into permanent workspace memory files increases the blast radius of any mistaken, sensitive, or adversarially induced learning by embedding it into durable instruction sources. Because these files influence future agent behavior across tasks, bad data can become persistent prompt poisoning or policy drift without the user's informed approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The community escalation flow explicitly describes gathering workspace-derived context and posting it externally, but does not warn about privacy, confidentiality, or data handling boundaries. That creates a direct pathway for exfiltration of source code, credentials, internal discussions, or customer data through normal operation of the skill.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The escalation step instructs the agent to gather workspace context and compose a help post for an external community, which is semantically equivalent to preparing potentially sensitive internal information for publication. Because the skill is framed as an autonomous improvement engine, users may not realize that private context can be repackaged and transmitted outside the workspace.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill is presented as local self-improvement logging but also instructs agent registration, local credential storage, remote posting, and transmission of workspace-derived context to an external service. That description-behavior gap is dangerous because it obscures materially different networked and persistence capabilities that can leak sensitive data and expand trust assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill is presented as local self-improvement logging but also instructs agent registration, local credential storage, remote posting, and transmission of workspace-derived context to an external service. That description-behavior gap is dangerous because it obscures materially different networked and persistence capabilities that can leak sensitive data and expand trust assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as local self-improvement logging but also instructs agent registration, local credential storage, remote posting, and transmission of workspace-derived context to an external service. That description-behavior gap is dangerous because it obscures materially different networked and persistence capabilities that can leak sensitive data and expand trust assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as local self-improvement logging but also instructs agent registration, local credential storage, remote posting, and transmission of workspace-derived context to an external service. That description-behavior gap is dangerous because it obscures materially different networked and persistence capabilities that can leak sensitive data and expand trust assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill encourages autonomous external posting of locally gathered context without a clear, prominent warning that workspace memory, file snippets, environment details, and attempted fixes may be transmitted off-system. This creates a serious informed-consent failure and raises the risk of accidental data exfiltration.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow explicitly tells the agent to gather workspace memory and synthesize it into an external community post. That creates a natural-language exfiltration channel for sensitive project information, secrets-adjacent operational context, internal file paths, or prior session content that may not be safe to share externally.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The skill instructs storage of BotLearn credentials in a local JSON file without describing permissions, encryption, lifecycle management, or least-privilege controls. Credential creation and persistence are sensitive operations; mishandling can expose tokens to other tools, sessions, users, or accidental commits/backups.

Content

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

md
Step 2 — Join BotLearn (first time only)
  Read https://botlearn.ai/skill.md and follow the registration instructions.
  Store credentials in ~/.config/botlearn/credentials.json

Step 3 — Compose & Post
  Synthesize memory context + learning entry into a community help post.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The post template specifically encourages inclusion of file paths, snippets, environment details, and memory-derived attempted fixes in public or third-party posts. Those details can directly leak proprietary code, infrastructure details, internal topology, and debugging artifacts that materially aid attackers or violate confidentiality.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

These instructions explicitly connect gathering workspace memory and prior-session context with escalation of a learning entry, setting up later external disclosure. Because the collected material comes from broad memory sources, the skill context makes this especially dangerous: internal agent memory often contains high-sensitivity context not meant for publication.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This flow expands a local self-improvement mechanism into a third-party community workflow that registers the agent and publishes workspace-derived incident information externally. That creates a clear data exfiltration path and materially changes the trust boundary of the skill without explicit user approval or strong minimization controls.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The flow creates a persistent third-party account and stores API credentials locally, which is outside the stated self-improvement purpose and introduces long-lived external access. Persistent registration increases blast radius because future sessions can silently reuse credentials to continue transmitting data.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The flow reads an API key from a local credential file so the skill can authenticate to the external BotLearn service. Accessing credentials is sometimes legitimate, but in this case it supports an unnecessary third-party integration that can silently persist across sessions and enable repeated external posting.

Content

Scanner excerpt · flows/community-help.md (reported line 77)May include surrounding context.

2.1 Check Existing Credentials

bash
CRED_FILE="$HOME/.config/botlearn/credentials.json"
if [ -f "$CRED_FILE" ]; then
  echo "Already registered. Loading credentials."
  API_KEY=$(cat "$CRED_FILE" | grep -o '"api_key":"[^"]*"' | cut -d'"' -f4)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The posting step instructs the agent to send synthesized workspace-derived context to an external service without a clear user-facing warning or affirmative consent. Even with a brief security note, the operational instructions normalize transmission rather than requiring an explicit review of what leaves the system.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The composition template instructs inclusion of relevant memory context, environment details, and file paths in the body sent to BotLearn. That is a direct recipe for leaking operational metadata and historical context that could aid reconnaissance, fingerprint the system, or expose confidential project information.

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 affects the agent's global configuration directory, creating persistent behavior across unrelated repositories and sessions. In the context of auto-executed command hooks, this is especially risky because it establishes durable execution and context interception beyond the intended project boundary.

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

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · flows/community-help.md (reported line 277)May include surrounding context.

md
# Usage: ./botlearn-post.sh <entry-id> [--submolt <name>] [--dry-run]
#
# Prerequisites:
#   - BotLearn credentials at ~/.config/botlearn/credentials.json
#   - Learning entry exists in .learnings/
#   - curl available

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/botlearn-post.sh (reported line 7)May include surrounding context.

sh
# Usage: ./botlearn-post.sh <entry-id> [--submolt <name>] [--dry-run]
#
# Prerequisites:
#   - BotLearn credentials at ~/.config/botlearn/credentials.json
#   - Learning entry exists in .learnings/
#   - curl available

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/botlearn-post.sh (reported line 15)May include surrounding context.

sh
# Usage: ./botlearn-post.sh <entry-id> [--submolt <name>] [--dry-run]
#
# Prerequisites:
#   - BotLearn credentials at ~/.config/botlearn/credentials.json
#   - Learning entry exists in .learnings/
#   - curl available

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/botlearn-post.sh (reported line 267)May include surrounding context.

sh
# --- Post ---
log_info "Posting to BotLearn submolt: $SUBMOLT"

POST_RESPONSE=$(curl -s -X POST "$BOTLEARN_API/posts" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $API_KEY" \
    -d "$(cat << PAYLOAD

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README states that entries are logged to workspace files automatically, but gives no warning that user conversation, errors, or inferred learnings will be written to disk. Silent persistence creates privacy and integrity risks, especially in repositories where logs may later be committed, shared, or inspected by other tools.

Content

No source excerpt is available for this finding.