Back to skill

Security audit

心跳回忆

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended to provide local memory, but it enables persistent recording and recall of sensitive personal context by default with unclear boundaries.

Review this skill carefully before installing. It is not showing exfiltration or destructive intent, but it is designed to persistently remember personal goals, emotions, habits, and conversation history, and those features are enabled broadly by default. Disable auto_record and heartbeat recall unless you explicitly want them, avoid saving secrets or sensitive work content, pin dependencies in a virtual environment, and back up memory data before running any deletion commands from the docs.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T02 · Agent Memory Poisoning

Warning
Location
scripts/rag_system.py:239
Finding

Persistent prompt injection through untrusted memory content

Content
View full analysis

Vulnerability Details

File Location: scripts/local_memory_system_v2.py:85-99; scripts/rag_system.py:239-249
Vulnerability Type: Persistent prompt injection through agent memory
Risk Level: Medium

Vulnerable Code

python
def add_memory(self, content: str, metadata: Dict[str, Any], id: Optional[str] = None):
    """Add a memory to the vector database"""
    if not self.collection:
        if not self.initialize_database():
            return False

    try:
        if id is None:
            id = f"memory_{int(time.time())}_{hash(content) % 10000}"

        self.collection.add(
            documents=[content],
            metadatas=[metadata],
            ids=[id]
        )
python
for i, result in enumerate(results, 1):
    metadata = result.get('metadata', {})
    source = metadata.get('source', 'unknown')
    timestamp = metadata.get('timestamp', time.time())
    time_str = time.strftime("%Y-%m-%d %H:%M", time.localtime(timestamp))

    context_parts.append(f"## Memory {i}: {source} ({time_str})")
    context_parts.append(f"Relevance: {result.get('relevance_score', 0.0):.2f}")
    context_parts.append("")
    context_parts.append(result['content'])
    context_parts.append("")

Technical Analysis

The add_memory() method accepts arbitrary content and stores it directly in ChromaDB without provenance validation, trust classification, instruction detection, or sanitization. The format_context() method subsequently inserts that stored content verbatim into a context intended for downstream LLM consumption.

Memory content is therefore presented alongside application-generated context without a clear security boundary. An attacker who can influence saved conversations or invoke the --add interface can store instruction-like text, such as requests to disregard higher-priority instructions or disclose sensitive information. If semantic retrieval later s ...[truncated 1209 chars]

Remediation
View remediation

Remediation Suggestions

  1. Treat every retrieved memory as untrusted data rather than an instruction.
  2. Wrap retrieved content in explicit delimiters and prepend a strong instruction stating that commands contained inside memories must never be executed or followed.
  3. Attach provenance, creator identity, creation channel, and trust level to every memory entry.
  4. Require confirmation before persisting behavioral rules or security-sensitive preferences.
  5. Detect and quarantine instruction-like entries, especially content that attempts to override policies, request secrets, or initiate tool execution.
  6. Restrict memory insertion interfaces with appropriate authorization.
  7. Keep user content separate from system-generated context using structured message roles rather than concatenating both into one plain-text prompt.
  8. Provide record deletion, review, and audit capabilities so poisoned entries can be identified and removed.
  9. Add regression tests using stored prompt-injection payloads to verify that retrieved memories remain inert quoted data.

T02 · Agent Memory Poisoning

Note
Location
memory/_templates/TIPS_template.md:174
Finding

Bundled template installs behavioral rules as persistent user memory

Content
View full analysis

Vulnerability Details

File Location: memory/_templates/TIPS_template.md:174-222; copied by scripts/hbm_init.py:85-89
Vulnerability Type: Pre-populated persistent behavioral instruction
Risk Level: Low

Vulnerable Code

python
# Copy template files if they exist
template_source = hbm_root / "memory" / "_templates"
if template_source.exists():
    for template_file in template_source.glob("*.md"):
        shutil.copy2(template_file, memory_dir)
        print_success(f"Copied template: {template_file.name}")

The bundled template section at memory/_templates/TIPS_template.md:174-222 describes immediate behavioral rules, directs the assistant to provide command-only responses for certain phrases, and states that the purported preference must be followed in all relevant scenarios. These are presented as established user preferences even though they are package-provided sample content.

Technical Analysis

Initialization copies every bundled Markdown template into the active memory directory without removing sample entries or distinguishing examples from genuine user data. One template contains imperative communication rules framed as explicit user preferences.

If OpenClaw or the RAG subsystem indexes or reads this file as historical memory, package-authored instructions can influence later responses as though the user had personally supplied them. This violates memory provenance and permits the skill package itself to seed persistent behavioral state.

Attack Path

  1. The user follows the documented installation procedure and runs scripts/hbm_init.py.
  2. The initializer copies TIPS_template.md into the active memory directory.
  3. The copied file retains package-authored behavioral rules and purported user preferences.
  4. OpenClaw or a memory-indexing process reads or indexes the copied file.
  5. A later request matches the template's communication-preference content.
  6. The agen ...[truncated 568 chars]
Remediation
View remediation

Remediation Suggestions

  1. Distribute empty structural templates rather than populated example memories.
  2. Remove imperative behavioral instructions and purported user preferences from default templates.
  3. If examples are necessary, store them outside the active memory directory and mark them clearly as inert documentation.
  4. Do not automatically index template files.
  5. Require explicit user confirmation before saving any behavioral preference.
  6. Add metadata that differentiates package samples, system records, and authenticated user statements.
  7. During initialization, create clean destination files from a schema rather than copying template content wholesale.
  8. Remove existing package-authored preferences during upgrades unless the user explicitly elected to retain them.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned third-party dependencies create mutable supply-chain exposure

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-3; scripts/hbm_init.py:43-59; docs/installation.md:83-87
Vulnerability Type: Unbounded and unhashed dependency installation
Risk Level: Low

Vulnerable Code

text
chromadb>=0.4.22
sentence-transformers>=2.2.2
faiss-cpu>=1.7.4
python
required_packages = [
    "chromadb>=0.4.22",
    "sentence-transformers>=2.2.2",
    "faiss-cpu>=1.7.4",
]

try:
    import chromadb
    import sentence_transformers
    import faiss
    print_success("All dependencies are installed")
    return True
except ImportError as e:
    print_warning(f"Missing dependency: {e}")
    print("Please install required packages:")
    print(f"  pip install {' '.join(required_packages)}")
    return False
bash
pip install chromadb sentence-transformers faiss-cpu

Technical Analysis

All dependencies use open-ended minimum-version constraints. No upper bounds, lock file, package hashes, reviewed transitive-dependency set, or isolated environment is provided. Consequently, the same installation instructions can resolve to different code over time.

Python packages and their transitive dependencies execute code when imported and may also run build-system logic during installation. If a dependency account, release artifact, transitive package, or package-index resolution is compromised, users can receive code that was never included in or reviewed with this skill.

The semantic-search stack may also obtain model assets through dependency-managed behavior. This weakens the documentation's claim that operation is completely offline unless all required assets are explicitly provisioned and verified in advance.

Attack Path

  1. A user follows the installation guidance and runs the unpinned pip install command.
  2. The package index resolves the newest versions satisfying the minimum constraints, including ...[truncated 688 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an exact reviewed version.
  2. Generate a lock file that includes all transitive dependencies.
  3. Require package hashes, for example through a hash-locked requirements file and pip install --require-hashes.
  4. Install dependencies in a dedicated virtual environment with ordinary user privileges.
  5. Use a trusted package index and consider an internally mirrored, allowlisted repository.
  6. Add automated dependency vulnerability and integrity scanning.
  7. Explicitly configure the embedding implementation and model location rather than relying on dependency defaults.
  8. Pre-download and verify model artifacts when offline operation is promised, and document any network access required during setup.
  9. Test dependency upgrades before changing pinned versions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The documented behavior substantially overstates or misrepresents what the skill actually implements, including claimed multi-bank memory and heartbeat recall features. Security review depends on accurate descriptions; when the manifest promises one behavior but the code performs something else, users and operators may authorize a tool under false assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatic memory recording is enabled by default, and the template contains no user-notice, consent, or acknowledgment setting to ensure people know their conversations may be stored. Because this skill is specifically a long-term memory system handling goals, experiences, emotions, and session data, silent recording materially increases privacy risk and can capture sensitive personal information without informed consent.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The troubleshooting guidance tells users to recursively delete 'memory/vector_db' and recreate it, which permanently destroys the vector database contents. In this skill, that database likely contains long-term memory embeddings or indexed recall data, so users may lose recall functionality or stored knowledge without fully understanding the consequence.

Content

Scanner excerpt · docs/installation.md (reported line 98)May include surrounding context.

Issue: Vector database initialization fails

bash
# Delete and recreate vector database
rm -rf memory/vector_db
python3 scripts/hbm_init.py

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

The uninstall command uses 'rm -rf' against the skill directory, which is inherently dangerous because it performs irreversible recursive deletion with no confirmation. Although the path is narrow and appears legitimate, documentation that normalizes force deletion increases the chance of accidental misuse, especially if users modify the path or run commands from automation.

Content

Scanner excerpt · docs/installation.md (reported line 114)May include surrounding context.

bash
# 1. Remove the skill directory
rm -rf ~/.openclaw/skills/heartbeat-memories

# 2. Remove any memory data (optional, backup first)
rm -rf ~/.openclaw/workspace/memory  # If you used default location

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

The uninstall command uses 'rm -rf' against the skill directory, which is inherently dangerous because it performs irreversible recursive deletion with no confirmation. Although the path is narrow and appears legitimate, documentation that normalizes force deletion increases the chance of accidental misuse, especially if users modify the path or run commands from automation.

Content

Scanner excerpt · docs/installation.md (reported line 114)May include surrounding context.

bash
# 1. Remove the skill directory
rm -rf ~/.openclaw/skills/heartbeat-memories

# 2. Remove any memory data (optional, backup first)
rm -rf ~/.openclaw/workspace/memory  # If you used default location

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

The command 'rm -rf ~/.openclaw/workspace/memory' irreversibly deletes memory data, which is particularly sensitive in a long-term memory skill because it may contain user-authored notes, goals, history, or derived recall artifacts. Even though marked optional, the documentation does not adequately highlight privacy and data-loss implications.

Content

Scanner excerpt · docs/installation.md (reported line 117)May include surrounding context.

md
rm -rf ~/.openclaw/skills/heartbeat-memories

# 2. Remove any memory data (optional, backup first)
rm -rf ~/.openclaw/workspace/memory  # If you used default location

# 3. Remove Python packages (optional)
pip uninstall chromadb sentence-transformers faiss-cpu

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

The command 'rm -rf ~/.openclaw/workspace/memory' irreversibly deletes memory data, which is particularly sensitive in a long-term memory skill because it may contain user-authored notes, goals, history, or derived recall artifacts. Even though marked optional, the documentation does not adequately highlight privacy and data-loss implications.

Content

Scanner excerpt · docs/installation.md (reported line 117)May include surrounding context.

md
rm -rf ~/.openclaw/skills/heartbeat-memories

# 2. Remove any memory data (optional, backup first)
rm -rf ~/.openclaw/workspace/memory  # If you used default location

# 3. Remove Python packages (optional)
pip uninstall chromadb sentence-transformers faiss-cpu

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented trigger phrases are broad, generic, and overlap with ordinary conversation such as 'save this' or 'help me recall'. In a memory skill, that can cause unintended activation, silent storage or retrieval of sensitive user content, and surprise behavior without clear opt-in boundaries.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documents shell execution, file reads, and file writes but does not declare any explicit tool scope or permissions. This weakens reviewability and least-privilege controls, making it easier for a memory-oriented skill to gain broader host access than users may reasonably expect.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Claiming '100% local operation' is inaccurate if the skill downloads an embedding model from ModelScope. Misrepresenting network behavior undermines informed consent and can cause users in sensitive or air-gapped environments to deploy software that violates their security expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad, common conversational language that may cause the skill to activate during ordinary chat. In a memory skill that records conversations and emotions, unintended activation increases the risk of collecting or resurfacing sensitive user data without clear intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill promotes automatic recording and emotion analysis without a clear up-front warning about the sensitivity of the data being collected. Users may disclose personal information without understanding that it may be persistently stored, categorized, and later recalled.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill normalizes long-term retention of conversations, emotions, habits, goals, and keywords, then resurfacing them later through proactive recall. Even if stored locally, this creates a concentrated repository of highly sensitive behavioral and emotional data that can be exposed through host compromise, over-collection, or unintended retrieval in the wrong context.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The usage section says important conversations are automatically recorded without any consent model, sensitivity boundaries, or user review step. This makes inadvertent storage of secrets, health details, relationship information, or work content more likely, especially given the broad trigger phrases elsewhere in the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The statement that the skill 'automatically' records important conversations does not define what qualifies as important or when recording occurs. Ambiguous automatic activation is risky in a memory-retention tool because users cannot reliably predict or control what personal data will be stored.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

md
cd ~/.openclaw/skills/heartbeat-memories && python3 scripts/hbm_init.py --check

# View memory banks
ls -la ~/.openclaw/skills/heartbeat-memories/memory/

# Test semantic search
python3 scripts/local_memory_system_v2.py --test

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The security statement says there are no external API calls, yet other sections describe automatic or manual model downloads from ModelScope. This is dangerous because users may trust the skill to remain offline while it still initiates network access and fetches third-party artifacts, expanding supply-chain and privacy risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation claims the skill does not access other user directories, but it also supports arbitrary custom memory paths outside the skill directory. That contradiction can mislead users about where sensitive conversation history, emotions, and habits may be stored, increasing the chance of accidental exposure or unsafe placement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The configuration enables broad automatic recording and multiple probabilistic heartbeat recall scenarios, but it does not encode explicit consent, scope restrictions, or precise trigger guardrails. In a long-term memory skill that stores personal conversations and emotional data, ambiguous activation conditions increase the risk of collecting or resurfacing sensitive information unexpectedly.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · docs/installation.md (reported line 44)May include surrounding context.

md
The initialization script will:
1. Check Python dependencies
2. Create memory directory structure
3. Generate configuration files
4. Run diagnostic checks

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation instructs users to run recursive deletion commands during uninstallation, but the warning is minimal and does not clearly emphasize that these actions permanently remove the skill and potentially all stored memory data. In a memory-management skill, the deleted data may include long-term conversation history or user notes, making accidental data loss more significant than in a stateless plugin.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire template, including headings, field labels, and usage note, is written in Chinese with no indication that users may choose another language. This can violate language/locale policy when a skill imposes a specific language by default without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown template is written as a normative skill artifact in Chinese and frames the document structure and focus entirely in that language without indicating any user-selectable locale or opt-in. Under the policy rule, forcing a specific language without choice is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI prints retrieved memory content directly to stdout, which can expose sensitive long-term memory data to terminal logs, shell history capture, shared consoles, or other local observers. In a memory system skill, stored content is especially likely to include personal, behavioral, or contextual data, so unactioned disclosure via console output is a genuine confidentiality risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The README mixes English and Chinese trigger phrases without clearly stating whether multilingual triggers are enabled by default or require user selection. This ambiguity increases accidental activation risk for bilingual users or shared environments, especially because the skill stores long-term memory and emotional context.

Content

No source excerpt is available for this finding.