Back to skill

Security audit

Long Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a real conversation-memory toolkit, but it needs Review because sensitive chat archives can be written through an unauthenticated local API and its advertised encryption is not actually strong encryption.

Install only if you are comfortable keeping local long-term copies of sensitive conversations. Do not rely on its encryption for secrets, avoid starting the REST API unless you isolate it and trust all local callers, review exported reports before opening or sharing them, and configure retention/backups deliberately because archives may persist or be pushed to a remote Git repository.

Vulnerability Patterns
  • 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
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/privacy.py:17
Finding

Misrepresented and Cryptographically Insecure Memory Encryption

Content
View full analysis
bytes: """XOR stream cipher used with a SHA-256-derived key.""" return bytes(a ^ b for a, b in zip( data, (key * (len(data) // len(key) + 1))[:len(data)] )) def _derive_key(password: str, salt: bytes = b"long-memory-salt") -> bytes: """Derive a key from a password.""" return hashlib.sha256(password.encode("utf-8") + salt).digest() def encrypt_text(text: str, password: str) -> str: """Encrypt text.""" key = _derive_key(password) data = text.encode("utf-8") encrypted = _xor_cipher(data, key) return base64.b64encode(encrypted).decode("ascii") def decrypt_text(ciphertext: str, password: str) -> str: """Decrypt text.""" key = _derive_key(password) data = base64.b64decode(ciphertext) decrypted = _xor_cipher(data, key) return decrypted.decode("utf-8") ``` The password is also accepted directly through a command-line option: ```python enc.add_argument("--password", "-p", required=True) dec.add_argument("--password", "-p", required=True) ``` ### Technical Analysis The Skill documentation and module description advertise AES-256 encryption, but the implementation is a repeating-key XOR cipher. The SHA-256 digest of the password and a fixed, globally reused salt becomes a 32-byte keystream that repeats for the entire plaintext. This construction has several critical deficiencies: 1. It is not AES-256. 2. The fixed salt causes identical passwords to derive identical keys for every record. 3. There is no random nonce or initialization vector. 4. The keystream is reused across all messages encrypted with the same password. 5. There is no authentication tag or ...[truncated 2102 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/api_server.py:153
Finding

Unauthenticated REST API Permits Path Traversal and Persistent Memory Poisoning

Content
View full analysis
0 else "{}" try: data = json.loads(body) except json.JSONDecodeError: self.send_json(400, {"error": "Invalid JSON"}) return routes = { "/api/conversations": self.handle_create_conversation, "/api/archive": self.handle_archive, } handler = routes.get(parsed.path) if handler: handler(data) else: self.send_json(404, {"error": "Not found"}) ``` Responses allow every web origin: ```python def send_json(self, code: int, data: dict): response = json.dumps(data, ensure_ascii=False).encode("utf-8") self.send_response(code) self.send_header("Content-Type", "application/json; charset=utf-8") self.send_header("Access-Control-Allow-Origin", "*") self.send_header("Content-Length", str(len(response))) self.end_headers() self.wfile.write(response) ``` The attacker-controlled `date` value becomes part of a filesystem path without validation or containment enforcement: ```python def handle_create_conversation(self, data): date = data.get("date", datetime.now().strftime("%Y-%m-%d")) session = data.get("session", "api") topic = data.get("topic", "API archive") content = data.get("content", "") tags = data.get("tags", []) conv_dir = self.memory_dir / "conversations" conv_dir.mkdir(parents=True, exist_ok=True) fp = conv_dir / f"{date}.md" entry = f"\n## [{datetime.now(). ...[truncated 3571 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/html_report.py:139
Finding

Stored HTML Injection in Memory Analysis Reports

Content
View full analysis
{tag}
{count}
""" ``` ```python for topic, count in sorted(all_topics.items(), key=lambda x: -x[1])[:10]: pct = count / max_topic * 100 html += f"""
{topic[:20]}
{count}
""" ``` ```python for f in reversed(files_data[-20:]): tags_str = " ".join( f'{t}' for t in f["tags"][:5] ) topics_str = ", ".join(t[:20] for t in f["topics"][:3]) size_str = f"{f['size'] / 1024:.1f}KB" if f["size"] > 1024 else f"{f['size']}B" html += f""" {f['date']}< ...[truncated 2396 chars]
Remediation
View remediation
``` 5. Do not permit inline scripts, remote scripts, frames, plugins, or unnecessary outbound connections. 6. Add regression tests using tags and topics containing HTML elements, event handlers, quotes, ampersands, and Unicode edge cases. 7. Treat imported and API-created memory records as untrusted even when the report is generated locally. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/embedding_search.py:1
Finding

Unpinned Optional Machine-Learning Dependency Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (175)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explicitly promises full archival of every user message, assistant reply, and 'thought process', which encourages indiscriminate collection of highly sensitive data without any prominent warning, consent model, or data-minimization guidance. In the context of an agent memory skill, this is especially dangerous because users may unknowingly persist secrets, personal data, or internal reasoning artifacts across sessions indefinitely.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

Advertising session capture, REST API exposure, export functions, auto backup, and audit logging without clear warnings about access control, data exposure, and outbound transfer materially increases the risk of unintended disclosure. In a memory system, these features expand the attack surface from local retention to API leakage, bulk export, and propagation to remote Git repositories or logs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

该描述与代码存在明显不一致。代码确实与“对话记忆/归档”相关,能够把传入内容写入 memory 目录下的 conversations markdown 文件,也能查询和统计这些文件,因此与记忆系统有部分重合。但关键能力被明显夸大或遗漏:第一,所谓“语义检索”并不存在,handle_search 只是用 query.lower() in content.lower() 做简单关键词匹配;第二,所谓“自动保存每次对话完整内容”也没有实现,代码只是提供 /api/conversations 和 /api/archive 两个 POST 端点,被外部调用时才写入任意给定 content;第三,描述声称保存用户消息、助手回复、思考过程,代码并未解析或结构化保存这些组成部分,更没有自动抓取“思考过程”;第四,代码的主要实现形态是一个本地 HTTP API 服务器,这属于实际行为中的重要能力,但描述没有说明。综合来看,这是对功能能力的实质性过度声明,且遗漏了网络 API 服务这一主要行为,因此应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a comprehensive conversation memory system with automatic full-history capture, semantic retrieval, trigger-based activation, and preservation of user messages, assistant replies, and internal thought process. The provided code only implements a basic Markdown archiver: it creates or appends to a dated file, writes a session header, topic, optional tags, and raw supplied content. There is no indexing, retrieval, semantic search, trigger detection, or mechanism to automatically collect entire conversations. The code's actual behavior is materially narrower and different from the declared purpose, so 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

The description claims a conversational long-term memory system that stores full dialogue contents including user messages, assistant replies, and reasoning, and can retrieve prior conversations semantically across sessions. The supplied code does none of that. It only manages Git-based backups for files in a memory directory: checking whether the directory is a Git repo, initializing one if needed, staging changes, creating commits, optionally configuring a remote and pushing, and printing backup status. There is no code for parsing conversations, storing message content, indexing by meaning, searching history, or reacting to the listed conversational triggers. The actual primary purpose is repository backup/versioning, which is materially different from the declared memory/retrieval system.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是面向实际使用的长期对话记忆系统,核心能力应包括自动持久化真实对话、跨会话记忆连续性、按语义检索历史、以及特定触发场景下的回忆/归档。给出的代码却是 benchmark.py,仅用于生成模拟数据并测试其他模块的性能。虽然它提到 conversations、search、index、tfidf 等与记忆系统相关的周边概念,但本片段的主目的和实际行为是压测,不是实现或触发记忆系统本身。因此属于明显的描述与代码行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个较完整的长期记忆系统,包含自动持续记录、完整内容保存(含思考过程)和语义检索历史对话。实际代码仅实现了从本地 OpenClaw session 文件中抓取会话并归档到 Markdown:它跳过 system 消息,只保留字符串 content,且没有任何向量化、索引、检索接口或查询逻辑;也没有捕获“思考过程”的专门字段。触发方式上,代码通过命令行参数运行,指定 session 或默认抓取最近 3 个 session,虽然有 --auto 可配合 cron,但仍不是声明所说的面向用户提及‘记下来/回忆一下’等触发的记忆系统。因此描述明显高估了代码实际能力,构成实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是对话记忆/检索能力,核心对象应是聊天记录与记忆存储;而代码完全围绕 git 提交历史处理展开,使用 subprocess 调用 git log,解析版本提交消息,并输出版本变更文档。两者在主要目的、处理的数据对象、触发场景和实际能力上都明显不一致。代码中虽然出现 DEFAULT_MEMORY_DIR 常量,但未被使用,不足以支持声明的记忆系统功能。因此这是明显的描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向对话记忆管理与检索的核心系统,重点在于保存完整对话、支持语义搜索、在特定用户意图下触发,并提供跨 session 记忆能力。而实际代码仅实现了一个维护性脚本:扫描 memory 目录下的 conversations 和 distillations 子目录,解析文件名日期,将超过指定天数的文件移动到 archive 中。它不保存任何新对话,不读取或检索历史内容,不处理用户消息/助手回复/思考过程,也没有任何语义检索或自动触发机制。因此其主要目的与声明严重不符,属于明显的描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as an operational long-term conversation memory system with automatic capture and semantic recall capabilities. However, the supplied code chunk only implements a command-line front end that routes commands such as archive, search, semantic, embedding, export, etc. to other scripts. In isolation, this code does not implement the described memory behavior, nor does it directly access or persist conversation data. Its primary purpose is command dispatch, which is materially different from the declared end-user functionality. While the listed subcommands suggest a broader memory toolkit may exist elsewhere, this specific code chunk does not substantiate the claimed behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for a long-term conversation memory subsystem with storage, recall, semantic search, and session continuity features. The supplied code does none of that. It is a standalone config validator/migrator for a JSON configuration file, checking field types, numeric ranges, regex patterns, nested object shapes, and version upgrades. While this may support a larger memory system, this chunk’s actual purpose is configuration maintenance, not conversation-memory capture or retrieval. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a comprehensive memory subsystem: automatic persistence of every conversation, inclusion of user/assistant/thought content, semantic retrieval, and cross-session recall behavior. The supplied code does none of that. It only loads pre-existing .md conversation files from a local directory and performs heuristic pattern matching to detect contradictions in preferences, decisions, and todo items. There is no code for saving new conversations, indexing or embedding content for semantic retrieval, recalling specific past chats on demand, or handling the listed triggers. This is a materially different primary purpose, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

描述强调的是一个面向运行时的长期记忆系统,核心能力包括:全量记录、跨 session 连续记忆、语义检索、基于特定用户意图自动触发。实际代码仅是一个 CLI 脚本 distill_week.py,从既有的按日 markdown 对话日志中提取“决策/待办/偏好/进展/话题”等精华,生成周摘要并维护 MEMORY.md。提取方式是简单的正则和格式规则,不是语义检索;输出是摘要,不是全量保存;代码也没有任何实时会话钩子、session 结束归档机制或按提示词触发逻辑。虽然它处理‘记得/别忘了’等词,但只是作为待办提取关键词,不等同于声明的交互式记忆触发器。因此描述与行为存在明显且实质性的偏差。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的长期对话记忆与归档系统,核心能力包括:自动记录每轮对话、保存完整内容、支持跨 session 连续性,以及基于语义回忆任意历史对话。实际代码只是一个独立的 embedding 搜索/索引工具:读取 memory_dir/conversations 下已有 Markdown 文件,按片段提取内容,构建本地向量索引,并执行语义搜索。其主要文档内容来源是正则提取的“用户”消息,若无则截取 section 文本前 500 字,因此与“保存用户+助手+思考过程的完整内容”明显不符。代码也没有任何监听对话、自动写入记忆、session 结束归档或触发条件处理逻辑。虽然“支持语义检索历史对话”这一点部分吻合,但整体主用途和关键能力相比声明明显缩水且不同,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个对话记忆与检索系统,核心能力应是写入和检索历史对话记忆;而代码仅从既有对话文件中读取内容并做基于词典的情感分析。代码的主功能是统计情绪类别、计算 valence、生成趋势报告,与“记忆存储/语义回忆”属于 materially different primary purpose。资源访问上,代码读取 memory/conversations 目录是与历史对话相关,但用途是分析情绪而非记忆管理。总体上描述与实际行为明显不符,应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a comprehensive dialogue memory subsystem: it should automatically record complete conversations, include user/assistant content plus thought process, support semantic retrieval, and activate based on specific user intents or session lifecycle events. The supplied code does something much narrower and different: it only loads already-existing markdown files from memory-related directories and exports them into a chosen output format. There is no code for intercepting conversations, persisting new memories, indexing or semantic search, trigger handling, session management, or thought-process capture. While the script operates on memory data, its actual role is an export utility, not the described full-memory system. Therefore the description materially overstates and misrepresents the behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个完整的长期对话记忆与检索系统,核心能力应包括对话捕获、持久化、语义检索和触发式调用。实际代码仅对现有记忆文件做时间衰减和重要性加权评分,属于检索排序辅助/分析工具,而不是记忆系统本身。虽然它与“记忆”领域相关,但其主要目的与声明明显不同,且缺失声明中的关键功能,同时引入了声明未提到的遗忘曲线分析能力,因此构成明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a comprehensive long-term memory system: automatic preservation of every dialogue in full, including user/assistant content and internal thought process, plus semantic search over historical conversations and cross-session recall triggers. The supplied code does none of that. It assumes conversation logs already exist under memory/conversations/YYYY-MM-DD.md, reads one file by date, extracts simple patterns from markdown, and produces a concise summary file under memory/summaries or JSON output. There is no logic for capturing ongoing conversations, automatically saving each turn, storing chain-of-thought, indexing embeddings, semantic search, or recalling arbitrary prior sessions. This is a clear material mismatch in primary purpose and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a persistent conversation memory system with automatic storage and semantic recall of prior dialogues, including complete conversation content and thought process. The supplied code does none of that. It only reads the filesystem structure of a memory repository and computes health metrics about existing files. Its checks are operational/maintenance-oriented: file counts and sizes, MEMORY.md limits, presence of tags and decision markers, distillation files, index/checksum existence, and git cleanliness. While this may support a broader memory subsystem, this chunk’s actual purpose is a monitoring dashboard, not a conversation memory system. Therefore the description does not accurately represent the behavior of this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a comprehensive long-term conversation memory system with automatic archival of each dialogue, preservation of full content including internal reasoning, and semantic retrieval of past conversations when certain memory-related prompts occur. The supplied code does none of that. It only scans existing markdown conversation files, parses simple metadata patterns such as tags and topics, counts sessions and file sizes, and writes an HTML dashboard report. Its primary purpose is analytics/visualization of already-stored memory files, not memory capture, persistence, semantic indexing, or retrieval. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

该代码块的主功能与声明的核心用途明显不一致。声明描述的是一个运行时对话记忆系统,强调自动记录、历史检索和跨会话回忆;而代码仅是离线/手动使用的导入工具,通过 CLI 从 .md/.json/.txt 文件读取内容并写入本地记忆目录。虽然它与“记忆”领域相关,但只是辅助性的迁移脚本,不是所声明的完整记忆系统本身。代码也没有任何语义搜索、会话监听、触发词识别或思考过程存储逻辑,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description claims a comprehensive dialogue memory system with automatic persistence of full conversations and semantic recall across sessions. The supplied code does not perform storage of conversations or any automatic memory capture. Instead, it scans existing markdown files under specific directories, extracts topics/tags/user-message-derived keywords, writes a JSON index, and offers simple search/filtering over that index. Search is not semantic in any meaningful sense; it is based on substring matching against filenames, extracted keywords, topics, and tags. The primary purpose is therefore materially different: index maintenance and lightweight retrieval over preexisting memory files, not end-to-end automatic full-conversation memory.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a conversational long-term memory skill with automatic dialogue capture and semantic recall across sessions. The supplied code does none of that. Instead, it operates as a maintenance utility over files already present in a memory directory: it enumerates markdown files, verifies structure, computes checksums, records modifications, reports missing/corrupted files, and can attempt simple repairs. This is a materially different primary purpose and capability set from the declared memory/recall system, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a complete long-term conversation memory system with automatic archival and semantic retrieval of past dialogues. The supplied code does not implement any of that behavior. Instead, it only defines generic helper functions for file locking and safe reading/writing of text and JSON files under concurrent access. While such utilities could support a memory system as an internal component, this code chunk by itself is merely infrastructure and does not match the claimed end-user functionality. Therefore, the description materially overstates and misrepresents what the code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个核心记忆存储与检索系统,而代码只是对已有对话 Markdown 记录做二次分析和可视化统计。它读取 conversations/*.md,基于正则抽取“### 话题”“标签:”“用户:”等字段,构建话题节点、标签/关键词聚合和话题共现边,并输出统计结果。这与“全量保存完整对话、包含助手回复和思考过程、支持语义检索和跨 session 回忆”的主功能存在实质性差异。代码也没有任何写入记忆、索引语义向量、查询历史对话内容或根据用户触发条件执行的逻辑,因此属于明显不匹配。

Content

No source excerpt is available for this finding.