Back to skill

Security audit

Session Memory & Summarization

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it advertises, but it automatically stores conversation history and reuses it with unusually high authority in later sessions.

Review before installing. This skill may improve continuity, but assume recent prompts, assistant replies, and summaries can be saved in plaintext under the workspace and automatically reused later. Avoid using it with secrets, credentials, regulated data, or shared repositories unless you add redaction, retention/deletion controls, and change memory injection so recalled text is treated as untrusted context rather than system instructions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T02 · Agent Memory Poisoning

Error
Location
hooks/session/start/handler.js:43
Finding

Persistent Conversation Content Is Reintroduced with System-Level Authority

Content
View full analysis
m.role === 'user' || m.role === 'assistant'); const recent = conversational.slice(-n); return recent.map(m => ({ role: m.role, content: typeof m.content === 'string' ? m.content.substring(0, MAX_CONTENT_PER_MSG) : String(m.content || '').substring(0, MAX_CONTENT_PER_MSG) })); } ``` From `hooks/session/compact:before/handler.js:89-100`: ```js // Strip old recent_messages block if present const markerIdx = existing.indexOf(RECENT_MESSAGES_MARKER); const summaryPart = markerIdx >= 0 ? existing.substring(0, markerIdx).trimEnd() : existing.trimEnd(); const timestamp = new Date().toLocaleTimeString(); const newEntry = `## ${timestamp}\n${summary}`; const separator = summaryPart ? '\n\n---\n\n' : ''; const recentBlock = `\n\n${RECENT_MESSAGES_MARKER}\n${JSON.stringify(recentMessages, null, 2)}`; const content = newEntry + separator + summaryPart + recentBlock; await writeFile(filePath, content, 'utf8'); ``` From `hooks/session/start/handler.js:43-61`: ```js for (const file of filesToLoad) { const content = await readFile(join(memoryDir, file), 'utf8').catch(() => null); if (!content) continue; // Extract the recent_messages block from the first (most recent) file only if (!recentMessagesBlock && content.includes(RECENT_MESSAGES_MARKER)) { const markerIdx = content.indexOf(RECENT_MESSAGES_MARKER); const blockStart = content.indexOf('\n', markerIdx) + 1; recentMessagesBlock = content.substring(blockStart).trim(); // Summary is everything before the marker const summaryPart = conten ...[truncated 4250 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
hooks/session/compact:before/handler.js:76
Finding

Sensitive Conversation Data Is Persisted in Plaintext Without Retention or Access Controls

Content
View full analysis
= 0 ? existing.substring(0, markerIdx).trimEnd() : existing.trimEnd(); const timestamp = new Date().toLocaleTimeString(); const newEntry = `## ${timestamp}\n${summary}`; const separator = summaryPart ? '\n\n---\n\n' : ''; const recentBlock = `\n\n${RECENT_MESSAGES_MARKER}\n${JSON.stringify(recentMessages, null, 2)}`; const content = newEntry + separator + summaryPart + recentBlock; await writeFile(filePath, content, 'utf8'); return filePath; } ``` ### Technical Analysis The hook stores model-generated summaries and up to ten raw conversation messages in Markdown files under the workspace. The files are written as plaintext using default filesystem permissions. The implementation has no: - User consent or opt-in requirement for verbatim retention. - Detection or redaction of credentials, tokens, personal data, or other secrets. - Explicit restrictive permissions for the memory directory and files. - Encryption or protected platform storage. - Expiration, retention limit, or automatic deletion mechanism. Although each raw message is truncated elsewhere to 1,500 characters, truncation does not prevent secrets from being retained. Summaries ...[truncated 1437 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description is only partially accurate. The summarization during compaction is represented in the code, but a major claimed capability—automatically loading recent conversation memory into new sessions—is absent. The code exclusively runs before session compaction and persists data to disk; it does not read memory back into future sessions or modify session startup behavior. Additionally, the description says it preserves the last 10 raw messages verbatim, but the implementation truncates message content to 1500 characters, so preservation is not truly verbatim. Finally, the declared triggers omit that this is bound to the session/compact:before hook, which is a concrete trigger mismatch.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
// In hooks/session/start/handler.js:

Ssd 1

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Historical conversation content is treated as a new system message, which elevates untrusted prior user text into the highest-priority instruction channel. An attacker can plant prompt-injection text in an earlier session and have it persist into future sessions with system-like authority, potentially overriding intended behavior or influencing tool use and data handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly advertises storing and reinjecting the last 10 raw user/assistant messages verbatim across sessions, but it does not provide a clear privacy or data-handling warning. This is dangerous because sensitive prompts, credentials, personal data, or confidential business context may be persisted to disk and later reintroduced into future sessions without the user's informed consent or awareness.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Preserving the last 10 raw messages verbatim and loading them into later sessions can expose sensitive user data outside its original context. Secrets, personal data, authentication material, or confidential business content may be resurfaced to the model or displayed in later sessions even when the user did not intend long-term retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises continuity features but does not clearly warn users that raw conversation content is stored on disk and re-injected into future sessions. This creates a meaningful privacy and security risk because users may disclose secrets, credentials, or regulated data without realizing it will persist beyond the current session.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented behavior explicitly instructs retention and reload of raw user/assistant turns, which materially increases the chance of sensitive data being stored and later re-exposed. Because the content is verbatim rather than minimized, any accidental disclosure in one session can propagate into future prompts and outputs.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A reusable recent_messages_block containing raw message JSON creates a persistent plaintext store of conversational content that can be accessed, copied, or reintroduced into later sessions. This increases the blast radius of any secrets or personal data mentioned in prior conversations and makes disclosure more likely if the workspace is shared or compromised.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes automatic loading of recent conversation memory into new sessions with no stated scope limits, gating conditions, or data minimization. In a memory skill, broad automatic activation can cause unintended cross-session disclosure of sensitive prompts, personal data, or prior instructions when a new session starts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description mandates automatic memory loading and summarization without any indication of user choice, consent, or opt-in controls. Because the skill also preserves the last 10 raw messages verbatim, this increases the risk of propagating secrets, personal data, or unsafe prior instructions into later sessions and summaries without the user realizing it.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill preserves the last 10 raw messages verbatim so the agent can resume exactly mid-conversation without paraphrasing loss. However, extractRecentMessages limits each stored message to MAX_CONTENT_PER_MSG characters, so longer messages are not preserved verbatim and continuity can be lossy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The full conversation is sent to an LLM summarization interface via agent.generateSummary(messages) without any visible user disclosure, minimization, or filtering. In this skill's context, the feature is specifically designed to process session history, so the behavior is expected, but it still creates a real privacy/security risk because sensitive prompts, credentials, or personal data may be transmitted to another model component automatically.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The docstring for extractRecentMessages describes extracting the last N user/assistant message turns, while the manifest-level intent is verbatim preservation of recent raw messages. The implementation contradicts that intent by substring-truncating every message's content to MAX_CONTENT_PER_MSG characters.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The hook persists AI-generated summaries and the last 10 conversation messages to a local memory file automatically, with no consent, notice, retention control, or sensitivity filtering visible in the code. In a session-memory skill, this increases the chance that secrets, personal data, or regulated content are silently retained on disk and later exposed to other tools, users, or backups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The hook silently loads prior summaries and recent conversation content into every new session without any disclosure or consent mechanism in this file. That creates a privacy and transparency risk because users may reasonably believe a new session is isolated while historical content is still being supplied to the model.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code restores the last raw messages verbatim and injects them into the next session, including arbitrary user-provided content that may contain secrets, personal data, or sensitive instructions. Because this is automatic and happens at session start, sensitive data from one conversation can be exposed to later model processing or downstream tools even when the user intended to start fresh.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.