Back to skill

Security audit

Memory Manager

Security checks for vulnerabilities and agentic risk

Overview

This memory-management skill fits its stated purpose, but it can automatically delete or move local memory files and its documented safety protections are not fully implemented.

Review this skill carefully before installing. It appears intended to manage OpenClaw memory, but running it can permanently delete conversation records and move memory-tier files without confirmation or reliable recovery. Install only if you accept that behavior, trust the hardcoded memory paths, and are prepared to maintain your own backups.

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

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:117
Finding

Conversation records are permanently deleted without backup or importance validation

Content
View full analysis
{ const aPath = path.join(CONFIG.memoryDir, a); const bPath = path.join(CONFIG.memoryDir, b); return fs.statSync(aPath).mtimeMs - fs.statSync(bPath).mtimeMs; }); const toDelete = sorted.slice(0, sorted.length - CONFIG.maxConversations); toDelete.forEach(file => { const filePath = path.join(CONFIG.memoryDir, file); fs.unlinkSync(filePath); log(`🗑️ 删除:${file}`, 'INFO'); }); log(`✅ 清理了 ${toDelete.length} 个旧会话记录`, 'SUCCESS'); } ``` ### Technical Analysis When more than ten matching conversation records exist, the function sorts them by modification time and permanently deletes the oldest entries with `fs.unlinkSync`. It does not create a backup, move records to an archive, validate their importance, or request confirmation. This behavior conflicts with the safeguards documented in `SKILL.md:133-138`, which claim that files are backed up before destructive processing and their importance is checked before deletion. Consequently, operators may rely on protections that are not actually implemented. The deletion loop also lacks per-file exception handling. A filesystem error can terminate the entire memory-management run after some files have already been deleted, leaving the operation only partially completed. ### Attack Path 1. The memory directory contains more than the configured maximum of ten files whose names match `conversation-*.json`. 2. An actor with write access to that directory can add matching files or manipulate file mod ...[truncated 913 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:148
Finding

Memory-tier migration follows filesystem entries and overwrites conflicting destinations

Content
View full analysis
{ const filePath = path.join(workingDir, file); const stat = fs.statSync(filePath); if (stat.mtimeMs < cutoffDate) { try { fs.copyFileSync(filePath, path.join(shortTermDir, file)); fs.unlinkSync(filePath); log(`📦 移动:${file} → 短期记忆`, 'INFO'); moved++; } catch (e) { log(`❌ 移动失败 ${file}: ${e.message}`, 'ERROR'); } } }); if (moved > 0) { log(`✅ 移动了 ${moved} 个文件到短期记忆`, 'SUCCESS'); } else { log('✅ 没有需要移动的文件', 'INFO'); } } function mergeShortTermToLongTerm() { log('合并短期记忆到长期记忆...', 'MEMORY'); const shortTermDir = path.join(CONFIG.tiersDir, 'short-term'); const longTermDir = path.join(CONFIG.tiersDir, 'long-term'); if (!fs.existsSync(shortTermDir)) { log('⚠️ 短期记忆目录不存在', 'WARN'); return; } const files = fs.readdirSync(shortTermDir); const cutoffDate = Date.now() - (CONFIG.shortTermMemoryDays * 24 * 60 * 60 * 1000); let moved = 0; files.forEach(file => { const filePath = path.join(shortTermDir, file); const stat = fs.statSync(filePath); if (stat.mtimeMs < cutoffDate) { try { fs.copyFileSync(filePath, path.join(longTermDir, file)); fs.unlinkSync(filePath); log(`📦 移动:${file} → 长期记忆`, 'INFO'); moved++; } catch (e) { log(`❌ 移动失败 ${file}: ${e.mess ...[truncated 2762 chars]
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The primary natural-language description and most operational guidance are written in Chinese, but the file does not state that the skill is China-region specific or that users may choose another language. Under the language/locale policy, forcing a specific language without opt-in is a policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list is overly broad and includes generic phrases like 'memory manager', 'memory management', and 'memory cleanup', which can match ordinary user discussion rather than an explicit request to invoke the skill. This creates a prompt-scope risk where the skill may activate unintentionally and perform memory maintenance actions in the wrong conversational context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language description and runtime messages are written in Chinese, and the script provides no mechanism for user opt-in or locale selection. This can violate a language/locale policy when skills are expected to respect the user's preferred language rather than enforce one by default.

Content

No source excerpt is available for this finding.