Back to skill

Security audit

OpenClaw MongoDB Semantic Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a clearly disclosed long-term memory skill, with expected persistence and local daemon behavior, but users should understand automatic memory capture before enabling it.

Install this only if you want an agent to keep searchable memories across sessions. Review or disable automatic hooks if conversations may include secrets, regulated data, or untrusted user content, and prefer pinned/reviewed plugin versions with a constrained local or containerized daemon.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (2)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:194
Finding
Automatic Persistent Memory Capture Enables Cross-Session Memory Poisoning<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 194-212 **Vulnerability Type**: Automatic storage and reinjection of insufficiently trusted conversational content **Risk Level**: Medium ### Complete Code Snippet ```markdown ### `auto-remember` Hook Fires after every agent response. Extracts facts, decisions, and preferences using pattern matching: - "I prefer..." → stored as preference - "We decided..." → stored as decision - "Remember that..." → stored as fact - "Key: value" patterns (structured data) **Limits:** Max 5 extractions per message, min 10 chars, deduplicates. ### `session-to-memory` Hook Fires when starting a new session. Summarizes the ending session and stores it as a searchable memory. ### `memory-bootstrap` Hook Fires on agent startup. Queries for relevant memories (preferences, recent decisions, pinned items) and injects them into context. ### `memory-enriched-tools` Hook Fires before tool results are saved. Appends related memories as context annotations to Read/Grep/Glob/Bash outputs. **To disable hooks:** Set `hooksEnabled: false` in plugin config. ``` ### Technical Analysis The documented hooks automatically extract and persist content after every agent response. The extraction rules include broad patterns such as `"Remember that..."` and `"Key: value"`, without documenting validation that distinguishes trusted facts from attacker-supplied instructions, secrets, or adversarial text. The stored data is subsequently injected into the agent's startup context and appended to tool results. This creates a cross-session trust-boundary issue: content originating in an untrusted conversation can become persistent state and later appear in a context where the agent may treat it as authoritative. Although `SKILL.md` advises users not to store credentials, that guidance is not an enforceable control. The documentation does not specify secret detection, instruction filtering, source attribution, user confirmation, inte ...[truncated 1488 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Disable automatic capture by default and require explicit user or administrator opt-in. 2. Require confirmation before storing extracted facts, preferences, decisions, or session summaries. 3. Treat every retrieved memory as untrusted data and clearly delimit it from system and developer instructions. 4. Reject or neutralize content that resembles agent directives, tool commands, policy overrides, or role instructions. 5. Add secret and personal-data detection before persistence, covering API keys, tokens, passwords, private keys, connection strings, and regulated personal information. 6. Replace broad pattern matching such as `Key: value` with a strict schema and allowlisted memory categories. 7. Record source identity, tenant, session, timestamp, confidence, and consent metadata for every memory. 8. Enforce tenant and user isolation in all search, bootstrap, listing, and enrichment operations. 9. Do not append memories automatically to Bash or other high-impact tool results. Require explicit retrieval and preserve provenance labels. 10. Provide user-visible review, correction, deletion, retention, and audit controls. 11. Apply short retention periods by default and encrypt persisted memories in transit and at rest. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:360
Finding
Unpinned Third-Party Plugin and Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 360-369 **Vulnerability Type**: Unversioned third-party installation and mutable dependency resolution **Risk Level**: Medium ### Complete Code Snippet ```markdown ## Installation ```bash # Install plugin openclaw plugins install openclaw-memory # Start daemon cd openclaw-memory pnpm install && pnpm dev:daemon ``` ``` ### Technical Analysis The installation procedure identifies the plugin only by name and does not pin an exact version, immutable source commit, or integrity hash. The subsequent `pnpm install` command also does not require frozen lockfile resolution or verify package provenance. Consequently, the code installed and executed in the future may differ from the version reviewed when this Skill was published. Package-manager lifecycle scripts may run during dependency installation, while `pnpm dev:daemon` directly starts the installed daemon. A compromised plugin release, package registry account, transitive dependency, or mutable dependency range could therefore introduce unreviewed executable code. The available project contains only `SKILL.md`; no malicious dependency or embedded executable payload was observed. This finding concerns the unsafe, non-reproducible installation process documented by the Skill. ### Attack Path 1. An attacker compromises the plugin distribution source, publisher account, or one of its transitive dependencies. 2. The attacker publishes a malicious release under the expected package or plugin identity. 3. A user follows the documented `openclaw plugins install openclaw-memory` command without selecting a reviewed version. 4. `pnpm install` resolves the current dependency graph and may execute package lifecycle scripts. 5. The user runs `pnpm dev:daemon`, executing the newly installed and potentially compromised code under the user's local privileges. ### Impact Assessment A compromised dependency can execute with the privileges of the accou ...[truncated 463 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the plugin to an exact reviewed version or immutable source commit. 2. Publish cryptographic checksums or signatures and verify them before installation. 3. Commit the dependency lockfile and install with a frozen-lockfile option, such as `pnpm install --frozen-lockfile`. 4. Configure the package manager to use an explicit trusted registry and verify package provenance where supported. 5. Review transitive dependencies and package lifecycle scripts before deployment. 6. Disable installation scripts when they are unnecessary, or allowlist the scripts that must run. 7. Run the daemon as a dedicated unprivileged account or in a restricted container with minimal filesystem and network access. 8. Avoid exposing unrelated credentials or sensitive environment variables to installation and daemon processes. 9. Document a reproducible installation procedure and a security update policy for pinned versions. ]]>
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)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill explicitly describes automatic cross-session capture of user statements, decisions, and preferences, but does not present a clear consent, privacy, or data-minimization warning alongside that behavior. In an agent context, this can lead to persistent retention of sensitive personal or business information without informed user awareness, increasing privacy and compliance risk.

External Transmission

Medium
Category
Data Exfiltration
Content
## Troubleshooting

**"Memory daemon not reachable"**
- Check daemon is running: `curl http://localhost:7654/health`
- Start daemon: `cd openclaw-memory && pnpm dev:daemon`
- Or use Docker: `docker compose up -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.