Back to skill

Security audit

Mempalace Memory

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is purpose-built for local recall, but it can broadly index and duplicate private workspace memories with weak credential handling and limited user warnings.

Review this before installing if your workspace may contain secrets, private files, or regulated data. Use only narrow mining paths, avoid bridge synchronization on sensitive memories unless credential scanning is improved, and verify how to back up or recover data before using forget. The artifact does not show external exfiltration or a hidden backdoor, but its local persistent memory footprint is broad.

Vulnerability Patterns
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/super_mem_cli.py:185
Finding

Incomplete Credential Filtering Permits Plaintext Secret Duplication

Content
View full analysis

Vulnerability Details

File Location: scripts/super_mem_cli.py:137-151 and scripts/super_mem_cli.py:185-207
Vulnerability Type: Incomplete secret detection and unsafe persistent storage
Risk Level: Medium

Vulnerable Code

python
_CRED_PATTERNS = [(r'ghp_[a-zA-Z0-9]{36}', '[GITHUB_TOKEN]')]

def filter_credentials(content: str) -> str:
    for pat, repl in _CRED_PATTERNS:
        content = re.sub(pat, repl, content)
    return content
python
def bridge() -> Dict:
    try:
        import chromadb
        mp = chromadb.PersistentClient(path=os.path.expanduser("~/.mempalace/palace"))
        mp_col = mp.get_collection("mempalace_drawers")
        items = mp_col.get(limit=10000, include=["documents", "metadatas"])
        if not items["ids"]:
            return {"synced": 0, "note": "MemPalace empty"}
        shared = _get_coll("super_mem_shared")
        all_ids = shared.get(limit=10000, include=[])["ids"]
        old_ids = [mid for mid in all_ids if mid.startswith("mp_") and not mid.startswith("mp_bridge_")]
        if old_ids:
            shared.delete(ids=old_ids)
        docs, metas, ids, embs = [], [], [], []
        for i, did in enumerate(items["ids"]):
            doc = items["documents"][i] if items["documents"] else ""
            meta = items["metadatas"][i] if items["metadatas"] else {}
            docs.append(filter_credentials(doc))
            metas.append({**meta, "source": "mempalace_bridge", "original_id": did})
            ids.append(f"mp_bridge_{did}")
        embs = ollama_embed(docs)
        shared.add(documents=docs, metadatas=metas, ids=ids, embeddings=embs)
        return {"synced": len(docs), "deleted_old": len(old_ids)}

Technical Analysis

The bridge copies as many as 10,000 MemPalace documents into a second persistent ChromaDB collection. Before persistence, filter_credentials() only redacts GitHub classic personal acce ...[truncated 2458 chars]

Remediation
View remediation

Remediation Suggestions

  1. Apply a single, centralized secret-validation routine to all storage paths, including bridge(), store(), and mining workflows.
  2. Make bridge synchronization fail closed: reject or quarantine any document that may contain a credential instead of persisting partially redacted content.
  3. Detect a broader set of secret formats, including:
    • PEM and OpenSSH private-key blocks
    • AWS and other cloud-provider credentials
    • Bearer and authorization headers
    • Database and service connection strings
    • GitHub, GitLab, Slack, OAuth, and generic API tokens
    • Password and secret assignments in common configuration formats
  4. Use entropy-based detection or a maintained secret-scanning library in addition to regular expressions.
  5. Exclude sensitive files and directories before mining, including credential stores, environment files, SSH directories, cloud configuration directories, key files, and version-control secret files.
  6. Do not submit rejected or unredacted content to the embedding service.
  7. Minimize duplicated data and define retention and deletion controls for both MemPalace and SuperMem databases.
  8. Restrict database file permissions to the owning account and review whether backups include these stores.
  9. Add automated tests covering representative private keys, cloud keys, authorization headers, connection strings, and provider-specific tokens.
  10. Provide a dry-run bridge mode that reports rejected records without copying their contents.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/mempalace_cli.py (reported line 48)May include surrounding context.

python
def call_mempalace(args, timeout=30):
    """Call mempalace CLI directly."""
    import subprocess
    env = os.environ.copy()
    env['PATH'] = f'/Users/mars/Library/Python/3.9/bin:{env.get("PATH", "")}'
    result = subprocess.run(
        [MEMPALACE_CLI] + args,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/mempalace_cli.py (reported line 448)May include surrounding context.

python
def call_mempalace(args, timeout=30):
    """Call mempalace CLI directly."""
    import subprocess
    env = os.environ.copy()
    env['PATH'] = f'/Users/mars/Library/Python/3.9/bin:{env.get("PATH", "")}'
    result = subprocess.run(
        [MEMPALACE_CLI] + args,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly documents a forget <memory_id> deletion capability and only mentions 'trash > rm' in passing, without clearly warning users about permanence, scope, recovery limits, or requiring confirmation. In a memory-management skill, deletion directly affects retained user data, so unclear documentation can lead to accidental data loss or unintended destruction of stored memories.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring and surrounding natural-language guidance are entirely framed around Chinese-first behavior, including statements like '中文关键词boost' and '中文硬匹配优先', which indicate a built-in language preference. There is no user opt-in, alternative locale handling, or documentation that this skill is intentionally limited to a Chinese-only compliance or regional context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/mempalace_cli.py (reported line 50)May include surrounding context.

python
import subprocess
    env = os.environ.copy()
    env['PATH'] = f'/Users/mars/Library/Python/3.9/bin:{env.get("PATH", "")}'
    result = subprocess.run(
        [MEMPALACE_CLI] + args,
        capture_output=True, text=True, timeout=timeout,
        env=env

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The surrounding comments say the search logic should 'not disturb native ranking' and only do minor adjustment, but the implementation computes a new final_score and fully sorts by it. Because identity boosts can be very large (for example 100.0 for USER.md), this can substantially override the original mempalace ordering rather than preserve it.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/mempalace_cli.py (reported line 450)May include surrounding context.

python
import subprocess
        env = os.environ.copy()
        env['PATH'] = f'/Users/mars/Library/Python/3.9/bin:{env.get("PATH", "")}'
        r = subprocess.run(
            ['/usr/bin/python3',
             '/Users/mars/.openclaw/workspace/skills/mempalace-memory/scripts/super_mem_cli.py',
             'remember', clean_content,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Every query or stored content is sent to a local embedding service over HTTP without any explicit consent, disclosure, or data classification guardrails. In a memory/search tool, inputs may contain sensitive internal notes, messages, or proprietary data, so automatic transmission to another service broadens exposure and may violate user expectations or policy.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/super_mem_cli.py (reported line 16)May include surrounding context.

python
for text in texts:
        payload = {"model": _EMBED_MODEL, "prompt": text}
        try:
            r = subprocess.run(
                ["curl", "-s", "-X", "POST", _OLLAMA,
                 "-H", "Content-Type: application/json", "-d", json.dumps(payload)],
                capture_output=True, text=True, timeout=30

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code tells users that credentials have been encrypted and stored in ~/.openclaw/.credentials, but it only rejects the content and performs no encryption or migration. This can cause users to believe sensitive material was safely preserved when it was actually discarded, creating a dangerous false sense of security and possible credential handling mistakes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The mine function launches python -m mempalace mine against the target path, which performs subprocess execution and scans project files. The function contains no visible confirmation, logging, or explanatory warning to inform users that invoking this command will run another tool over their filesystem contents.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/super_mem_cli.py (reported line 421)May include surrounding context.

python
def mine(path: str = None) -> Dict:
    target = path or os.path.expanduser("~/.openclaw/workspace")
    try:
        subprocess.run(
            [sys.executable, "-m", "mempalace", "mine", target, "--mode", "projects"],
            capture_output=True, timeout=120
        )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file presents core operational documentation in Chinese, including architecture and usage details, without indicating that the user can choose another language or that the locale limitation is intentional. This can violate language or locale policy when a skill effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The module title and multiple inline/docstring descriptions are written only in Chinese, which imposes a specific language presentation without any user opt-in or alternative locale. Under the stated policy, language constraints should be optional or clearly justified.

Content

No source excerpt is available for this finding.