Back to skill

Security audit

Memory System V2

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real local memory tool, but it broadly stores and reuses user/agent context without enough privacy, retention, or trust-boundary safeguards.

Review this before installing if you handle confidential work. It stores memories in plaintext under your home directory and may preserve interaction history across sessions. Avoid saving secrets, credentials, regulated data, or private conversations unless you have reviewed storage permissions and retention. Treat recalled memories as historical notes, not instructions, and consider adding deletion/review workflows and input escaping before production use.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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
memory-cli.sh:44
Finding

Persistent Storage of Untrusted Content Can Poison Future Agent Context

Content
View full analysis
> "$daily_file" echo "## [$timestamp] $type (importance: $importance)" >> "$daily_file" echo "$content" >> "$daily_file" if [[ -n "$context" ]]; then echo "**Context:** $context" >> "$daily_file" fi ``` The persisted content is subsequently intended to be recalled into agent interactions: ```markdown **Auto-capture in AGENTS.md:** ```markdown ## Memory Recall Before answering anything about prior work, decisions, dates, people, preferences, or todos: run memory_search on MEMORY.md + memory/*.md ``` ``` ### Technical Analysis The capture operation writes arbitrary `content` and `context` values directly into persistent daily memory files. The corresponding data is also inserted into the searchable index. No provenance, trust classification, instruction filtering, or separation between executable agent instructions and inert recalled data is applied. The Skill recommends consulting persistent memory before answering questions about prior work, decisions, people, preferences, and tasks. If attacker-controlled text is captured as a memory and later inserted into an agent's context, instruction-like content may be interpreted as a directive rather than as untrusted historical data. This behavior is central to the declared persistent-memory functionality, but accepting and recalling arbitrary text without a trust boundary exceeds the minimum safe implementation. Persistent storage itself is necessary; treating all stored content as equally trustworthy is not. ### Attack Path 1. An attacker supplies text through a conversation, imported interaction, or other source that the agent or user records through `capture`. 2. The text contains an instruction such as a request to ign ...[truncated 1318 chars]
Remediation
View remediation
...`. 6. Provide commands to review, edit, quarantine, and delete poisoned entries. 7. Restrict automatic recall to necessary fields and trusted sources instead of searching all memory files indiscriminately. 8. Consider detecting common instruction-manipulation patterns as a warning mechanism, while not relying on pattern matching as the sole defense. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
memory-cli.sh:53
Finding

Unescaped User Input Allows JSON Entry Injection and Index Corruption

Content
View full analysis
"$temp_index" mv "$temp_index" "$INDEX_DIR/memory-index.json" ``` The argument parser only checks that three values are nonempty: ```bash # memory-cli.sh:211-217 if [[ -z "$type" || -z "$importance" || -z "$content" ]]; then echo "❌ Usage: memory capture --type TYPE --importance 1-10 --content 'text' [--tags 'tag1,tag2'] [--context 'context']" exit 1 fi capture_memory "$type" "$importance" "$content" "$tags" "$context" ``` ### Technical Analysis The script interpolates `type`, `importance`, `content`, and `context` directly into a JSON heredoc. JSON-special characters are not escaped. Quotes, backslashes, control characters, and newlines can therefore make `memory_entry` invalid or alter its structure. The `importance` argument is inserted as raw JSON rather than converted from a validated integer. Although `jq --argjson` prevents this input from becoming a shell command, it does not protect the structure of the JSON assembled before `jq` receives it. The code also fails to enforce the documented constraints: - `type` is not limited to `learning`, `decision`, `insight`, `event`, or `interaction`. - `importance` is not required to be an integer from 1 t ...[truncated 2338 chars]
Remediation
View remediation
&2; exit 1 ;; esac ``` 3. Validate importance before any file is modified: ```bash if [[ ! "$importance" =~ ^([1-9]|10)$ ]]; then echo "Importance must be an integer from 1 to 10" >&2 exit 1 fi ``` 4. Validate numeric values such as limits and day ranges before passing them to `jq --argjson` or date utilities. 5. Enable strict error handling with care, such as `set -euo pipefail`, and explicitly check every `jq`, `mktemp`, and `mv` operation. 6. Generate and validate the new index before appending the daily Markdown entry, or use a transactional strategy that rolls back one write if the other fails. 7. Replace the index only after confirming the temporary file is nonempty and valid: ```bash jq empty "$temp_index" && [[ -s "$temp_index" ]] && mv -- "$temp_index" "$INDEX_DIR/memory-index.json" ``` 8. Add file locking around read-modify-write operations to prevent concurrent captures from losing updates or corrupting the index. 9. Set `umask 077` and use owner-only permissions because memories may contain private user information. 10. Add regression tests coveri ...[truncated 151 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The overall domain matches a persistent memory tool: the code captures and recalls prior items, indexes them in JSON, and supports consolidation. However, key advertised capabilities are overstated or inaccurate. There is no semantic retrieval; search uses jq contains() on lowercased content. The <20ms search claim is unsupported by the code. Consolidation is not automatic; it is a manual CLI subcommand. These are material description-to-behavior mismatches even though the core purpose of persistent memory across sessions is aligned.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./memory-cli.sh capture \

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a 'Fast semantic memory system' and suggests semantic recall capabilities, but the same file's limitations state 'Text-only search: No semantic embeddings (yet)'. That means the described behavior does not match the actual implemented scope as documented in this skill file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description presents the skill as providing semantic memory/search, which implies meaning-aware retrieval. However, the documentation explicitly says 'Text-only search: No semantic embeddings (yet)' and describes keyword-based search examples, creating a direct contradiction between stated intent and actual documented behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill is positioned for broad use whenever persistent recall might help, which can cause it to be invoked in contexts where sensitive user, project, or organizational data is unnecessarily written to durable storage. In a memory skill, overbroad activation materially increases privacy and data-retention risk because ordinary conversations, decisions, and interactions may be persisted without explicit user intent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The top-level documentation advertises semantic memory and smart search, but the limitations section later clarifies there are no semantic embeddings and only text search is supported. This is an intent-level contradiction in the skill's own documentation, not just an omitted implementation detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This skill is explicitly designed to persist learnings, decisions, events, interactions, and context across sessions, but it does not warn that these records may contain sensitive information. In this context, missing privacy guidance is security-relevant because users or agents may store API keys, internal discussions, personal data, or confidential project history into plain files unintentionally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The design includes automatic consolidation, extraction into long-term memory, and archiving of old files, but it does not define safeguards for reversibility, auditability, or corruption handling. In a memory system, automated data-altering operations can silently rewrite, summarize, or move records in ways that lose fidelity, preserve sensitive information longer than intended, or make recovery difficult after mistakes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The design explicitly targets '100% of daily activities captured' and describes auto-capture from logs, but it provides no consent, minimization, redaction, or privacy-boundary controls. In a persistent memory skill, this can lead to over-collection of sensitive data, credentials, personal information, or confidential project context and make that data durable and searchable across sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file explicitly recommends deploying the memory system, integrating it into workflow, migrating existing memories, and setting up automatic capture hooks, but it provides no user warning about the system writing memory files or capturing/storing potentially sensitive interaction data. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data, privacy, or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This script stores user-provided content, context, and tags persistently in plaintext files under $HOME/clawd/memory and indexes them for later retrieval, but it provides no consent prompt, data classification guardrails, retention controls, or protection against storing sensitive secrets. In a memory/persistence skill, users are especially likely to submit credentials, personal data, internal decisions, or other sensitive context, so silent long-term storage materially increases privacy and data exposure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Describing auto-consolidation without warning that summaries are derived from and persistently rewrite stored content can increase unintended retention and propagation of sensitive information. While lower severity than direct storage warnings, it still matters because summarization can replicate sensitive details into additional files, broadening exposure and making deletion harder.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.