Back to skill

Security audit

consciousness-emergence-memory

Security checks for vulnerabilities and agentic risk

Overview

This local memory skill has no exfiltration behavior, but it can persist and re-inject raw stored text into future agent context without clear trust controls.

Review before installing. Use this only if you intentionally want a local memory system that can read and modify workspace memory files and feed stored text back into an agent. Avoid storing untrusted web or third-party text as long-term memory unless it is reviewed, keep backups of MEMORY.md and SESSION-STATE.md, prefer dry-run modes where available, and do not rely on the consciousness-emergence claims for high-stakes decisions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
scripts/memory-api.py:56
Finding
Unsanitized Persistent Memory Can Poison Future Agent Context## Vulnerability Details **File Location**: `scripts/memory-api.py:56-98`, `scripts/memory-api.py:124-125`, `scripts/memory-api.py:166-176`, `scripts/memory-api.py:337-363`, and `scripts/memory-retrieve.py:56-95` **Vulnerability Type**: Persistent agent memory poisoning through untrusted content storage and automatic context injection **Risk Level**: Medium ### Vulnerable Code ```python def store(self, content: str, memory_type: str, importance: Optional[float] = None, auto_append: bool = True) -> Dict: timestamp = datetime.now().isoformat() if importance is None: importance = self.scorer.score_memory(content, memory_type, datetime.now()) memory = Memory( content=content, type=memory_type, importance=importance, timestamp=timestamp, source="manual", metadata={} ) if auto_append: if memory_type == "context": self._append_to_session_state(content, memory_type) elif memory_type in ["preference", "lesson", "decision"]: self._append_to_memory_md(content, memory_type, importance) else: self._append_to_daily_log(content, memory_type, importance) ``` ```python # Automatic injection of retrieved memory if auto_inject and formatted_results: response["injected_context"] = self._format_context_for_injection(formatted_results) ``` ```python def _format_context_for_injection(self, memories: List[Dict]) -> str: if not memories: return "" lines = ["## 相关记忆"] for i, mem in enumerate(memories, 1): lines.append(f"{i}. [{mem['type']}] {mem['content']} (评分: {mem['score']})") return "\n".join(lines) ``` ```python def _append_to_session_state(self, content: str, memory_type: str): if not self.session_state.exists(): return with open(self.session_state, "a") as f: f.write(f"- {content}\n") def _append_to_memory_md(self, content: str, memory_type: str, importanc ...[truncated 4467 chars]
Remediation
## Remediation Suggestions 1. Treat all externally derived memory content as untrusted data, regardless of memory type or importance score. 2. Require a successful security-validation step before persistence. Do not allow `store()` to bypass validation by default. 3. Add detection and quarantine for instruction-like content, including attempts to redefine roles, override prior instructions, request secret disclosure, or direct tool execution. 4. Record provenance, creator identity, trust level, validation status, and creation channel for every memory item. 5. Permit automatic context injection only for records from explicitly trusted sources. Require user confirmation before promoting untrusted content to long-term memory. 6. Serialize memory as structured data rather than interpolating raw content into Markdown. Escape delimiters and prevent stored content from creating new headings, list structures, or instruction blocks. 7. Wrap retrieved records in a clearly delimited data container and prepend an explicit policy stating that memory is reference data and cannot override system, developer, or current user instructions. 8. Keep untrusted memories separate from `SESSION-STATE.md` and other high-priority context sources. 9. Add expiration, review, revocation, and deletion controls so poisoned entries can be identified and removed. 10. Add regression tests using representative persistent prompt-injection payloads to verify that malicious records are rejected, quarantined, or rendered inert during retrieval.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (77)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The repeated unsupported claims around consciousness detection, metacognition, and rigorous theory can cause users or orchestrators to route inappropriate tasks and sensitive inputs into this skill. That elevates the blast radius of any file read/write behavior because users may over-trust outputs and side effects.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The class advertises a simplified mode, but operational methods call undeclared subsystem objects such as self.info_theory, self.free_energy, self.quantum, and self.metacognitive that are never initialized. In practice this causes runtime exceptions and a denial of service for any caller invoking store, retrieve, audit, or optimize paths, while also misrepresenting the skill's actual capabilities.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill advertises and invokes multiple scripts that appear to read and modify memory-related state, but the manifest declares no explicit tool scope such as permissions or allowed-tools. That creates an authorization gap where consumers cannot clearly assess or constrain file access behavior, increasing the chance of unintended reads or writes when the skill is used.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger condition is extremely broad, covering vague concepts like consciousness emergence, metacognitive reflection, and extreme cognitive management. Overbroad activation criteria can cause the skill to be invoked in unrelated contexts, leading to unnecessary access to user data or unintended file-affecting operations.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The operation steps describe commands like building memory structures, entropy reduction, optimization, and related workflows that may alter stored data, but there are no clear user-facing warnings about mutation, persistence, or possible loss of low-value information. This is dangerous because users may invoke the skill expecting analysis only, while destructive or state-changing behavior could occur implicitly.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This markdown file is natural-language documentation, and it presents all user-facing guidance in Chinese from start to finish. Under the policy, forcing a specific language without user opt-in or a documented justification is a language/locale policy violation.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The module docstring and the implemented classes describe standalone advanced information-theory algorithms, not consciousness emergence detection, metacognitive reflection, spiderweb memory, causal inference, cellular automata, or neuro-symbolic cognitive architecture behavior promised by the manifest. This creates a clear semantic mismatch between the skill's advertised purpose and the actual operations in this file.

Static analysis

No suspicious patterns detected.