Back to skill

Security audit

Depth Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent persistent memory skill, but it gives agents broad long-term storage/retrieval behavior without enough user consent and trust-boundary controls.

Install only if you want a workspace-level long-term memory system and are comfortable with agents writing persistent notes. Avoid saving secrets, credentials, private documents, or untrusted third-party text unless it is clearly labeled as untrusted. Before relying on retrieved entries, treat them as reference material, not instructions, and review DEEP-MEMORY.md for unexpected rows or paths.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
scripts/add.mjs:171
Finding

Persistent Memory Poisoning Through Unsanitized Memory and Index Entries

Content
View full analysis
`- ${k}`), '', '## 描述', description, '', content, // 正文原样追加,可能为空 ].join('\n'); writeFileSync(filepath, fullContent, 'utf-8'); console.log(`\n✅ 记忆已保存: deep-memory/${filename}`); ``` `scripts/add.mjs:203-224` interpolates unescaped keywords and descriptions into the Markdown index: ```js const relPath = `deep-memory/${filename}`; const indexContent = readFileSync(INDEX_PATH, 'utf-8'); // 构造新索引行,关键字用逗号连接 const newEntry = `\n| ${keywords.join(', ')} | ${description} | \`${relPath}\` |`; const lines = indexContent.split('\n'); // 找到 Markdown 表格分隔行(在表头之后的那条 --- | --- | --- 线)的位置 const insertAt = lines.findIndex(l => l.includes('---')); if (insertAt !== -1) { // 在分隔线之后插入,保持表头和数据的清晰分隔 lines.splice(insertAt, 0, newEntry); } else { // 找不到分隔线(索引文件可能被破坏),直接追加到末尾 lines.push(newEntry); } writeFileSync(INDEX_PATH, lines.join('\n'), 'utf-8'); console.log('✅ 索引已更新'); ``` `scripts/query.mjs:114-125` parses index rows using an unsafe delimiter-based parser and returns the stored path without validating its destination: ```js const [kw, desc, filePath] = parts; const kwLower = kw.toLowerCase(); const keyLower = keyword.toLowerCase(); const matched = kwLower.includes(keyLower) || keyLower.includes(kwLower); if (matched) { // 去除文件路径两端的反引号(如 "`deep-memory/xxx.md`" → "deep-memory/xxx.md") results.push({ keyword: kw, description: desc, filePath: filePath.replace(/`/g, ''), }); } ``` The documented retrieval workfl ...[truncated 3169 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 (7)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/add.mjs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/add.mjs

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description advertises broad capabilities like handling knowledge accumulation, skill experience, and long-term archives without defining clear boundaries for when the skill should or should not run. In agent systems, vague activation scope can cause overuse of a persistence-capable skill and lead to unnecessary retention of user-provided information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs use of workspace files for long-term memory but does not prominently warn that user-provided content may be persisted in DEEP-MEMORY.md and deep-memory/*.md. Without explicit disclosure and consent, sensitive or proprietary information could be stored permanently in the workspace, creating privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger conditions are broad enough to activate the skill for many routine knowledge questions, causing the agent to consult or update persistent deep-memory when a narrower tool or no persistence would be more appropriate. This increases the chance of unintended long-term storage of user content and over-collection of data beyond user expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language comments, usage text, and error messaging exclusively in Chinese, including the command-line usage shown to users. The policy requires avoiding forced language/locale behavior unless the skill offers user choice or clearly documents a justified regional constraint, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language instructions and runtime messages that force a specific language/locale for users. The file does not offer any alternative language, opt-in, or justification for the locale restriction, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.