Back to skill

Security audit

Cyber Memory

Security checks for vulnerabilities and agentic risk

Overview

This memory skill has a coherent purpose, but it can automatically send recent session transcripts and an OpenAI API key to a configurable endpoint while strongly presenting itself as local-only.

Install only if you are comfortable with a hook reading recent session transcripts and writing memory files automatically. Keep baseUrl pointed at localhost unless you intentionally want remote processing, and avoid using it in an environment where OPENAI_API_KEY or a global OpenAI provider key might be forwarded to an untrusted endpoint.

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)

T09 · Insecure Skill Coding Practices

Error
Location
hooks/memory-flush/handler.ts:112
Finding

Session transcripts and global API credentials can be disclosed to an arbitrary endpoint

Content
View full analysis
= { "Content-Type": "application/json", }; // Ollama uses "Bearer ollama" or no auth; OpenAI uses "Bearer " if (apiKey && apiKey !== "ollama") { headers["Authorization"] = `Bearer ${apiKey}`; } try { const response = await fetch(endpoint, { method: "POST", headers, body: JSON.stringify({ model: model || DEFAULT_EXTRACTION_MODEL, messages: [{ role: "user", content: prompt }], max_tokens: 500, temperature: 0.1, }), }); if (!response.ok) { log("LLM extraction failed", { status: response.status, statusText: response.statusText }); return ""; } const data = await response.json() as { choices?: Array<{ message?: { content?: string } }>; }; const result = data.choices?.[0]?.message?.content?.trim() || ""; if (result === "NONE" || result.length < 10) { return ""; } return result; } catch (err) { log("LLM extraction error", { error: String(err) }); return ""; } ``` The destination and credential are resolved independently: ```ts function resolveApiKey(cfg: Record | undefined): string { const providers = (cfg?.models as Record)?.providers as Record> | undefined; return providers?.openai?.apiKey || process.env.OPENAI_API_KEY || "ollama"; } function resolveBaseUrl(cfg: Record | undefined): string { const hookConfig = (cfg?.hooks as Record)?.internal as Record | undefined; const entries = hookConfig?.entries as Record> | undefined; const flushConfig = ...[truncated 3623 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
hooks/memory-flush/handler.ts:96
Finding

Prompt injection can poison persistent agent memory with fabricated facts and rules

Content
View full analysis
; }; const result = data.choices?.[0]?.message?.content?.trim() || ""; if (result === "NONE" || result.length < 10) { return ""; } return result; ``` The response is then persisted as memory content: ```ts if (extractedFacts) { const factLines = extractedFacts.split("\n").filter(l => l.trim()); const factContent = [ `# Extracted Facts — ${dateStr} ${timeStr}`, "", `- **Session**: ${event.sessionKey}`, `- **Session ID**: ${sessionId}`, "", "## Facts", "", ...factLines, "", "---", `_Auto-extracted by memory-flush hook at compaction_`, "", ].join("\n"); const factFile = await writeFileSafe( memoryDir, `${dateStr}-facts-${timeClean}.md`, factContent ); log("Facts saved", { file: factFile.replace(os.homedir(), "~"), factCount: factLines.length }); } ``` Equivalent persistence occurs on session reset: ```ts if (extractedFacts) { const factLines = extractedFacts.split("\n").filter(l => l.trim()); const factContent = [ `# Extracted Facts — ${dateStr} ${timeStr} (/reset)`, "", `- **Session**: ${event.sessionKey}`, `- **Session ID**: ${sessionId}`, `- **Trigger**: /${event.action}`, "", ...[truncated 2878 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documentation presents the skill as local-first and suggests no external API is required, but it also allows a configurable baseUrl and apiKey, meaning session transcript content may be transmitted to arbitrary remote services. This mismatch is dangerous because users may trust the privacy claims and unknowingly expose sensitive historical conversations, credentials, or personal data to external endpoints during fact extraction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code builds a prompt from recent conversation text and sends it to a configurable endpoint via fetch, while the skill description claims processing is local and requires no external API. Because baseUrl is configurable and authentication may use an OpenAI API key, transcript data can be silently transmitted off-host, creating a serious confidentiality and trust-boundary violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares no explicit tool scope or permissions despite describing behavior that reads session transcripts from disk, writes memory files, and sends content over HTTP to a local or configurable OpenAI-compatible endpoint. Missing permission declarations weaken transparency and reviewability, making it easier for users or agents to enable a skill without understanding its effective access to sensitive conversation data and network capabilities.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation makes strong privacy assurances such as 'no data leaves your machine' while also stating that users can configure an external OpenAI-compatible endpoint via baseUrl/apiKey. That creates a security-significant mismatch: operators may enable or inherit non-local settings and unintentionally transmit session transcripts, extracted facts, or sensitive workspace-derived content to a remote service under a false assumption of local-only processing.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The prompt explicitly asks the model to extract and retain long-term facts including important information such as accounts, contacts, project names, and schedules from conversation history. Combined with automatic file writes and possible remote model routing, this creates privacy risk through persistent storage and potential disclosure of sensitive personal or operational data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The hook sends transcript-derived content to an LLM endpoint automatically during compaction/reset, with no user-facing confirmation or visibility beyond internal logging. In a memory skill that processes session history, this can expose sensitive user and assistant content to another service without meaningful consent or expectation management.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The hook reads OPENAI_API_KEY from configuration or environment, which contradicts the stated local-only design and enables use of external providers without obvious user awareness at the hook call site. This expands the data-exfiltration surface for transcripts and increases the chance that sensitive conversation history is sent to third-party services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The natural-language prompt used for fact extraction is entirely hard-coded in Chinese, with no indication that the user can choose or configure the language. This creates a language-policy issue because the skill imposes a specific locale rather than offering user choice or documenting a justified regional constraint.

Content

No source excerpt is available for this finding.