Back to skill

Security audit

Elite Longterm Memory

Security checks for vulnerabilities and agentic risk

Overview

This skill is a long-term memory helper, but it automatically stores conversation details across files, vector memory, and optional cloud sync without enough user control or privacy safeguards.

Install only if you are comfortable with the agent persistently recording project and user context. Before use, disable automatic capture unless explicitly needed, avoid storing secrets or regulated data, keep cloud backup off until you understand the provider and deletion process, and replace API-key troubleshooting with a presence-only check that never prints the key.

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
SKILL.md:74
Finding

Automatic Persistence of Untrusted Conversation Content Enables Cross-Session Memory Poisoning

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 74, 81, 109-123, and 140
Vulnerability Type: T02: Agent Memory Poisoning
Risk Level: High

Vulnerable Code Snippets

SKILL.md:74 requires the Agent to write state before responding and states that the write is triggered by user input:

text
Rule: Write before responding to the user; the write is triggered by user input rather than Agent memory.

SKILL.md:81 demonstrates directly persisting conversation-derived content:

text
memory_store text="User prefers dark mode" category="preference" importance=0.9

SKILL.md:109-112 directs the Agent to extract and retain conversation facts automatically:

text
Automatically extract preferences, decisions, and facts from conversations.
Deduplicate and update existing memories.
Reduce token consumption by 80% compared with raw history.
Operate automatically across sessions.

SKILL.md:118-123 makes persistent writes occur before the Agent responds:

text
Write-ahead logging: write state before responding, rather than afterward.
User states a preference -> write to SESSION-STATE.md -> respond.
User makes a decision -> write -> respond.
User provides a deadline -> write -> respond.
User corrects the Agent -> write -> respond.

SKILL.md:140 additionally recommends creating persistent Agent instructions:

text
If memory files are not loaded because the Agent skips reading memory, add a rule to AGENTS.md.

Technical Analysis

The Skill treats user-controlled conversation content as eligible for automatic, durable storage in SESSION-STATE.md, a vector database, knowledge records, and other cross-session memory. It instructs the Agent to perform these writes before responding and does not require user confirmation, trust classification, provenance validation, or separation of instructions from inert factual data.

An ...[truncated 2629 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not automatically persist instructions or operational directives extracted from user messages.
  2. Require explicit confirmation before writing any conversation-derived content to cross-session storage.
  3. Apply a strict schema that permits only inert data categories, such as verified preferences or factual project metadata.
  4. Store provenance with every entry, including the originating user, session, timestamp, source message, trust level, and confirmation status.
  5. Treat recalled memory as untrusted data and clearly delimit it from system, developer, and project instructions.
  6. Detect and reject entries containing tool requests, command sequences, authorization changes, secrecy instructions, or attempts to override higher-priority guidance.
  7. Prevent automatic writes to AGENTS.md or other instruction-bearing files. Require an explicit, reviewed change for such files.
  8. Scope memory by user, tenant, repository, and task to prevent cross-user or cross-project contamination.
  9. Provide review, expiration, rollback, and deletion controls for stored entries.
  10. Disable automatic cloud or vector synchronization unless the user has explicitly approved the destination and data categories.
  11. On recall, summarize validated facts into a typed structure rather than injecting raw historical text into the instruction context.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:245
Finding

API Key Disclosure Through Unsafe Environment-Variable Troubleshooting Command

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 245
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: Medium

Vulnerable Code Snippet

bash
echo $OPENAI_API_KEY

Technical Analysis

The troubleshooting guidance prints the complete value of OPENAI_API_KEY to standard output. Terminal output may be retained in Agent transcripts, command histories maintained by the platform, continuous-integration logs, shell recordings, observability systems, screenshots, or support bundles.

Verifying whether a credential is configured does not require revealing its value. Printing the secret violates secret-handling best practices and unnecessarily expands the set of systems and users that may gain access to it.

Attack Path

  1. A user or Agent encounters a memory-search configuration problem.
  2. The troubleshooting instructions recommend running echo $OPENAI_API_KEY.
  3. The shell expands the environment variable and prints the complete credential.
  4. The Agent platform, terminal logger, CI system, or session transcript records the output.
  5. A party with access to the retained output obtains the API key.
  6. The exposed key may be reused against the associated API until it is revoked or expires.

Impact Assessment

An exposed API key may allow unauthorized API requests under the victim's account and quota. Depending on provider-side permissions, consequences can include financial charges, quota exhaustion, access to API resources available to the key, and disruption caused by credential revocation.

This issue does not independently provide operating-system privilege escalation. Its scope is bounded by the permissions, organization access, usage limits, and service capabilities assigned to the disclosed key.

Remediation
View remediation

Remediation Suggestions

Replace the disclosure command with a presence-only check that never prints the credential:

bash
if test -n "${OPENAI_API_KEY:-}"; then
  echo "OPENAI_API_KEY is set"
else
  echo "OPENAI_API_KEY is not set"
fi

Additional hardening measures:

  1. Ensure diagnostic output never contains complete or partially reusable credentials.
  2. Configure the Agent platform and CI system to redact known secret-variable values.
  3. Avoid passing credentials as command-line arguments because process listings and logs may expose them.
  4. Store credentials in the platform's secret manager rather than project files or shell scripts.
  5. If the unsafe command has already been used in a recorded environment, remove accessible logs where feasible and rotate the potentially exposed key.
  6. Use narrowly scoped credentials with spending limits, expiration, and provider-side usage monitoring.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill name, summary, and the entire user-facing documentation are presented in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-language audience. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs shell-based handling of API keys via environment variables and explicitly enables the exec tool for a memory feature. While environment variables are common, combining secret handling guidance with executable command capability expands the attack surface beyond passive memory management and can lead to accidental secret exposure in shell history, logs, or downstream commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs the agent to write user-derived content into SESSION-STATE.md and other memory stores before responding, but it does not present a clear user-facing warning or consent model for automatic persistence. This creates a privacy and retention risk because users may disclose sensitive preferences, corrections, deadlines, or project details without realizing they will be stored across sessions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation directs execution of local Python scripts and external tools to store and retrieve memory. In a skill exposed through an agent with exec access, such command patterns normalize arbitrary command execution and create opportunities for path manipulation, untrusted argument injection, or unsafe execution of local tooling not verified by the platform.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cloud backup section describes adding and searching memory in an external service but does not clearly warn that conversation-derived memory may be transmitted off-device or to third-party infrastructure. Because long-term memory may include sensitive user and project data, undisclosed external synchronization materially increases confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Automatic fact extraction from conversations broadens collection beyond intentional user submissions and increases the chance that sensitive information is inferred, stored, and reused without awareness. Cross-session automation makes the risk more severe because mistakes or over-collection persist and propagate into future interactions.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs persistence of user preferences, decisions, deadlines, and corrections across sessions. That behavior creates durable natural-language records that may contain sensitive personal or business information and can later be retrieved, surfaced to the wrong task context, or disclosed through other memory layers and sync systems.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented workflow chains captured user statements through session files, knowledge storage, vector memory, and potentially cloud backup. This multiplies disclosure paths and makes accidental exposure, over-retention, and inconsistent deletion much more likely, especially in a memory-oriented skill whose purpose is to preserve user context indefinitely.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The text says the architecture '永不丢失上下文、决策与教训' (never loses context, decisions, and lessons), but later sections admit multiple failure modes, dependency on API keys and external services, and that strict operational discipline is required. This is not merely incomplete marketing language; it conflicts with the file's own documented limitations and failure scenarios.

Content

No source excerpt is available for this finding.