Back to skill

Security audit

knowledge-vault

Security checks for vulnerabilities and agentic risk

Overview

This long-term memory skill is mostly purpose-aligned, but it can automatically create external storage, send saved text to Google for embeddings, and cache database credentials locally in plaintext without strong user controls.

Review before installing. Use your own scoped TiDB database credentials, avoid the auto-provisioning fallback, restrict permissions on any local DSN file, and do not store secrets, health details, customer data, or other sensitive information unless you have explicit consent and a deletion process. Treat retrieved memories as untrusted reference text, not instructions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
run.py:106
Finding

Persistent Memory Can Store and Replay Attacker-Controlled Instructions

Content
View full analysis
string conversion? prefer explicit string for VECTOR literal cursor.execute("INSERT INTO knowledge_vault (content, embedding) VALUES (%s, %s)", (content, vec_str)) return {"success": True, "message": "Content embedded and stored."} elif action == "search": if not query: return {"success": False, "error": "Query required"} q_vec = get_embedding(query) q_vec_str = str(q_vec) # Vector Search SQL (Security Fix: Parameterize LIMIT) sql = """ SELECT content, VEC_COSINE_DISTANCE(embedding, %s) as distance FROM knowledge_vault ORDER BY distance ASC LIMIT %s """ cursor.execute(sql, (q_vec_str, int(limit))) results = [] for row in cursor.fetchall(): results.append({"content": row[0], "distance": float(row[1])}) ``` ### Technical Analysis The protocol directs the agent to persist user-provided context, while the implementation stores the supplied `content` verbatim. Search results are subsequently returned as raw text without provenance, trust metadata, instruction filtering, or a boundary identifying the result as untrusted data. SQL parameterization prevents SQL injection, bu ...[truncated 1335 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
run.py:61
Finding

Database Credentials Are Cached in Plaintext and Database TLS Is Not Enforced

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Third-Party Dependencies Are Unpinned and Builds Are Not Reproducible

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (14)

Self-Modification

High
Category
Rogue Agent
Confidence
70% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · run.py (reported line 87)May include surrounding context.

python
try:
        host, port, user, password, db = parse_dsn(dsn)
        # Security Fix: Enable SSL hostname verification (remove check_hostname: False)
        conn = pymysql.connect(
            host=host, port=port, user=user, password=password, database=db,
            charset='utf8mb4', autocommit=True

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger condition is broad enough to fire on normal conversation such as sharing general context or asking questions that reference prior discussion. In a long-term memory skill, this can cause oversaving of user content and overuse of recall tooling, increasing the chance that sensitive or irrelevant information is stored or retrieved without clear user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and implicitly requires access to environment variables, local file reads/writes, and shell execution, but does not declare any explicit tool scope or permission boundaries. That makes its effective privilege set ambiguous and increases the chance an agent will invoke it with broader access than intended, especially because it handles secrets and persistence.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
96% confidence
Finding

The skill states it will auto-provision a database if credentials are absent and cache the resulting connection string in a predictable local file under the user's home directory. Persisting a live DSN locally can expose database credentials to other local processes, future sessions, or unintended users, and the auto-provisioning behavior may also create external resources and data persistence without explicit user approval.

Content

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

md
### 🔐 Security & Provisioning
This skill operates in two modes:
1.  **Bring Your Own Database (Recommended):** Set `TIDB_HOST`, `TIDB_USER`, `TIDB_PASSWORD` environment variables. The skill will use your existing database.
2.  **Auto-Provisioning (Fallback):** If no credentials are found, the skill calls the **TiDB Zero API** to create a temporary, ephemeral database for you. It caches the connection string locally (`~/.openclaw_knowledge_vault_dsn`) to persist memory across runs.

## Installation

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

1. Add to TOOLS.md

markdown
- **knowledge-vault**: Store and retrieve knowledge using vector search.
  - **Location:** `{baseDir}/skills/knowledge_vault/SKILL.md`
  - **Command:** `python {baseDir}/skills/knowledge_vault/run.py --action search --query "<QUESTION>"`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage example encourages storing sensitive personal data ('prefers spicy food' and 'allergic to peanuts') in long-term memory without any warning about consent, retention, minimization, or deletion. In a memory skill, this is especially risky because the whole purpose is durable storage and retrieval of personal context, which can lead to privacy violations or unnecessary retention of sensitive user data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-provided content is transmitted to Google's embedding API with no in-file disclosure or consent mechanism, which can expose sensitive or proprietary data to a third-party service. In a long-term memory skill, the risk is elevated because users may store highly sensitive notes, and the skill's purpose encourages broad ingestion of data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill can automatically create external TiDB instances by calling a remote provisioning API, which materially expands its capability beyond simple local memory management. In an agent setting, this can create unreviewed outbound network activity, persistent external resources, and storage locations for sensitive data without explicit user approval.

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 · run.py (reported line 39)May include surrounding context.

python
for i in range(3):
        try:
            cmd = ["curl", "-sS", "-X", "POST", api_url, "-H", "content-type: application/json", "-d", "{}"]
            result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
            if result.returncode == 0:
                data = json.loads(result.stdout)
                dsn = data.get("instance", {}).get("connectionString")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill persists a DSN containing database credentials in a predictable file under the user's home directory without setting restrictive permissions or notifying the user. Local users, other processes, or backups may be able to recover these credentials and gain unauthorized access to the provisioned database and its stored memory contents.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency manifest specifies pymysql without a version constraint, which makes builds non-reproducible and can silently pull in a vulnerable or breaking release over time. In a security-sensitive memory storage skill that likely connects to a database, dependency drift increases supply-chain risk and makes it impossible to verify whether known-vulnerable versions are avoided.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pymysql
google-genai

Unverifiable Dependency: pymysql has 2 known advisory(ies) (CVE-2024-36039 (PyMySQL SQL Injection vulnerability); CVE-2024-36039 (PyMySQL SQL Injection vulnerability)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The manifest includes pymysql without a version pin even though the package has known advisories, so there is no way to determine from this file whether installation will select a fixed or affected release. Given this skill is a long-term RAG memory store backed by TiDB, a vulnerable database client can be more consequential because it sits on the path to persistent data operations and may enable injection-related compromise depending on how the library is used.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

google-genai is also unpinned, so the installed version may vary across environments and over time. That creates supply-chain and stability risk, especially for an agent skill where model SDK behavior changes could affect security boundaries, request handling, or data exposure.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
pymysql
google-genai

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The code accesses GEMINI_API_KEY and TiDB connection credentials from environment variables to operate. While credentials are practically needed for embeddings and database access, the manifest description does not disclose environment-secret access as part of the skill's scope, so this is an additional capability beyond the stated purpose.

Content

No source excerpt is available for this finding.