Back to skill

Security audit

Semantic Memory

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned as a semantic memory/search tool, but its default network exposure and unsafe local cache handling create review-worthy security risk.

Review before installing. Use 127.0.0.1 instead of 0.0.0.0 unless you deliberately need remote access, and add authentication, firewalling, and TLS for any non-local ChromaDB server. Do not point TFIDF_CACHE at a shared or untrusted directory, and treat existing .pkl cache files as executable-risk data. Import only Markdown files you are comfortable storing in a memory database, because full contents and absolute paths are saved.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/vector_search.py:110
Finding

Arbitrary Code Execution Through Unsafe Pickle Cache Deserialization

Content
View full analysis
100: try: with open(cache_path, 'rb') as f: cached = pickle.load(f) if cached.get('count') == count: print(f" 📦 TF-IDF缓存命中: {name} ({count}条)") return cached['docs'], cached['metas'], cached['index'] except: pass ``` ### Technical Analysis The application loads TF-IDF cache files with `pickle.load()`. Python pickle is an executable serialization format: specially constructed pickle opcodes can invoke arbitrary functions during deserialization. The cache directory comes from the `TFIDF_CACHE` environment variable and otherwise defaults to the relative path `./tfidf_cache`. The application does not validate the cache file's ownership, permissions, provenance, or integrity before deserializing it. The check against the cached collection count occurs only after `pickle.load()` has completed. It therefore cannot prevent execution of a malicious pickle payload. The broad exception handler also suppresses evidence of failed or malicious deserialization attempts. ### Attack Path 1. An attacker obtains write access to the process working directory, the configured `TFIDF_CACHE` directory, or a shared directory selected through the environment. 2. The attacker creates or replaces one of the expected cache files, such as `memories.pkl`, `knowledge.pkl`, or `projects.pkl`. 3. The malicious file is made larger than 100 bytes so it passes the size condition. 4. A user or agent invokes the search functionality. 5. `load_collection()` opens the attacker-controlled file and passes it ...[truncated 1013 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/start_chroma.sh:7
Finding

Unauthenticated ChromaDB Service Exposed on All Network Interfaces

Content
View full analysis
chroma_server.log 2>&1 & ``` The same insecure binding is recommended by the documentation: ```bash chroma run --path ./vector_db --host 0.0.0.0 --port 8000 & ``` Imported records also include full document contents and absolute source paths: ```python meta = { 'source': title, 'agent': agent_name, 'type': 'memory', 'date': datetime.now().strftime('%Y-%m-%d'), 'path': os.path.abspath(file_path), } col = ensure_collection(collection_name) col.add( documents=[content], metadatas=[meta], ids=[f"{slug(title)}_{int(time.time()*1000)}"] ) ``` ### Technical Analysis The startup script defaults ChromaDB to `0.0.0.0`, causing it to listen on every available network interface. The documented startup instructions use the same binding. No authentication, authorization, or TLS configuration is established by the project. The database stores complete Markdown memory documents, agent metadata, and absolute filesystem paths. Consequently, exposing the ChromaDB API can disclose both sensitive memory contents and information about the host filesystem. The practical reachability of the service depends on host firewall rules, container networking, cloud security groups, and the surrounding network. However, the project defaults create the unsafe listening state rather than requiring an explicit decision to enable remote access. ### Attack Path 1. A user follows the startup instructions or runs `scripts/start_ch ...[truncated 1386 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:42
Finding

Unpinned Third-Party Dependencies Create Supply-Chain and Reproducibility Risk

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a full long-term memory/retrieval system with three-track hybrid retrieval and multi-agent collaboration. The supplied code chunk is only an ingestion script for importing Markdown files into ChromaDB. While this is related to a vector-memory pipeline, it does not implement the core claimed behaviors: there is no search, retrieval, ranking, TF-IDF, jieba tokenization, semantic prioritization, or collaborative agent logic. The only partial alignment is that it writes data into a vector database and tags records with an agent name, but that is insufficient to match the broader declared purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README repeatedly frames the skill as '中文优先' and '唯一一个为中文场景深度优化', which indicates a language preference baked into the skill experience. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy concern unless the constraint is clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README instructs users to start ChromaDB bound to 0.0.0.0, which exposes the database service on all network interfaces. Without an immediate warning and secure-by-default guidance, users may unintentionally make long-term memory data remotely reachable, enabling unauthorized access, data extraction, or tampering—especially since the same document later notes cross-machine access requires authentication.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and CLI-facing usage text are written in Chinese, and the script also defaults the agent name to a Chinese value later in the file. This imposes a specific language/locale on users without opt-in, which matches the language-policy violation criteria for natural-language content in code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints warnings and operational messages in Chinese throughout execution, which forces a specific language for runtime interaction. Because there is no language choice or documented justification for the locale restriction, this is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's comments and user-visible echo messages are written entirely in Chinese, which imposes a specific language on users. Under the policy, language constraints should be optional or clearly justified as region-specific; no such opt-in or justification appears here.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · scripts/start_chroma.sh (reported line 27)May include surrounding context.

sh
CMD="python3 -m chromadb"
    fi

    nohup $CMD run \
        --path "$CHROMA_PATH" \
        --host "$CHROMA_HOST" \
        --port "$CHROMA_PORT" \

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and runtime output are written in Chinese, which imposes a specific language on users without any opt-in or explanation that the skill is intended only for Chinese-speaking contexts. This is a natural-language policy concern because it can exclude users or conflict with organizational language expectations.

Content

No source excerpt is available for this finding.

Insecure deserialization: pickle.load()

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The script deserializes a cache file with pickle.load() from a path rooted in TFIDF_CACHE, which is environment-controlled and stored on disk without any integrity protection. If an attacker can modify the cache directory or place a crafted .pkl file there, unpickling can trigger arbitrary code execution when the search runs.

Content

Scanner excerpt · scripts/vector_search.py (reported line 106)May include surrounding context.

python
if os.path.exists(cache_path) and os.path.getsize(cache_path) > 100:
        try:
            with open(cache_path, 'rb') as f:
                cached = pickle.load(f)
            if cached.get('count') == count:
                print(f"  📦 TF-IDF缓存命中: {name} ({count}条)")
                return cached['docs'], cached['metas'], cached['index']

Tainted flow: 'cache_path' from os.environ.get (line 99, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
78% confidence
Finding

cache_path is derived from TFIDF_CACHE and collection name, then opened for writing without validation or containment checks. In environments where attackers can influence environment variables or startup configuration, this can cause arbitrary file overwrite within the process's permissions, and it also increases the reachability of the unsafe pickle cache by letting an attacker redirect cache files to attacker-chosen locations.

Content

Scanner excerpt · scripts/vector_search.py (reported line 118)May include surrounding context.

python
metas = results.get('metadatas') or [{}] * len(docs)
    idx = TFIDFIndex()
    idx.build(docs)
    with open(cache_path, 'wb') as f:
        pickle.dump({'docs': docs, 'metas': metas, 'index': idx, 'count': count}, f)
    print(f"  💾 TF-IDF缓存已保存")
    return docs, metas, idx

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description and overview repeatedly state that the skill is '中文长期记忆系统' and '中文语义优先', presenting a fixed language/locale behavior rather than offering a user-selectable language option. Under the policy rule, forcing a specific language without explicit opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The default agent value is set to 百晓生, which embeds a locale-specific default into the skill behavior. Without an explicit language/locale choice or documentation justifying the constraint, this contributes to forced-language behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script connects to a remote Chroma service via chromadb.HttpClient, and later sends user queries and retrieves documents from that service. Although these operations are part of search functionality, the file contains no user-facing disclosure that query text and retrieved data will be transmitted over HTTP to an external/local service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.