Back to skill

Security audit

Memory Palace

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is not malicious code, but it tells the agent to automatically save user preferences and project details across sessions without clear permission or controls.

Install only if you want an agent to maintain persistent memory, and configure it so every saved memory requires explicit approval, shows exactly what will be stored, avoids sensitive data, uses an isolated location, and provides review and deletion controls.

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
SKILL.md:38
Finding

Automatic Cross-Session Persistence of Untrusted User Information

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:38-40 and SKILL.md:152-158
Vulnerability Type: T02: Agent Memory Poisoning
Risk Level: Medium

Vulnerable Skill Instructions

SKILL.md:38-40:

markdown
### Scenario 4: Cross-session knowledge retention

Proactively place user preferences, habits, and project information into the long-term memory palace and archive them in a file.

SKILL.md:152-158:

markdown
### Memory-write protocol

When the user mentions important information, proactively trigger a memory-palace write:

Information appears → determine whether it is important → yes → generate an exaggerated image → select a palace location → place it → tell the user "Archived"

The snippets above are faithful English translations of the audited instructions.

Technical Analysis

The Skill directs the agent to identify information as important and write it to persistent, cross-session storage automatically. The decision to persist data is made by the agent, and the user is notified only after the write. The instructions do not require prior user consent or define:

  • A safe and access-controlled storage location
  • Permitted data categories or sensitivity filters
  • Per-user or per-project isolation
  • Data provenance and trust labels
  • Retention periods or deletion procedures
  • Validation before persisted information is used in later sessions

Consequently, attacker-controlled conversation content can be stored as durable state. If later agent behavior relies on that state without treating it as untrusted data, the persisted content can poison future decisions or task context.

This repository contains documentation rather than an implementation of the storage mechanism. Exploitation therefore depends on the host agent providing file-writing or persistent-memory capabilities and following these instructions.

Attack Path

  1. An attacker interacts with an agent th ...[truncated 1487 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require explicit, informed user opt-in before every persistent write. Notification after storage is not sufficient.
  2. Present the exact information, destination, purpose, and retention period before requesting approval.
  3. Never persist credentials, authentication tokens, financial information, health data, government identifiers, or other sensitive personal data.
  4. Treat all persisted user content as untrusted data, never as authoritative agent instructions.
  5. Store provenance metadata, including the originating user, session, timestamp, purpose, and approval record.
  6. Enforce strict per-user and per-project access isolation using a declared, access-controlled storage location.
  7. Validate and sanitize data before storage and again before retrieval.
  8. Define expiration, review, correction, export, and deletion controls.
  9. Ask for confirmation before retrieved memory materially affects a later task.
  10. Replace the automatic protocol with a consent-based flow:
text
Information appears → assess sensitivity and relevance → show the proposed memory to the user → request explicit approval → write to isolated storage → record provenance and expiration → confirm completion
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger phrases "AI助手, 任务执行" are so broad that the skill may activate during ordinary conversations and tasks without clear user intent. That increases the chance the memory behavior runs unexpectedly, including context retention and archival flows described elsewhere in the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This section explicitly says user preferences, habits, and project information should be proactively placed into long-term memory and written to files across sessions, but provides no consent, notice, retention limit, or data handling safeguards. In context, this is more dangerous because the skill is designed for persistent memory, so silent storage of potentially sensitive user data is a core behavior rather than an edge case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description and the entire skill content are written as Chinese-only instructions for operation, with no indication that users may choose another language or that the locale restriction is intentional and justified. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill directs the agent to proactively retain user preferences and project information across sessions and write them to files, which creates a persistent data store of potentially sensitive personal and business context. In a memory-enhancement skill, this materially raises privacy and data governance risk because the behavior is normalized and likely to occur often.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The memory write protocol instructs the agent to automatically judge importance, store the information, and tell the user it has been archived, but it omits prior warning or permission for persistent storage. This creates a covert persistence mechanism where sensitive details may be retained based on the agent's own criteria rather than user choice.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The automatic archive workflow tells the agent to store important user information and confirm it was stored, effectively operationalizing silent memory persistence. That is dangerous because it enables accumulation of sensitive data without meaningful user control, transparency, or any safeguard against over-collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file presents the entire skill content in Chinese and does not indicate any user opt-in, language selection, or locale-specific justification. Under the stated policy, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire document is written in Chinese and does not indicate that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.