Back to skill

Security audit

Memory Tiering

Security checks for vulnerabilities and agentic risk

Overview

The skill is a memory organizer, but it automatically reads and rewrites broad persistent memory, including credential-related context, without clear confirmation, preview, or rollback safeguards.

Install only if you are comfortable with the agent reading and rewriting broad memory files after compaction. Before use, require a dry run or diff, confirm destructive pruning manually, exclude raw secrets, and keep recoverable backups of memory files.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:12
Finding

Overly Broad Access to Sensitive Persistent Agent Memory

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12-39
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: Medium

Vulnerable Code Snippet

markdown
1.  **🔥 HOT (memory/hot/HOT_MEMORY.md)**:
    *   **Focus**: Current session context, active tasks, temporary credentials, immediate goals.
    *   **Management**: Updated frequently. Pruned aggressively once tasks are completed.
2.  **🌡️ WARM (memory/warm/WARM_MEMORY.md)**:
    *   **Focus**: User preferences (Hui's style, timezone), core system inventory, stable configurations, recurring interests.
    *   **Management**: Updated when preferences change or new stable tools are added.
3.  **❄️ COLD (MEMORY.md)**:
    *   **Focus**: Long-term archive, historical decisions, project milestones, distilled lessons.
    *   **Management**: Updated during archival phases. Detail is replaced by summaries.

## Workflow: `Organize-Memory`

Whenever a memory reorganization is triggered (manual or post-compaction), follow these steps:

### Step 1: Ingest & Audit
- Read all three tiers and recent daily logs (`memory/YYYY-MM-DD.md`).
- Identify "Dead Context" (completed tasks, resolved bugs).

### Step 2: Tier Redistribution
- **Move to HOT**: Anything requiring immediate attention in the next 2-3 turns.
- **Move to WARM**: New facts about the user or system that are permanent.
- **Move to COLD**: Completed high-level project summaries.

### Step 3: Pruning & Summarization
- Remove granular details from COLD.
- Ensure credentials in HOT point to their root files rather than storing raw secrets (if possible).

### Step 4: Verification
- Ensure no critical information was lost during the move.
- Verify that `HOT` is now small enough for efficient context use.

Technical Analysis

The skill directs the agent to read and modify all HOT, WARM, COLD, and recent daily memory files. The documented ...[truncated 2242 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user confirmation before reading or changing persistent memory, especially when automatically triggered after compaction.
  2. Replace “read all three tiers” with a strict allowlist of required files and process only entries relevant to the current operation.
  3. Prohibit ingestion, copying, summarization, or relocation of passwords, tokens, API keys, private keys, and other raw secrets.
  4. Replace the advisory “if possible” credential rule with a mandatory secret-handling policy. Store only references to an approved secret manager or protected source.
  5. Generate a proposed change set and human-readable diff before modifying any memory file.
  6. Create versioned backups and perform writes transactionally so failed or incorrect reorganizations can be rolled back.
  7. Validate destinations before moving data and prevent sensitive HOT content from being promoted into long-term memory.
  8. Treat memory-file contents as untrusted data rather than executable instructions to reduce the risk of attacker-controlled entries influencing classification behavior.
  9. Make automatic execution after /compact opt-in and clearly disclose the files and data categories that will be accessed.
  10. Record an audit log of files read, entries changed, and entries removed without including secret values in the log.
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)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly advertises organizing, pruning, and archiving memory, which implies modification and possible deletion of stored context, but it does not warn the user about data loss, summarization side effects, or irreversible changes before activation. In a memory-management skill, this omission is materially risky because users may trigger it expecting optimization rather than destructive alteration of retained context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The pruning step instructs removal of granular details from COLD memory without requiring notice, confirmation, or preservation safeguards. Because long-term memory is supposed to retain historical decisions and lessons, silent summarization can permanently discard details that may later be needed for accuracy, auditing, or recovery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The usage trigger lists both an English and a Chinese phrase, but the document does not explain language selection, opt-in behavior, or whether multilingual triggers are optional. This can be a language/locale policy concern if the skill assumes or enforces particular-language invocation without documented user choice.

Content

No source excerpt is available for this finding.