Back to skill

Security audit

Aoju Memory

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is not clearly malicious, but it persistently records user and project context and encourages changing future agent behavior without strong consent, scoping, or sanitization controls.

Install only if you want an agent to keep durable cross-session memory. Before enabling automatic startup or evolution review, set rules that require explicit approval before writing personal/project details or changing SOUL.md/AGENTS.md, avoid storing secrets or sensitive data, and treat generated HTML reports as potentially sensitive and unsafe to share blindly.

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
scripts/mem_learn.py:42
Finding

Persistent Agent Memory Poisoning Through Untrusted Learning Content

Content
View full analysis
str: today = datetime.now().strftime("%Y-%m-%d") learning_file = LEARNINGS_DIR / f"{today}.md" # Append to today's file (or create it) entry = f""" ## Learning: {today} ### Incident {incident} ### Lesson {lesson} ### Context {context or "General situation"} ### Tags {' '.join(f'#{t.strip()}' for t in tags if t.strip())} ### Confidence {confidence} --- """ with open(learning_file, "a", encoding="utf-8") as f: f.write(entry) return learning_file.name ``` `scripts/mem_recall.py:30-62` reads stored content and returns surrounding lines without trust labeling or instruction neutralization: ```python def search_file(path: Path, query: str, limit: int = 5) -> list[dict]: """Search a single file for query matches.""" if not path.exists(): return [] try: content = path.read_text(encoding="utf-8", errors="ignore") except Exception: return [] query_words = query.lower().split() lines = content.split("\n") scored_lines = [] for i, line in enumerate(lines): line_lower = line.lower() # Skip headers and empty lines if not line.strip() or line.startswith("#"): continue score = 0 matched_words = 0 for word in query_words: if word in line_lower: score += 1 matched_words += 1 # Exact phrase match b ...[truncated 4760 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mem_report.py:142
Finding

Stored HTML Injection in Generated Memory Reports

Content
View full analysis
{t}' for t in tags[:4]) if tags else "" conf_icon = "🔴" if "high" in confidence.lower() else ("🟡" if "medium" in confidence.lower() else "⚪") learnings_html += f"""
{lr['date']} {conf_icon} {confidence.strip()}
💬 {incident[:100]}{'...' if len(incident) > 100 else ''}
📝 {lesson[:120]}{'...' if len(lesson) > 120 else ''}
{tag_html}
""" memory_summary = get_memory_summary() summary_lines = [f"

{l}

" if l.strip() and not l.startswith("#") else f"

{l}

" if l.startswith("## ") else f"

{l}

" if l.startswith("### ") else l for l in memory_summary.split("\n")] summary_html = "\n".join(summary_lines) ``` The generated fragments are then inserted directly into the final document in `scripts/mem_report.py:279-292`: ```python

💡 最新学习 ...[truncated 2387 chars]

Remediation
View remediation
``` 6. Add regression tests containing payloads in every rendered field and confirm that the output contains escaped text rather than executable markup. 7. Clearly label the generated report as containing potentially sensitive memory data and recommend storing it with restrictive filesystem permissions. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
83% confidence
Finding

The code is related to the declared self-evolution/learning purpose, but the description overstates and misstates its scope. This script specifically reviews recent learning files, finds repeated tagged themes, prints a report, and archives older learnings into patterns.md while deleting archived source files. It does not implement the broader declared behavior of maintaining MEMORY.md and daily logs, nor does it embody the stated automatic triggers such as session start, significant decisions, feedback, or heartbeat reviews. Its actual resource access is narrower in some places (learnings/patterns files only) and stronger in one respect because it removes files during archiving. Therefore the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description overstates the skill's scope. The code does fit part of the declared purpose—capturing learnings and recording behavioral patterns in a learnings corpus—but it does not implement the broader long-term memory system or the stated activation behavior. There is no handling of session-start context from SOUL.md/USER.md, no automatic triggering after decisions/feedback/heartbeat, and no maintenance of MEMORY.md or daily logs. Its actual primary function is a manual CLI utility for appending learning notes and optionally pattern notes, with a simple every-5-files reminder for evolution review.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broad persistent-memory and self-improvement subsystem that updates memory stores and responds to lifecycle events. The supplied code chunk only reads from specific workspace files and performs keyword-based recall over them. This is a materially narrower and different capability: memory retrieval rather than memory maintenance, learning, or self-evolution. While searching long-term memory is related to the overall theme, the actual code does not implement the core behaviors claimed in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a skill responsible for long-term memory maintenance, learning, self-evolution, and updates triggered by session start, decisions, feedback, and heartbeat reviews. The supplied code does not implement those behaviors. Instead, it is a reporting utility: it inspects existing memory files, computes counts and a health score, extracts summaries, and produces an HTML report. While it accesses memory-related resources consistent with the broader memory domain, its primary purpose is materially different from maintaining or evolving memory. It also writes a new HTML output file, a capability not reflected in the description. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description presents an active memory-management and learning capability that maintains multiple artifacts and runs on specific lifecycle triggers. The supplied code only inspects existing files and outputs a health/status summary. While it is related to the memory subsystem, its primary purpose is materially narrower and different: monitoring rather than maintaining or evolving memory. This is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README promotes long-term memory, session logging, learning from feedback, and HTML report generation, but it does not warn that these features may persist sensitive user data, secrets, or personal information. In a memory skill whose core purpose is to store cross-session context, the lack of privacy guidance materially increases the risk of over-collection, unsafe retention, and accidental disclosure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill explicitly instructs the agent to read and write persistent files but does not declare any tool scope or permission boundary. That creates a least-privilege problem: an integrating agent may grant broader file access than users expect, increasing the chance of unauthorized persistence or accidental modification of local state.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation model is broad and self-triggering: 'session start,' 'significant decisions,' 'feedback,' and 'heartbeat review' can match many normal interactions. In an agent system, ambiguous triggers can cause unintended invocation, excessive file access, and silent persistence of conversation data without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instruction to immediately write lessons, decisions, preferences, and events to files creates persistent side effects without any visible consent, retention notice, or storage limit. Users may reasonably believe they are having an ephemeral conversation, making undisclosed long-term logging a privacy and trust risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill encourages durable storage of broad session details, lessons, preferences, and events into long-term memory files. That creates a natural data retention surface where sensitive user information, project details, or confidential context can accumulate and later be exposed through recall, file access, backup systems, or multi-session reuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Subjective phrases such as 'significant decisions,' 'worth remembering,' or user 'frustration' leave the agent to infer when to write memory, which can over-collect sensitive or irrelevant information. Ambiguity in persistence rules is dangerous because it broadens data capture and increases the chance of storing personal or confidential content by default.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The schema explicitly tells the agent to record facts about the user, preferences, projects, and context in persistent logs, which materially increases privacy and leakage risk. In this skill context, the danger is higher because the purpose is long-term memory across sessions, so any over-collected data is likely to persist and be reused beyond the original conversation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description advertises broad capabilities like long-term memory, learning, and self-evolution without defining concrete activation boundaries or safety constraints. In an agent skill, ambiguous trigger language can cause over-invocation and excessive access to sensitive session context, making the skill more dangerous because it is designed to persist and adapt behavior over time.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script permanently deletes learning files during archival via unlink() without an explicit confirmation step, backup, atomic move, or durable precondition checks. In this skill's context—long-term memory and self-evolution—those files are operationally important, so an unintended run can irreversibly destroy memory data and degrade or manipulate future agent behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This script reads long-term memory files, learning logs, and summaries, then renders their contents into a standalone HTML file written to a predictable location in the user's home directory. Because those memory files may contain sensitive personal, operational, or conversational data, generating an easily shareable browser report without consent prompts, redaction, or privacy warnings creates a real confidentiality risk, especially in the context of an agent memory skill designed to accumulate rich long-term user data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

A core user-facing description is presented in Chinese with no indication that other languages are supported or that the locale restriction is intentional and justified. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring for archive_old_learnings says it archives learnings older than N days, but main passes in parsed learnings derived from get_recent_learnings(args.days), which explicitly excludes files older than the cutoff. As a result, the condition checking file_date < cutoff will never be true for the provided input, so the documented archival behavior does not actually occur.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script description, CLI text, and generated HTML content are all fixed in Chinese, including the document language declaration. For a general-purpose reporting skill, forcing a specific language without user opt-in can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.