Back to skill

Security audit

Memory Crystal Private

Security checks for vulnerabilities and agentic risk

Overview

Memory Crystal mostly matches a shared-memory product, but it installs persistent capture hooks and has under-disclosed external data flows and verified high-risk implementation flaws.

Review this before installing. It is a persistent memory/capture system, not just a search tool: it can continuously capture AI conversations, modify agent configs, run cron/hooks, index local files if enabled, use 1Password/API keys, and relay encrypted data between machines. Install only if you are comfortable with that scope, prefer local embeddings where possible, verify private-mode and capture-off controls, and avoid relay/file-sync use until the path traversal and command-injection issues are fixed.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
src/file-sync.ts:288
Finding

Arbitrary File Write Through Relay Manifest Path Traversal

Content
View full analysis
(parsed as EncryptedPayload, relayKey); if (manifest.version && manifest.entries) { coreManifest = manifest; } ``` ```ts const delta = compareManifest(coreManifest); // Build a lookup of available file blobs by path const fileBlobMap = new Map(fileBlobs.map(f => [f.path, f])); // Apply upserts let imported = 0; for (const entry of delta.upsert) { const fileBlob = fileBlobMap.get(entry.path); if (!fileBlob) { continue; } try { const content = decrypt(fileBlob.data, relayKey); const actualHash = createHash('sha256').update(content).digest('hex'); if (actualHash !== entry.sha256) { process.stderr.write(`[file-sync] hash mismatch for ${entry.path}, skipping\n`); continue; } const destPath = join(paths.root, entry.path); mkdirSync(dirname(destPath), { recursive: true }); writeFileSync(destPath, content); imported++; } catch (err: any) { process.stderr.write(`[file-sync] failed to write ${entry.path}: ${err.message}\n`); } } ``` ### Technical Analysis The Node accepts paths from an encrypted relay manifest and uses them directly in: ```ts join(paths.root, entry.path) ``` The code does not reject: - Absolute paths - `..` parent-directory components - Paths that normalize outside `paths.root` - Destination paths traversing symbolic links - NUL bytes or other invalid path data Encryption and SHA-256 validation establish that the content came from a party possessing the relay key and that it was not modified in transit. They do not establish that the destination path is safe. For example, a manifest path such as `../../.zshrc` can normalize outside `~/.ldm`. A compromised paired Core, stolen relay encryption key, or malicious authorized peer could therefore cau ...[truncated 1421 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/installer.ts:923
Finding

Shell Command Injection in 1Password Relay Credential Lookup

Content
View full analysis
/dev/null`, { encoding: 'utf8', timeout: 15000 } ).trim(); } ``` ### Technical Analysis Both `saToken` and `agentId` are interpolated into a command string passed to `execSync()`, which invokes a shell. Neither value is shell-escaped: - `saToken` is read from `~/.openclaw/secrets/op-sa-token`. - `agentId` can originate from installation options such as `--agent`. Shell control characters in either value can terminate the intended argument or environment assignment and introduce additional commands. Quoting only the fixed item and vault names does not protect the interpolated values. ### Attack Path One direct path is: 1. An attacker supplies or persuades the user to use a crafted agent identifier containing shell syntax. 2. The user runs Node initialization with that identifier. 3. Initialization finds the OpenClaw service-account token file. 4. The crafted identifier is inserted into the `--fields` portion of the command. 5. `execSync()` passes the resulting string to the shell. 6. The shell executes the injected command with the user's privileges. An alternative path is: 1. An attacker or compromised local component modifies `~/.openclaw/secrets/op-sa-token`. 2. The token content includes shell metacharacters and an additional command. 3. The user runs `crystal init` for a Node. 4. The unquoted token is inserted into the environment-assignment prefix. 5. The injected command executes. ### Impact Assessment Exploitation provides arbitrary command ex ...[truncated 506 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/installer.ts:945
Finding

Relay Bearer Token Written Without Explicit Restrictive Permissions

Content
View full analysis
Remediation
View remediation

other

Warning
Location
SKILL.md:82
Finding

Misleading Privacy Disclosure for Continuous External Transcript Processing

Content
View full analysis
{ return new Promise((resolve, reject) => { const body = JSON.stringify({ input: texts, model }); const req = https.request({ hostname: 'api.openai.com', path: '/v1/embeddings', method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}`, 'Content-Length': Buffer.byteLength(body), }, timeout: 30000, }, (res) => { // ... }); req.write(body); req.end(); }); } ``` The scheduled poller scans Claude Code session files: ```ts for (const projectDir of readdirSync(CC_PROJECTS_DIR)) { // ... for (const file of readdirSync(projectPath)) { if (file.endsWith('.jsonl') && !file.startsWith('.')) { // session is selected for capture } } } ``` ### Technical Analysis The pre ...[truncated 1837 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (1857)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section says the skill scans repos under staff/, writes update files, and auto-commits and pushes them to a remote repository. Those actions can modify local repos and transmit potentially sensitive development metadata, but the README does not include a clear caution or confirmation warning in this section.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

A memory crystal skill has an obvious need to store and search memories, but not to create Git-tracked status reports and push them to wipcomputer/wip-dev-updates. This is a distinct automation capability involving source-control side effects that is not justified by the stated memory-oriented purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explains that every Claude Code turn is auto-captured, chunked, and embedded into local stores. Although private mode is mentioned, there is no strong up-front warning that prompts, assistant replies, and possibly sensitive material will be persistently stored and processed automatically.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill should search and manage shared memory content in response to user requests like remembering, forgetting, or recalling past discussions. The supplied code does none of that runtime memory interaction. Instead, it is an operational deployment script for provisioning and deploying the backend service to Cloudflare. It also accesses external credentials and infrastructure resources not implied by the description. This is a material purpose mismatch, not just an implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is for searching and managing shared memory crystal contents—recalling facts, storing new facts, forgetting entries, and checking memory status in response to user memory-related requests. The supplied code does something materially different: it starts a local API server. Its main functionality is serving /v1/chat/completions, forwarding prompts to the claude executable, triggering background crystal processing jobs through /process, and reporting health/state via /status. While the word 'crystal' appears and /status reports whether a database exists, there are no direct memory CRUD operations, no recall/search endpoints, and no code for remembering or forgetting user facts. This is a primary-purpose mismatch, with significant undeclared capabilities unrelated to the stated user-facing memory tool behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a user-facing memory management skill for searching, recalling, storing, and deleting remembered information from a shared memory crystal. This code does not implement those behaviors. Instead, it is a maintenance/diagnostic routine ('crystal doctor') for validating installation health and configuration. While it pertains to the same broader product ('memory-crystal'), its primary purpose is materially different: operational health checks rather than memory retrieval or mutation. It also accesses system config files, environment variables, shell command output, and deployment metadata, which are inconsistent with the declared conversational-memory behavior. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a user-facing memory retrieval and management skill: searching memory contents, remembering facts, forgetting items, and reporting memory status. The actual code does not perform semantic memory search, fact storage/retrieval, conversational recall, or memory querying. Instead, it is infrastructure code for synchronizing files under ~/.ldm between systems using manifests, SHA-256 hashing, encryption, and relay endpoints. While this may support a broader memory system, its primary purpose is file replication/synchronization, which is a materially different capability from the declared memory search/manage behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description suggests a runtime memory retrieval/manipulation skill triggered by user requests like 'remember this' or 'search memory.' However, this code does not implement memory querying, storing, forgetting, or status lookup for user conversations. Its primary purpose is operational installation and update orchestration for the memory-crystal extension ecosystem. While it touches the memory database for backup/import/readability verification, that is part of deployment safety, not user-facing memory management. This is a material purpose mismatch with several undeclared system-modifying capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared purpose is a memory-management skill for searching, remembering, forgetting, and inspecting stored memory. This code chunk does not perform any memory CRUD or shared-memory operations. Its primary function is an LLM backend cascade used to expand search queries and rerank passages. While such functionality could support a memory search system, this chunk materially differs from the declared user-facing purpose because it instead handles provider detection, secret retrieval, remote/local model calls, and reranking logic. Those are significant undeclared capabilities and resource accesses, especially external API usage and secret access. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for a user-facing memory management/search skill that should recall, store, forget, or report memory contents. This code does not implement memory search or management operations. Instead, its primary purpose is ingesting and parsing OpenClaw session log files for backfill processing. It accesses local filesystem resources, reads raw JSONL logs, and transforms them into an ExtractedMessage structure. That is a materially different function from managing a shared memory crystal. While such parsing could be a supporting component of a memory system, this code chunk itself is not performing the declared user-facing memory operations, so the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about memory retrieval and management operations such as remembering, searching memory, forgetting facts, and reporting memory status. The supplied code does not implement memory search, recall, storage, deletion, or inspection of conversation facts. Instead, it determines deployment/runtime role for the crystal system, inspects configuration via env vars and files, and writes a role override state file for promotion/demotion. This is a materially different primary purpose and introduces undeclared capabilities around configuration/state management, so it is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description frames this skill as an interactive memory search/manage capability triggered by user requests like remembering, forgetting, or recalling prior facts. The supplied code does not implement those user-facing memory operations directly. Instead, it acts as a scheduled background capture script that launches a poller to ingest session logs from disk into the memory system and export markdown artifacts. That is a materially different primary purpose from searching/managing memory on demand. While ingestion can support a memory feature, this code chunk specifically performs undeclared background data capture, file processing, export, and secret-backed API usage, which are not reflected in the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is for end-user memory operations like searching, remembering, forgetting, and checking stored conversation facts. The supplied code does not implement any memory query or management behavior for users. Instead, it is an operational deployment script for provisioning and deploying the Memory Crystal cloud backend. While this backend may support the described memory functionality indirectly, the code chunk itself performs infrastructure setup, secret handling, and deployment tasks that are materially different from the declared purpose. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is a clear mismatch. The declared description says the skill should search and manage shared memory for conversational recall operations such as remembering, forgetting, or checking what is known. The supplied code does none of that. Instead, it performs system-level backup of the ~/.ldm directory to timestamped snapshot folders, safely copying a SQLite database and other directories, and pruning older backups. Its primary purpose is backup/maintenance, not memory retrieval or memory editing in response to user requests. It also touches additional resources like config, state, agents, and optional secrets, which are not represented in the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill manages shared memory content: recalling past discussions, storing facts, forgetting items, and checking memory status. The supplied code does none of that. Instead, it is infrastructure/setup code for detecting and registering a lesa-bridge MCP server with Claude Code/Desktop. This is a materially different primary purpose and introduces undeclared capabilities such as shell command execution and configuration file modification. Therefore the description does not accurately represent the code's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description suggests a user-facing memory retrieval and management capability: searching memory, remembering facts, forgetting entries, and reporting memory status. The supplied code does none of that. Instead, it is an import/synchronization utility that copies raw files from source locations into LDM directories, with optional recursive copying of workspace Markdown files. Its primary purpose is transcript/workspace file migration or backfill, not memory search, storage, deletion, or recall. While this may support a broader memory system indirectly, the chunk’s actual behavior is materially different from the declared purpose and includes undeclared filesystem-copy capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description suggests a skill whose purpose is to help search and manage a shared memory crystal in response to user prompts like 'remember this' or 'search memory.' The supplied code does not implement search, recall, forget, or memory-status retrieval for a user. Instead, its main function is passive/automatic memory capture and synchronization: it processes Claude Code transcript files, ingests conversation content into memory, archives transcripts, writes logs/summaries, and may transmit encrypted data to a relay. Those are materially different primary behaviors and include undeclared filesystem scanning and remote relay transmission. While ingesting memory is related to a memory system, the actual behavior is not accurately represented by the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests an interactive memory-management skill used when a user asks to remember, forget, or search memory. The code does not implement user-facing memory search, recall, forgetting, or direct memory management operations. Instead, its primary purpose is continuous background capture and processing of Claude Code session logs from the local filesystem. It watches/discovers JSONL session files, parses and ingests messages into the Crystal, maintains watermarks, copies transcript files, writes daily logs, exports Markdown session archives, and exposes CLI status/health/watch commands. While ingestion into the memory crystal is related to memory storage, the overall behavior is materially different from the declared search/manage skill and includes several undeclared filesystem capture and export capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents this as a conversational memory-management skill focused on recall and storage. The code does include those core commands (search, remember, forget, status), so part of the description is accurate. However, the supplied chunk’s overall behavior is much broader and includes substantial undeclared administrative, deployment, indexing, migration, backup, server, and model-management capabilities. These are not merely implementation details supporting memory lookup; they are first-class CLI commands with distinct purposes and resource access patterns (filesystem, databases, cron/LaunchAgents, child-process execution, server startup, transcript ingestion). Therefore the description materially understates what the code can do, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk’s primary purpose is authentication/authorization plumbing for a memory service, not direct memory management. While the scopes and UI reference memory read/write, the implemented behavior is an OAuth server that registers clients, validates redirect URIs, presents a consent page, creates users, issues authorization codes and bearer tokens, and validates those tokens. Those are materially different capabilities from the declared description of searching and managing the shared memory crystal. This is more than a supporting detail because the entire chunk is dedicated to auth flows rather than memory retrieval/storage behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description suggests a memory-management skill centered on searching, remembering, forgetting, and checking memory status. Parts of the code do match that: memory_remember, memory_forget, and memory_status align with the stated purpose. However, there are material mismatches. First, the code adds significant undeclared capabilities: memory_log captures every conversation turn, including full content, raw JSON, tool calls, and inline attachments; memory_upload accepts arbitrary base64 files and relays them for persistent storage. These are broader than the stated 'search and manage shared memory crystal' description and involve substantial conversation/file collection behavior not disclosed in the declaration. Second, the declared recall/search purpose is overstated versus actual behavior: memory_search does not perform real searching here. In sovereign mode it only tells the user to use local tools, and in convenience mode it explicitly says cloud search is not yet available. Finally, memory_status describes convenience tier as having cloud search enabled/active, which conflicts with the unimplemented search behavior. Overall, the description does not accurately represent the actual implemented behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose is a memory-management skill for querying and managing shared memory contents. This code chunk does not implement searching memory, recalling stored facts, forgetting entries, checking status, or any user-triggered memory lookup behavior. Instead, it performs encrypted packaging and persistence of relay drops and attachments into a storage backend. While this could be part of a larger memory system's infrastructure, this specific chunk's primary behavior is secure relay storage/transport, which is materially different from the declared end-user memory management functionality. Therefore, the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description mostly matches part of the implementation: the code clearly supports memory search, explicit remembering, forgetting, and status checks. However, the actual code is materially broader than a simple 'search and manage shared memory crystal' skill. It contains an optional but significant file/source indexing subsystem that recursively scans directories, reads files, hashes and chunks them, and ingests them into search. It also performs external network calls to embedding providers and remote worker endpoints, and resolves secrets from .env/env/1Password. These are meaningful capabilities and resource accesses not conveyed by the declared description or permissions. Because these undeclared capabilities are substantial and not merely internal implementation details, this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill should search and manage the shared memory crystal—recalling prior discussions, storing facts, forgetting items, and reporting memory status. The supplied code chunk does none of that directly. Its primary purpose is cryptographic support for an ephemeral relay, including secret-key loading, authenticated encryption/decryption, HMAC verification, pairing, and hashing. While such crypto could be a supporting component of a memory system, this chunk's behavior is materially different from the user-facing memory management description and introduces undeclared capabilities like filesystem secret access and file encryption. Therefore this is a clear description/behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description suggests a user-facing memory management skill: searching remembered facts, storing or forgetting items, and recalling prior discussions. The supplied code does not implement memory CRUD or memory search behavior. Instead, its primary purpose is infrastructure: serving HTTP endpoints, proxying prompts to the claude CLI, kicking off asynchronous crystal processing jobs, and exposing status metadata. While /status references a crystal database and dream-weaver state, that is only health/reporting context, not actual memory search/manage functionality. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.potential_exfiltration (+1 more)

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
_trash/finder-duplicates-2026-04-16/src/crystal-serve 2.ts:108

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
_trash/finder-duplicates-2026-04-16/src/doctor 2.ts:211

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
_trash/finder-duplicates-2026-04-16/src/installer 2.ts:129

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
_trash/finder-duplicates-2026-04-16/src/llm 2.ts:69

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/bridge.ts:20

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/cli.ts:218

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/core.ts:300

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/crystal-serve.ts:108

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/dev-update.ts:51

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/doctor.ts:91

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/installer.ts:100

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/ldm.ts:239

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/llm.ts:100

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/mlx-setup.ts:57

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/staging.ts:148

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
_trash/finder-duplicates-2026-04-16/src/file-sync 2.ts:17

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
_trash/finder-duplicates-2026-04-16/src/llm 2.ts:121

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/cc-hook.ts:33

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/core.ts:1540

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/file-sync.ts:17

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/llm.ts:62

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/mirror-sync.ts:21

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/poller.ts:28

Sensitive-looking file read is paired with a network send.

Warn
Code
suspicious.potential_exfiltration
Location
_trash/finder-duplicates-2026-04-16/src/llm 2.ts:68

Sensitive-looking file read is paired with a network send.

Warn
Code
suspicious.potential_exfiltration
Location
src/core.ts:1625

Sensitive-looking file read is paired with a network send.

Warn
Code
suspicious.potential_exfiltration
Location
src/llm.ts:99

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
ai/product/plans-prds/current/2026-03-15--cc-mini--search-quality-qmd-v2-port.md:60