Back to skill

Security audit

Knowledge Base

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent local knowledge-base tool, but it needs Review because category input can write imported documents outside the knowledge-base folder and setup installs unpinned packages into the active Python environment.

Install only in a dedicated virtual environment, review or patch category validation before using custom categories, and avoid watch mode, cron import, or broad batch scans unless the source directories contain only files you want stored and searchable. Treat delete as permanent for stored knowledge-base content.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/kb_manager.py:246
Finding

User-Controlled Category Enables Filesystem Writes Outside the Knowledge-Base Directory

Content
View full analysis
bool: """Add a new category.""" ensure_kb_exists() index = load_index() if name not in index["categories"]: index["categories"].append(name) (KB_ROOT / name).mkdir(exist_ok=True) save_index(index) return True return False ``` The affected values are reachable through user-facing entry points, including: - `scripts/kb_cli.py`, through `ingest --category` and `add-category` - `scripts/batch_ingest.py`, through `--category` - `scripts/lark_bridge.py`, through the `category` argument ### Technical Analysis `category` and category `name` values are used directly as filesystem path components without validation or containment checks. Python's `pathlib` does not guarantee that `KB_ROOT / category` remains under `KB_ROOT`. If `category` is an absolute path, the absolute operand replaces the preceding root. Relative v ...[truncated 1882 chars]
Remediation
View remediation
Path: if not category or Path(category).is_absolute(): raise ValueError("Invalid category") if category in {".", ".."} or "/" in category or "\\" in category: raise ValueError("Category must be a single directory name") root = KB_ROOT.resolve() destination = (root / category).resolve() if not destination.is_relative_to(root): raise ValueError("Category escapes the knowledge-base directory") return destination ``` 5. Apply the same validation helper in both `ingest_file()` and `add_category()`. 6. Before writing the Markdown file, resolve `md_path` and perform a second containment check against the resolved knowledge-base root. 7. Consider refusing symlinked category directories, or verify that their resolved targets remain under `KB_ROOT`. 8. Add regression tests covering absolute paths, `../` traversal, nested paths, path separators, and symlink escapes. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/init.py:35
Finding

Automatic Installation of Unpinned Dependencies into the Active Python Environment

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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (25)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly encourages automatic ingestion of files from /tmp/openclaw and Feishu-triggered workflows without any warning, confirmation step, or discussion of privacy and trust boundaries. In context, this can cause unreviewed local files to be persisted into the knowledge base, indexed, and later surfaced in search, which increases the risk of accidental data collection or exposure of sensitive documents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation exposes a delete command with no warning that it is destructive, which can lead users or higher-level agents to remove indexed content unintentionally. In a skill context where actions may be automated, omission of a safety notice increases the chance of irreversible data loss or deletion of the wrong document.

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 docstrings and all user-facing printed status/error messages are written only in Chinese, which imposes a specific language on users. The file does not provide an opt-in, fallback language, or documented justification that this skill is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language strings entirely in Chinese in the module docstring and CLI/help/output text, which imposes a specific language on users. The policy allows locale constraints only when users are given a choice or when the restriction is clearly documented and justified, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains user-facing natural-language text exclusively in Chinese in the module docstring and throughout the command-line interface, which imposes a specific language on users without opt-in. The policy allows locale constraints only when they are documented and justified or when users are given a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s docstrings and all user-facing print messages are in Chinese, including initialization status and failure guidance. This imposes a specific language on users without opt-in, which matches the locale-policy violation criteria for natural-language content.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/init.py (reported line 26)May include surrounding context.

python
missing = []
    for pkg in required:
        try:
            __import__(pkg)
        except ImportError:
            missing.append(pkg)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The script automatically invokes pip to install packages at runtime, which executes code from external package distributions and modifies the host Python environment. In a skill context, this is risky because installation is triggered by simply running the initializer, uses the highly permissive --break-system-packages flag, and relies on whatever package sources and versions are resolved at execution time.

Content

Scanner excerpt · scripts/init.py (reported line 44)May include surrounding context.

python
cmd = [sys.executable, "-m", "pip", "install", "--break-system-packages"] + missing
    
    try:
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI invokes check_dependencies(auto_install=True) during startup, which can trigger package installation automatically before the user performs any explicit action or grants consent. In an agent or automation context, this expands the attack surface by allowing unexpected network access and environment modification, and it could install unpinned or tampered dependencies if the dependency source is compromised.

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/kb_manager.py (reported line 73)May include surrounding context.

python
except ImportError:
        # 降级到CLI
        try:
            result = subprocess.run(
                ["markitdown", source_path],
                capture_output=True,
                text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

With no manifest available, the code should be judged against its apparent purpose from names and docstrings: managing a local knowledge base by ingesting, indexing, and searching documents. Spawning a subprocess to invoke an external converter is a materially broader capability than simple local data management and is not clearly justified by the documented scope in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

delete_document removes files immediately based solely on a doc_id and does not require confirmation, authorization checks, or path revalidation before unlinking. In a skill or agent context, where destructive actions may be triggered indirectly or by ambiguous prompts, this increases the risk of unintended data loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and command-line interface are entirely in Chinese, including the tool description and usage context. This imposes a specific language on users without any opt-in, fallback, or documented region-specific justification, which matches the language/locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains user-facing natural-language strings exclusively in Chinese, including the module docstring and later CLI help text, with no indication that language selection is optional. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Runtime package installation is an unjustified privileged action for a local vector search helper and expands the script's attack surface beyond its stated purpose. It enables network access and package execution during normal use, which is risky in agent/skill contexts where users may not expect the tool to modify the Python environment or install arbitrary code transitively.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script installs a package automatically without explicit consent, warning, or review, which is dangerous because it silently changes the execution environment and may pull executable code from external package repositories. In a skill context, this is more concerning because users may invoke a search/index command expecting only local processing, not network-backed software installation with system-package override flags.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The script automatically executes a pip install at runtime, which gives a local indexing utility unnecessary code-execution and environment-modification capability. Even though the command arguments are hardcoded and not directly shell-injectable, it still causes unreviewed package retrieval and installation from configured package sources, which can expose users to dependency confusion, malicious mirrors, or unexpected system changes.

Content

Scanner excerpt · scripts/vector_index.py (reported line 36)May include surrounding context.

python
except ImportError:
        print("正在安装 chromadb...")
        import subprocess
        subprocess.check_call([
            sys.executable, "-m", "pip", "install", "--break-system-packages",
            "chromadb"
        ])

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The documentation explicitly describes Chinese-specific tokenization using jieba and later states the design principle as 中文友好, but it does not indicate that language support is optional or user-selectable. This can be a natural-language policy issue when a skill appears to assume a specific language/locale without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The design principle 中文友好:jieba 分词 + 中文停用词过滤 communicates a default Chinese-language orientation, but no user choice or alternative locale behavior is documented. Under the policy, forcing or implicitly defaulting to a specific language without opt-in may be a violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency jieba is unpinned, which makes builds non-reproducible and can pull in different package versions over time, including versions with newly introduced vulnerabilities or breaking changes. While not an exploit by itself, this weakens supply-chain control and makes security review and incident response harder.

Content

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

text
markitdown[all]
jieba
scikit-learn

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
99% confidence
Finding

The dependency scikit-learn is unpinned, so installations may resolve to any available version, including releases affected by known CVEs. In this case the risk is elevated because the package has multiple known advisories and the manifest provides no way to determine whether a safe version will be installed.

Content

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

text
markitdown[all]
jieba
scikit-learn

Unverifiable Dependency: scikit-learn has 6 known advisory(ies) (CVE-2020-13092 (scikit-learn Deserialization of Untrusted Data); CVE-2024-5206 (scikit-learn sensitive data leakage vulnerability); CVE-2020-28975 (scikit-learn Denial of Service) +3 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

scikit-learn has known security advisories, and because no version is pinned, the environment could install a vulnerable release without visibility or control. This is especially relevant for ML-related packages where some CVEs involve deserialization or denial of service, which can become exploitable depending on how the skill processes model artifacts or untrusted input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language strings in the file present the interface and command help exclusively in Chinese, with no indication that users can choose another language or locale. Per the policy, forcing a specific language without user opt-in can be a language/locale policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill embeds Chinese-only category names as defaults and uses Chinese-language instructional text throughout the code, which indicates a language-specific experience without any visible user opt-in or alternative locale handling. This may violate a language/locale policy when the skill is expected to be generally usable across users.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The inline comment describes building document text from the title, keywords, summary, and the first 2000 characters of content. However, the code uses content[:3000], so the documentation contradicts the implemented behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.