Back to skill

Security audit

Muninn Memory

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed agent-memory skill that stores and retrieves user-provided memories, with some implementation-quality and configuration risks users should review.

Before installing, treat this as a persistent memory system: only store information you are comfortable retaining, decide whether to use local Ollama or cloud/API embedding paths, and set a strong MUNINN_INTEGRITY_SECRET if using integrity verification. Also verify the publisher and benchmark/cloud claims separately if those are important to you.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/storage/integrity.ts:123
Finding

Predictable Default HMAC Secret Undermines Memory Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: src/storage/integrity.ts:123-130
Vulnerability Type: Hard-coded cryptographic secret
Risk Level: Medium

Vulnerable Code

ts
export class IntegrityStore {
  private db: Database.Database;
  private secretKey: string;
  
  constructor(db: Database.Database, secretKey?: string) {
    this.db = db;
    this.secretKey = secretKey || process.env.MUNINN_INTEGRITY_SECRET || 'default-secret-change-in-production';
    this.initializeTables();
  }

Technical Analysis

The integrity subsystem silently falls back to the public, predictable string default-secret-change-in-production when neither a constructor argument nor MUNINN_INTEGRITY_SECRET is supplied. The same secret is later used to produce HMAC signatures for stored memories.

An HMAC only establishes authenticity while its key remains secret. Because the fallback is embedded in distributed source code, any attacker who can modify the SQLite database can calculate valid signatures for forged memory content. The integrity check may consequently treat attacker-modified records as authentic.

This is especially relevant because stored memories are later used for semantic retrieval and can influence agent responses and decisions. The issue does not independently grant database access; exploitation requires an existing ability to modify the database or its records.

Attack Path

  1. A deployment starts without setting MUNINN_INTEGRITY_SECRET and without passing a secret to IntegrityStore.
  2. The application uses the published default value as its HMAC key.
  3. An attacker obtains write access to the SQLite database through another local compromise, exposed database file, insecure backup, or excessive filesystem permissions.
  4. The attacker changes the content or entities of a stored memory.
  5. Using the known default key and the documented hashing logic, the attacker recomputes the correspond ...[truncated 856 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the hard-coded fallback and fail securely when no secret is configured:

    ts
    const configuredSecret = secretKey || process.env.MUNINN_INTEGRITY_SECRET;
    if (!configuredSecret) {
      throw new Error('MUNINN_INTEGRITY_SECRET must be configured');
    }
    this.secretKey = configuredSecret;
    
  2. Require a cryptographically random key with at least 256 bits of entropy. Provide a documented generation command, such as:

    bash
    openssl rand -base64 32
    
  3. Store the key in an operating-system secret store, container secret, or managed key service rather than in source code, logs, command-line arguments, or the memory database.

  4. Validate minimum key strength during initialization and reject placeholder or commonly known values.

  5. Restrict database and backup permissions to the service account that requires access.

  6. Implement key rotation with explicit key identifiers and controlled re-signing of existing records. Rotating the key without a migration strategy would otherwise make legitimate historical records unverifiable.

  7. Add automated tests confirming that production initialization fails when the secret is missing or set to the former default value.

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 (225)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared purpose presents the skill as a production memory offering for AI agents with specific capabilities and performance claims. The supplied code chunk does not implement or expose that primary product behavior; instead, it is a benchmark script for evaluating the memory system on the LOCOMO dataset. It reads a JSON dataset from disk, writes to temporary local database files, recalls memories, invokes an answer generator using a default OpenAI model, evaluates correctness with substring matching, and prints comparative benchmark tables. While this is related to the memory product and supports the LOCOMO claim, the chunk’s actual purpose is evaluation/testing, not production memory service behavior. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a production memory platform for AI agents, emphasizing Cloudflare-native operation, knowledge graph, temporal reasoning, and multi-hop retrieval. The supplied code chunk does not implement or demonstrate those headline capabilities directly. Instead, it is an example script focused on audit integration: wrapping memory store operations with audit hooks, measuring recall duration, calculating staleness, gathering retrieval stats, and adjusting similarity scores based on staleness. It also initializes a local SQLite-like database path under /tmp, which does not reflect the stated Cloudflare-native positioning. While some overlap exists because the code uses a MemoryStore and temporal/staleness concepts, the primary behavior of this chunk is auditing and instrumentation, which is not represented in the declared purpose. Therefore this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a full production memory platform for AI agents, emphasizing Cloudflare-native deployment, knowledge graph capabilities, temporal reasoning, and multi-hop retrieval. The supplied code chunk instead implements a command-line utility focused narrowly on entity extraction and maintenance from a local SQLite memories database. It reads from a local DB, exposes operational commands like scan/list/merge/alias/find/export/clear, and writes an export file to the local filesystem. While entity extraction could be a supporting component of a memory system, this chunk’s actual purpose and interfaces are materially different from the advertised product-level description, and it performs undeclared local data access and file output capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk does not implement a broad AI-agent memory service; it implements a specific local CLI for entity extraction and maintenance over a SQLite memories table. It reads from a local database, manages canonical entities and aliases, and exports stats to a local JSON file. There is no evidence here of Cloudflare-native operation, a production hosted memory platform, temporal reasoning, or multi-hop retrieval. While entity extraction could be a supporting piece of a knowledge graph pipeline, this chunk alone is much narrower than the declared description and lacks the flagship capabilities being advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents the skill as a full AI-agent memory product with advanced retrieval and reasoning features. The supplied code chunk only performs entity extraction from text using predefined vocabularies, regexes, and simple context inference. There is no evidence here of memory persistence, retrieval, knowledge graph operations, temporal reasoning, multi-hop retrieval, Cloudflare-specific integration, or any broader production memory capabilities. Entity extraction could be a supporting subcomponent of such a system, but the description materially overstates the functionality represented by this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a full production memory platform for AI agents with advanced capabilities like knowledge graphs, temporal reasoning, and multi-hop retrieval. The supplied code chunk does not implement those functions. Instead, it only extracts entities from text via predefined vocabularies, regexes, and simple context inference. Entity extraction could be a supporting component of a memory system, but by itself it does not substantiate the broader declared purpose. Therefore, this code chunk materially underdelivers relative to the description and indicates a clear description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The code chunk is narrowly focused on building and maintaining a canonical entity list from memory text. It performs entity registration, alias handling, fuzzy matching, merging, export, and persistence to /tmp, plus calls a local model endpoint at localhost:11434 for extraction. This partially relates to a memory/knowledge-graph pipeline, but it does not implement the broader declared product behavior such as production memory infrastructure, temporal reasoning, or multi-hop retrieval. The resource usage also suggests local disk and local model dependencies rather than the described Cloudflare-native service. Therefore the description overstates or misrepresents what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad production memory platform for AI agents with cloud-native operation, knowledge graph, temporal reasoning, and multi-hop retrieval. The supplied code chunk is much narrower: it is an entity-builder module that extracts named entities from text via a local model API, persists a cache to the local filesystem, and performs alias clustering and deduplication. While entity extraction could be a supporting component of a memory/knowledge-graph system, the actual behavior shown does not substantiate the main advertised capabilities and includes undeclared resource access (filesystem and localhost network call). Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The supplied code chunk is focused on NLP preprocessing for entities: expanding abbreviations, resolving some pronouns, normalizing relative dates, handling spelling variants, maintaining an alias map, and combining extraction with normalization. While aliasing and date normalization could support a memory system, this code does not itself implement 'production memory for AI agents' or the advertised capabilities like Cloudflare-native infrastructure, knowledge graphs, temporal reasoning beyond simple date parsing, or multi-hop retrieval. The primary purpose of the code is materially narrower and different from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a full production memory platform for AI agents with knowledge graphs, temporal reasoning, and retrieval features. The supplied code, however, is a focused text-processing module for normalizing entities and aliases. It supports some memory-adjacent preprocessing (e.g., date normalization and alias storage), but it does not implement the core advertised capabilities such as persistent memory, Cloudflare integration, knowledge graph operations, or multi-hop retrieval. This is therefore a material description-to-behavior mismatch, not just an incomplete excerpt of a clearly matching feature.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied code only performs heuristic text classification into memory categories using predefined keywords, regexes, and score normalization. That is at best a small supporting component of a memory system, not the described full production memory platform. Major declared capabilities—cloud-native deployment, memory persistence, knowledge graphs, temporal reasoning, and multi-hop retrieval—are absent from this chunk. The code’s primary purpose is routing/classification, which materially underdelivers relative to the broad product description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code only performs deterministic text classification into memory types based on regexes and keyword lists. That may be a supporting component of a memory system, but the declared description presents a much broader product: production-grade agent memory with Cloudflare-native deployment, knowledge graph support, temporal reasoning, and multi-hop retrieval. None of those capabilities are evidenced in this chunk. The function name routeWithLLM is also misleading because it simply calls the keyword router and explicitly notes no LLM is used. This is therefore a material description-to-behavior mismatch, not merely an omitted implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code partially supports the declared 'temporal reasoning' claim by extracting and resolving date expressions, including simple context-aware relative dates. However, it does not implement a memory system, storage, agent memory management, Cloudflare-native functionality, free-tier/billing aspects, or a knowledge graph. Its actual purpose is much narrower: a temporal parser utility. Because the declared description presents a substantially broader product capability set than this code demonstrates, this chunk is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad product-level capability: a production memory system for AI agents with Cloudflare-native deployment, knowledge graph, temporal reasoning, and multi-hop retrieval. The supplied code chunk only implements temporal reasoning in a narrow sense: parsing relative and absolute time expressions and resolving some context-based relative dates. That supports one small aspect of the description ('temporal reasoning'), but does not substantiate the primary claimed purpose of an AI memory platform, nor the claimed infrastructure and retrieval capabilities. Therefore the description materially overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description markets a production AI memory platform with advanced retrieval and reasoning capabilities, but this code chunk only shows a basic entry point. Its actual behavior is limited to parsing CLI args, running a quick local test against a MemoryStore database file in /tmp, printing results, or instructing the user to start an MCP server elsewhere. None of the advertised advanced capabilities—knowledge graph, temporal reasoning, multi-hop retrieval, Cloudflare-native behavior, or production server operation—are demonstrated here. Additionally, the code accesses a local storage path, which is inconsistent with the empty declared permissions/resources. While this may be only one file, based on the supplied chunk there is a material description-versus-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about agent memory infrastructure and retrieval capabilities, but the code chunk is focused on procedural optimization: analyzing failures, calculating reliability trends, deciding when to auto-evolve, and generating revised steps using an LLM. There is no evidence here of memory storage, knowledge graphs, temporal reasoning, multi-hop retrieval, or Cloudflare-native functionality. The local fetch to an LLM endpoint is also an operational capability not reflected in the declared permissions/description. This is a clear primary-purpose mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a production memory system for AI agents, emphasizing memory persistence and retrieval features. The actual code chunk does not implement or expose memory capabilities; it is a test harness for a procedure evolution component. It evaluates reliability metrics, decides whether a procedure should auto-evolve, invokes failure analysis and evolution functions, and reports test outcomes. This is a materially different purpose from the declared memory platform, so the description does not accurately represent the code shown.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description markets an AI-agent memory product with advanced retrieval and knowledge-graph features. The supplied code does not implement or exercise memory storage/retrieval functionality; instead, it is a test suite for evolving procedural workflows based on failures and reliability metrics. Its primary purpose is materially different from the declared purpose, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about an AI-agent memory system, but this code chunk is focused on evolving procedural workflows after failures. Its primary behavior is analyzing failed procedure steps with an LLM, calculating reliability metrics from historical events, deciding when to auto-evolve, and generating updated procedure steps. That is materially different from memory management, knowledge graphs, or retrieval. The fetch call to a local Ollama API is also an operational capability not reflected in the declared purpose. While some light historical scoring exists, it does not amount to the described temporal reasoning or memory product.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code chunk is a narrow profile abstraction module, not a full memory platform. It reads from and writes to a local SQLite-style database (better-sqlite3), extracting long-term and recent facts from entities, facts, episodes, and profiles tables, then formats and caches a profile. While this may support a larger memory system, the specific advertised capabilities—Cloudflare-native deployment, knowledge graph reasoning, temporal reasoning, and multi-hop retrieval—are not actually implemented in this chunk. The only temporal behavior is simple filtering by recent dates and cache freshness. There is no evidence of retrieval orchestration, graph traversal, Cloudflare integration, or LOCOMO evaluation. Therefore the description materially overstates what this code does, and the undeclared database access also differs from the declared permissions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents the skill as a production memory platform with Cloudflare-native architecture and advanced retrieval/reasoning features. However, this code chunk specifically performs downstream answer synthesis and correctness checking by sending retrieved memory snippets to OpenAI's API. That is a materially different capability from the described memory infrastructure itself. It also accesses an external network service using an API key, which is not reflected in the declared permissions. While answer generation could be a supporting component of a memory product, the advanced claimed features—knowledge graph, temporal reasoning, multi-hop retrieval, and Cloudflare-native operation—are not implemented or evidenced in this code. Therefore the description does not accurately represent this chunk's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code chunk only implements a BM25 lexical search component over an in-memory document set. It does not show functionality for agent memory management, persistence, cloud infrastructure, knowledge graph construction/querying, temporal reasoning, or multi-hop retrieval orchestration. While BM25 retrieval could be a supporting part of a broader memory system, this specific code materially underdelivers relative to the declared description and represents a narrower, different capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The code chunk is narrowly focused on reranking retrieved documents. It loads a transformer-based model, scores query-document pairs, sorts results, provides a lightweight lexical fallback, and supports changing the reranker model. The declared description, however, presents a broader agent memory product with knowledge graph, temporal reasoning, and multi-hop retrieval capabilities. None of those core capabilities are evidenced in this code. While reranking can be a supporting part of retrieval systems, this chunk’s actual behavior does not accurately represent the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad AI-agent memory platform with multiple advanced capabilities and deployment characteristics. The supplied code chunk, however, is narrowly focused on reranking retrieval results using a cross-encoder or simple term-matching heuristic. While reranking could be a supporting part of a retrieval system, this specific code does not implement memory, knowledge graphs, temporal reasoning, multi-hop retrieval, or Cloudflare-native behavior. Because the actual code behavior is materially narrower and does not substantiate the main declared purpose, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a production memory platform with advanced memory retrieval capabilities such as knowledge graphs, temporal reasoning, and multi-hop retrieval. The supplied code chunk does not implement those memory functions; instead, it provides an access logging subsystem for memory-related events. While logging can be a supporting component of a memory product, this chunk’s actual behavior is specifically audit logging, metrics collection, and analytics over logged operations. Those are undeclared capabilities in the description, and the advertised core capabilities are not represented in this code. Therefore this chunk does not accurately match the declared purpose.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/storage/turboquant-client.ts:38

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/retrieval/answer-generator.ts:11

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/storage/embeddings.ts:18

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/storage/index.ts:185