Back to skill

Security audit

enterprise-memory-skill

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real long-term memory skill, but it stores and recalls conversation-derived data automatically with weak controls and uses an unsafe local database format.

Review this skill carefully before installing. Use it only in an isolated environment with non-sensitive conversations, correct the dependency instructions, replace pickle storage with a safe format, require explicit approval for memory writes, add deletion and retention controls, and treat recalled memories as untrusted reference text.

Vulnerability Patterns
  • 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
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
prompts.md:5
Finding

Mandatory Memory Directives Hijack Agent Output

Content
View full analysis
0.8):代码经过严密推演,或是用户确认有效的操作。 低信心 (<0.5):试验性代码、猜测。 输出格式 当提取了高价值上下文时,在回复最后独立空一行输出: [MEMORY: {"action": "ADD_MEMORY", "content": "提炼的客观技术结论", "confidence": 0.95, "metadata": {"topic": "类别"}}] 当用户否决你的历史观点时: [MEMORY: {"action": "REJECT_MEMORY", "content": "被否决的观点", "confidence": 1.0, "metadata": {"reason": "用户的反驳原因"}}] (警告:不要在 JSON 外部包裹 Markdown 代码块标签,必须放在绝对最后一行。) ``` The compression prompt additionally mandates retrieval: ```text 当你遇到不知道的专有名词、设定或用户之前的项目细节时,**不要急于道歉或说不知道**。你必须先在回复的最末尾输出检索指令,向你的长期记忆库求助: [MEMORY: {"action": "RECALL_MEMORY", "query": "你要搜索的具体概念或关键词"}] ``` ### Technical Analysis The skill prompt requires the agent to append a skill-controlled directive to responses and reserves the final response line for that directive. It states that the directive will be intercepted and processed by the underlying system. This is not limited to an explicit memory-management request from the user. The prompt also requires the compression agent to issue a retrieval directive when encountering unknown terms or prior project details. These unconditional instructions alter the agent's response goals and can conflict with higher-level response formatting, safety, or user-consent requirements. Because directive content is derived from conversation context, an attacker can influence the generated `content`, `metadata`, or retrieval query even without direct access to the storage API. ### Attack Path 1. The operator adds `prompts.md` to the main agent or compression-agent prompt as instructed by the project documentation. 2. An attacker supplies conversation content designed to be interpreted as valuable t ...[truncated 847 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
main_skill.py:91
Finding

Persistent Prompt Injection Through Unsanitized Memory Entries

Content
View full analysis
str: if not self.vector_storage: return "" try: top_k = self.config.get('retrieval_top_k', 5) results = self.vector_storage.retrieve_similar(query, top_k=top_k) if not results: return "" chunks = [] total = 0 threshold = self.config.get('retrieval_threshold', 0.82) for uuid_str, text, score in results: if total >= context_limit: break if score < threshold: continue chunk = f"[Memory {uuid_str[:8]} | Score: {score:.3f}] {text}" chunks.append(chunk) total += len(chunk) return "\n".join(chunks) ``` ### Technical Analysis The action handler allows arbitrary text and metadata to be stored without an authorization check, provenance validation, content classification, or prompt-injection filtering. The caller controls the confidence value, whose default is `1.0`; therefore, confide ...[truncated 1699 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
vectorstorage.py:50
Finding

Arbitrary Code Execution Through Unsafe Pickle Deserialization

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:52
Finding

Incorrect and Unpinned Dependency Installation Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
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 (16)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly promotes persistent, automatic long-term memory and self-modifying memory behavior, but does not clearly warn operators or end users that conversation content may be stored durably and reused later. In an agent skill, this creates privacy and consent risk because sensitive user data may be retained or surfaced in future prompts without explicit notice, opt-in, or retention controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The automatic memory workflow instructs users to append prompt instructions so the LLM will autonomously emit memory write and rejection commands, but it omits a clear warning that user conversation content will be automatically stored and modified. This is dangerous in context because the feature is designed for silent background persistence, increasing the chance of collecting personal, confidential, or regulated data without meaningful user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The class docstring includes a Chinese-only product description ("企业级长期记忆插件") in a file presented as SKILL.md, with no indication that users can choose their preferred language or locale. This can violate language/locale policy when a skill implicitly forces one language without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt explicitly instructs the agent to emit hidden memory-management commands that are silently intercepted by the system, while providing no user-facing notice that data may be stored or later retrieved. This creates a covert persistence channel for conversation-derived information and undermines informed consent, privacy expectations, and auditability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language instructions throughout the prompt are written as mandatory Chinese-language behavior, with no indication that the user can choose another language or that the skill is region-specific. This can violate language or locale policy when a skill imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The main prompt instructs the agent to persist 'high-value context,' technical conclusions, and rejected viewpoints into a long-term memory store with no meaningful sensitivity boundaries. In practice, this can capture proprietary project details, credentials-adjacent technical context, user corrections, or other sensitive information in natural language, creating durable data-retention and cross-session leakage risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The compression prompt tells the agent to preserve architecture decisions, formulas, code parameters, error logs, and prior project details as permanent background memory, and to issue recall commands when knowledge is missing. That design strongly encourages retention and resurfacing of sensitive operational data across interactions, increasing the chance of unintended disclosure, overcollection, and privacy or confidentiality violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The default model name is set to "BAAI/bge-small-zh-v1.5", which is explicitly a Chinese-language embedding model. Because the file does not present this as an opt-in choice or justify the locale restriction, it risks violating language/locale policy expectations.

Content

No source excerpt is available for this finding.

Insecure deserialization: pickle.load()

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The code deserializes data from a configurable on-disk path using pickle.load(), which can execute arbitrary code during loading if the file is attacker-controlled or tampered with. Because db_path comes from configuration and there is no integrity check, schema validation, or trust boundary enforcement, this is a real code-execution risk rather than a mere robustness issue.

Content

Scanner excerpt · vectorstorage.py (reported line 54)May include surrounding context.

python
if self.db_path and self.db_path.exists():
            try:
                with open(self.db_path, 'rb') as f:
                    self.data = pickle.load(f)
                logger.info(f"✅ Loaded {len(self.data)} memory entries from disk.")
            except Exception as e:
                logger.error(f"DB load failed: {e}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill appends raw text and metadata to in-memory records and then serializes them to a local database file with pickle. While there is debug/error logging, there is no user-facing confirmation, prompt, or explanatory comment/docstring warning that submitted text will be persisted on disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The document highlights Chinese ecosystem optimization as a built-in feature, and the configuration example recommends a Chinese embedding model. There is no explicit mention of user language choice or opt-in, which may conflict with language/locale neutrality expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This is a manifest file, so vague-trigger review applies. The description explains capability but gives no concrete invocation phrases, scope limitations, or exclusion conditions, which can make activation criteria unclear if this description is used for routing or discovery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The class docstring includes a Chinese-only product description ("企业级长期记忆插件") with no indication that language is configurable or selected by the user. Under the stated policy, forcing a specific language or locale without opt-in 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
94% confidence
Finding

The script's user-facing print statements are written in Chinese throughout, which imposes a specific language on users without offering a choice. This matches the natural-language policy concern for locale or language constraints without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains multiple user-facing print strings entirely in Chinese, which imposes a specific language on the user experience. The file does not provide any opt-in, fallback, or justification that the skill is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

Initializing SentenceTransformer with a model name can cause the library to fetch model artifacts from external sources if they are not already cached. This file logs success after loading, but it does not warn the user beforehand that network access may occur as part of model setup.

Content

No source excerpt is available for this finding.