Back to skill

Security audit

Firm Hebbian Memory

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned but should be reviewed because it can continuously ingest future session logs into persistent local memory.

Install only if you are comfortable with this skill building a persistent local memory from your agent session logs. Avoid enabling the cron option unless you have reviewed the hook, limited the session paths, added stronger secret scanning, and know how to disable and remove the scheduled job and stored database.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (2)

T06 · System Persistence

Warning
Location
SKILL.md:151
Finding
Recurring Cron Hook Creates Cross-Session Persistence<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 151-157 **Vulnerability Type**: Scheduled execution and persistent session-log processing **Risk Level**: Medium ### Complete Code Snippet ```bash ### Option B — Entrée cron (automatisation passive) ```bash # Toutes les 30 min, ingérer les nouveaux JSONL */30 * * * * /bin/bash ~/.openclaw/hooks/post-session.sh >> ~/.openclaw/hebbian-harvest.log 2>&1 ``` ``` ### Technical Analysis The documented installation procedure directs users to create a cron entry that runs the post-session harvesting hook every 30 minutes. Unlike an explicitly invoked audit or memory operation, this scheduled task survives the original skill run and continues accessing session logs in future sessions. The task executes with the permissions of the user who installed the cron entry. It also relies on the mutable file `~/.openclaw/hooks/post-session.sh`. If that file is subsequently modified or replaced, cron will execute the altered content automatically without obtaining fresh user approval. This creates a durable execution path even though the documented intent is passive memory ingestion. The supplied cron entry does not include integrity verification, restrictive ownership checks, a bounded lifetime, or removal instructions. ### Attack Path 1. A user follows the documentation and installs the supplied cron entry. 2. Cron invokes `~/.openclaw/hooks/post-session.sh` every 30 minutes. 3. The hook repeatedly locates and processes newly created JSONL session logs. 4. The behavior continues across sessions and system restarts for as long as the cron entry remains installed. 5. If an attacker or another process with write access to the hook modifies it, the modified commands execute on the next cron interval under the installing user's account. ### Impact Assessment The scheduled task obtains no privileges beyond those of the user who installed it. Within that user's security context, however, it can continuou ...[truncated 261 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the recurring cron installation option and require explicit, per-session user invocation. - If automation is necessary, use a narrowly scoped, auditable scheduler configuration with a documented expiration or disable mechanism. - Store the hook in a protected location and require that it be owned by the expected user and not writable by groups or other users. - Verify the hook's integrity before every scheduled execution, such as by checking a pinned cryptographic digest. - Run harvesting under a dedicated least-privileged account that can read only the intended session directory and write only to the required database. - Limit processing to newly completed sessions and maintain a secure ingestion ledger to avoid unrestricted recurring scans. - Provide explicit installation, status, disablement, and complete removal instructions. - Require affirmative user consent before enabling access to future session logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:91
Finding
Known Secret-Detection Gaps Can Persist Credentials in Local Storage<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 91-97 and 112-116 **Vulnerability Type**: Incomplete secret redaction before persistent storage **Risk Level**: Medium ### Complete Code Snippets ```text ### Limitations connues (PII) Le stripping regex couvre les catégories les plus courantes (10 patterns) mais ne détecte pas les credentials embarqués dans des URLs de connexion (e.g. `postgres://user:password@host/db`) ni les variables d'environnement loguées dans des stack traces (`DB_URL=...`). Un scanner de secrets dédié (e.g. `trufflehog`, `detect-secrets`) est recommandé en complément pour les environnements à haute sensibilité. ``` ```text [ openclaw_hebbian_harvest ] → extrait résumé + tags + règles (PII stripped) ↓ [ SQLite local ] → stockage épisodique structuré ↓ [ openclaw_hebbian_analyze ] → clustering Jaccard + co-activations ``` ### Technical Analysis The documented harvesting pipeline processes session logs and persists episodic information in a local SQLite database. The documentation expressly acknowledges that its regex-based stripping does not detect credentials embedded in connection URLs or environment-variable values included in stack traces. PII filtering and secret detection are different controls. A fixed list of regular expressions for emails, telephone numbers, IP addresses, and selected token formats does not reliably detect arbitrary passwords, database URLs, newly introduced token formats, or key/value pairs containing credentials. Consequently, the pipeline may treat a session as sanitized even when sensitive authentication material remains. Persistent SQLite storage increases the lifetime and exposure surface of any missed secret. Copies may also propagate into backups, snapshots, diagnostic exports, or downstream analysis results. ### Attack Path 1. A session log records a stack trace, command output, or diagnostic message containing a value such as `postgres://user:password@hos ...[truncated 1199 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Treat dedicated secret scanning as a mandatory ingestion gate rather than an optional recommendation for sensitive environments. - Reject or quarantine a session whenever secret scanning is unavailable, fails, or produces an uncertain result. - Detect and redact URI user information, including usernames and passwords in database and service connection strings. - Detect arbitrary environment-style assignments using key-name heuristics for terms such as `PASSWORD`, `TOKEN`, `SECRET`, `API_KEY`, and `DATABASE_URL`. - Combine format-based patterns, entropy analysis, provider-specific detectors, and an allowlist to reduce both false negatives and false positives. - Perform scanning before summarization, embedding generation, database insertion, logging, or error reporting. - Encrypt the episodic database at rest, apply restrictive filesystem permissions, and separate encryption keys from stored data. - Define a short retention period and provide secure deletion for raw and derived session records. - Prevent sensitive values from being copied into logs, backups, embeddings, analysis output, or Git snapshots. - Add automated tests covering credential-bearing URLs, environment-variable dumps, multiline stack traces, encoded tokens, and representative provider credentials. - If a secret is detected after ingestion, delete affected records and derived artifacts, rotate embeddings where applicable, and immediately revoke or rotate the exposed credential. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (2)

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This markdown file contains user-facing instructions and operational guidance exclusively in French, including setup, safety notes, and usage details. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicit and justified, which is not stated here.

External Transmission

Medium
Category
Data Exfiltration
Content
SESSION_LOG="${1:-$(ls -t ~/.openclaw/sessions/*.jsonl 2>/dev/null | head -1)}"
[ -z "$SESSION_LOG" ] && exit 0

# Appel MCP via curl (le serveur doit tourner sur :8012)
curl -s -X POST http://localhost:8012/mcp \
  -H "Content-Type: application/json" \
  -d "{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.