Back to skill

Security audit

Corpus Search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed local corpus-search helper; its main risk is ordinary dependency hygiene, not hidden or malicious behavior.

Install in a virtual environment if possible, review or pin the dependency versions before use, and only run it against corpus directories and export paths you choose. The skill appears purpose-aligned for local corpus retrieval and does not show hidden persistence or data exfiltration.

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

T08 · Insecure Dependencies

Warning
Location
requirements.txt:4
Finding

Unpinned Third-Party Dependencies Allow Supply-Chain Compromise

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:4-19; installation instructions at SKILL.md:62-66
Vulnerability Type: Unpinned and non-reproducible third-party dependencies
Risk Level: Medium

Vulnerable Code

requirements.txt:4-19:

text
chromadb>=0.5.0

# Embedding model (semantic vectorization)
sentence-transformers>=2.2.2

# Configuration file parsing
pyyaml>=6.0.1

# Enhanced CLI output
rich>=13.7.0

# Progress bar support
tqdm>=4.65.0

# Cache mechanism
diskcache>=5.6.3

SKILL.md:62-66:

bash
## Dependencies

pip3 install -r requirements.txt --user

Technical Analysis

All six dependencies use lower-bound version constraints and accept any later release. The project provides neither a lock file nor package integrity hashes. Consequently, installation is not reproducible and may retrieve package versions that were never reviewed with the skill.

Python package installation can execute package build or installation logic in the installing user's context. A compromised upstream release, maliciously replaced distribution artifact, or otherwise unsafe future dependency version could therefore execute arbitrary code during installation or when imported at runtime.

The diskcache package also appears unnecessary. scripts/search_corpus.py:131-133 states that disk-backed caching was removed and that the implementation only uses an in-memory cache:

python
def initialize(self, cache_dir: Path, enabled: bool = True) -> None:
    """Initialize cache"""
    # diskcache has been removed; only the in-memory cache is used
    pass

Retaining an unused package expands the dependency attack surface without providing required functionality.

Attack Path

  1. An attacker compromises an eligible future release or distribution artifact of one of the listed packages or one of its transitive dependencies.
  2. A user follows the documented comm ...[truncated 1064 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an exact, reviewed version using ==.
  2. Generate a fully resolved lock file that fixes transitive dependency versions.
  3. Record cryptographic hashes for all approved distributions and install with hash verification, such as pip install --require-hashes -r requirements.txt.
  4. Use a trusted package index and explicitly configure the allowed index rather than relying on uncontrolled additional indexes.
  5. Remove diskcache because the current implementation does not use it.
  6. Install dependencies in an isolated virtual environment with the minimum required operating-system permissions.
  7. Add automated dependency vulnerability and provenance scanning to the release process.
  8. Review and update pinned versions through a controlled process that includes compatibility testing and security assessment.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个具备语料库检索与过滤能力的工具,但当前提供的代码片段只是 scripts/init.py 中的注释/文档字符串,没有任何可执行逻辑来访问语料库、执行搜索、处理元数据过滤或与 corpus-builder 配合。因此代码实际行为与声明用途存在明显不一致。

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
96% confidence
Finding

This code file contains user-facing natural language in the module docstring, CLI help text, and runtime messages exclusively in Chinese. Under the policy, forcing a specific language without offering a language or locale choice is a natural-language policy violation unless clearly justified as region-specific, which is not documented here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description contains Chinese content but also embeds the English directive "Use when:" as part of the activation guidance. This can impose a language-specific usage convention without explicitly offering the user a language or locale choice, which fits the language/locale policy concern for natural-language policy violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This requirements file contains natural-language comments written in Chinese, which imposes a specific language in the skill artifact without indicating user choice or opt-in. The policy explicitly calls out language or locale constraints as violations when a skill forces a specific language without offering alternatives.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Using an open-ended dependency specifier for chromadb makes builds non-reproducible and can silently introduce vulnerable or breaking upstream releases into the environment. In a search skill that relies on a database/vector stack, this increases supply-chain risk and makes it impossible to verify whether known vulnerable versions are being installed.

Content

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

text
# Corpus Search - Requirements

# ChromaDB 向量数据库
chromadb>=0.5.0

# 嵌入模型(语义向量化)
sentence-transformers>=2.2.2

Unverifiable Dependency: chromadb has 8 known advisory(ies) (CVE-2026-45830 (ChromaDB allows any authenticated users to arbitrarily read, write, update, or d); CVE-2026-45833 (ChromaDB has a code injection vulnerability); CVE-2026-45829 (ChromaDB Python project has a pre-authentication code injection vulnerability) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

The manifest does not pin chromadb, and the package has multiple serious advisories including code-injection and unauthorized access issues. Because the resolved version is unknown, the skill may install an affected release, which is especially concerning for a corpus-search tool built around a vector database component.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
84% confidence
Finding

An unpinned sentence-transformers dependency allows future releases to be installed without review, creating supply-chain and reproducibility risk. While not an exploit by itself, it weakens assurance over the runtime and model-loading behavior of the skill.

Content

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

text
chromadb>=0.5.0

# 嵌入模型(语义向量化)
sentence-transformers>=2.2.2

# 配置文件解析
pyyaml>=6.0.1

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Leaving PyYAML unpinned is riskier than many library dependencies because historically vulnerable releases have enabled unsafe parsing and deserialization behaviors. Without an exact version, deployments may resolve to a package version with known issues or incompatible security defaults.

Content

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

text
sentence-transformers>=2.2.2

# 配置文件解析
pyyaml>=6.0.1

# CLI 美化输出
rich>=13.7.0

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
94% confidence
Finding

PyYAML has a long history of unsafe deserialization issues, and the unpinned requirement prevents confirming whether a safe version will be installed. In a tool that may read configuration or metadata, this uncertainty can translate into code execution or parser abuse if unsafe APIs are used alongside a vulnerable package version.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
78% confidence
Finding

An unpinned rich dependency creates standard supply-chain uncertainty and non-reproducible builds. The direct security impact is limited in this context because rich is primarily a presentation library, but silent upgrades still expand attack surface and complicate verification.

Content

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

text
pyyaml>=6.0.1

# CLI 美化输出
rich>=13.7.0

# 进度条支持
tqdm>=4.65.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
87% confidence
Finding

An unpinned tqdm dependency can cause the environment to pick up versions with known vulnerabilities or unexpected CLI-related behavior. Since this package has advisories associated with argument-handling and execution contexts, failing to pin it prevents reliable exposure assessment.

Content

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

text
rich>=13.7.0

# 进度条支持
tqdm>=4.65.0

# 缓存机制
diskcache>=5.6.3

Unverifiable Dependency: tqdm has 4 known advisory(ies) (CVE-2024-34062 (tqdm CLI arguments injection attack); CVE-2016-10075 (TDQM Arbitrary Code Execution); CVE-2016-10075 (The tqdm._version module in tqdm versions 4.4.1 and 4.10 allows local users to e) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
82% confidence
Finding

The requirement for tqdm is not pinned, so there is no way to verify whether a vulnerable release with known CLI injection or execution-related issues will be installed. The danger depends on whether the skill exposes tqdm through command-line flows, but the manifest alone still represents unresolved supply-chain risk.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Using diskcache without version pinning introduces supply-chain uncertainty for a component that may handle serialized cached objects. If vulnerable releases are resolved, the impact could be more significant than a cosmetic library because caching layers can process attacker-influenced data.

Content

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

text
tqdm>=4.65.0

# 缓存机制
diskcache>=5.6.3

Unverifiable Dependency: diskcache has 2 known advisory(ies) (CVE-2025-69872 (DiskCache has unsafe pickle deserialization); CVE-2025-69872 (DiskCache has unsafe pickle deserialization)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

Diskcache has advisories related to unsafe pickle deserialization, and the unpinned manifest means an affected version could be installed without detection. For a search tool with caching, this is more dangerous if cache contents can be influenced by external or untrusted data, as deserialization flaws can lead to arbitrary code execution.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The method docstring says it initializes the cache, while the inline comment states disk cache was removed and only memory cache is used. In practice the method body is just pass, so the documented behavior of performing initialization contradicts the actual code.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest describes this skill as a corpus retrieval tool used to search and filter writing snippets. The code additionally supports writing the retrieved output to an arbitrary path via --export, which goes beyond pure search/retrieval behavior described in the manifest.

Content

No source excerpt is available for this finding.