Back to skill

Security audit

Memory Deduplication

Security checks for vulnerabilities and agentic risk

Overview

This skill is a plausible memory cleanup tool, but it can rewrite persistent MEMORY.md content by default with incomplete safeguards and overstated recovery controls.

Review this skill carefully before installing. Use only on a copy of MEMORY.md or with manual version control, run --dry-run first, and do not enable the suggested weekly cron unless the implementation is changed to require review, preserve all content, and provide reliable rollback.

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

Error
Location
dedup.mjs:24
Finding

Lossy Deduplication Can Silently Destroy Persistent Memory Content

Content
View full analysis
{ if (line.startsWith('###')) { if (currentSection) sections.push(currentSection); currentSection = { title: line.replace(/^###\s*/, ''), content: [], priority: line.match(/\[P(\d)\]/) ? parseInt(line.match(/\[P(\d)\]/)[1]) : 9 }; } else if (currentSection && line.trim()) { currentSection.content.push(line); } }); if (currentSection) sections.push(currentSection); return sections; } ``` ```javascript if (dup.similarity > 0.8) { toRemove.add(dup.index2); } else if (dup.similarity > 0.5) { if (!toRemove.has(dup.index1) && !toRemove.has(dup.index2)) { const mergedSection = mergeSections(dup.section1, dup.section2); merged.set(dup.index1, mergedSection); toRemove.add(dup.index2); } } ``` ```javascript const newContent = rebuildMemory(dedupedSections); ``` ```javascript fs.writeFileSync(memoryPath, newContent); ``` ### Technical Analysis The parser recognizes only lines beginning with `###` as section boundaries. All content before the first such heading is silently omitted. Other Markdown heading levels are not represented structurally and can be absorbed into a preceding section. Blank lines and the original document layout are also discarded. The duplicate-removal logic creates a separate data-loss condition. When two section titles have similarity greater than `0.8`, the later section is marked for removal without merging its content into the retained section. Identical headings with different bodies therefore cause all facts unique to the later section to be deleted. The reconstructed document is written ...[truncated 1340 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
dedup.mjs:153
Finding

Backup Implementation Does Not Provide the Documented Recovery Guarantees

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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
95% confidence
Finding

The entire skill description, usage guidance, and operational instructions are written in Chinese, with no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. The policy explicitly flags language or locale constraints when they are imposed without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file is presented as a deduplication tool, but it also merges sections heuristically and overwrites MEMORY.md by default, which changes data semantics rather than just removing exact duplicates. This mismatch can mislead operators into running a destructive content-rewriting tool with more authority and side effects than the description suggests, increasing the chance of unintended data loss or corruption.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The package description is written entirely in Chinese, which indicates a language-specific skill description without offering any user language choice or documenting that the skill is region-specific. This can violate language/locale policy when users are not given an explicit opt-in or alternative locale.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.