Back to skill

Security audit

Corpus Builder

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it builds a local text corpus and can optionally send text to DashScope for AI annotation, with some operational risks users should manage.

Install only if you are comfortable with the skill creating local corpus files that may contain your original text and embeddings. Unset DASHSCOPE_API_KEY to keep annotation offline; if you use LLM mode, assume text chunks are sent to DashScope. Prefer a secret manager or temporary environment variable over storing API keys in ~/.bashrc, and verify any rm -rf path before running cleanup commands.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The README instructs users to persist an API key in ~/.bashrc, which can increase the chance of credential exposure through shell history, dotfile backups, shared accounts, or accidental publication of startup files. While this is common operational guidance rather than an exploit, documenting secret persistence without any warning or safer alternatives creates avoidable credential-handling risk.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
The documentation recommends rm -rf on a storage path without clearly warning that the action is destructive and irreversible. If users substitute the collection name incorrectly, run from an unexpected directory, or adapt the command carelessly, it can lead to unintended data loss beyond the vector store.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example explicitly instructs users to run a destructive `rm -rf` against the vector store but does not clearly warn that this will permanently delete indexed data and require a rebuild. In documentation for an agent skill, users may copy-paste commands directly, so omission of a data-loss warning creates a real operational safety issue even if it is not a code-execution exploit.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The troubleshooting guide recommends destructive deletion commands (`rm -rf`) to clear caches and remove corpus data, but it does not warn about irreversible data loss, scope the paths carefully, or suggest verification before execution. In a user-facing operational document, this can lead to accidental deletion of valuable local data if paths are mistyped, expanded unexpectedly, or copied without understanding.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The API key setup guidance tells users to export, persist, and print a secret value without warning about credential exposure risks. Persisting secrets in shell startup files and echoing them to the terminal can leak credentials through shell history, screen sharing, shoulder surfing, backups, or overly broad file permissions.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The annotator sends user-supplied text content to a third-party LLM service without any consent check, sensitivity screening, or clear warning at the transmission path. If users process proprietary, personal, or regulated text, this can cause unintended external disclosure and compliance violations even though the endpoint is legitimate.

Unpinned Dependencies

Low
Category
Supply Chain
Content
# Corpus Builder - Requirements

# ChromaDB 向量数据库
chromadb>=0.5.0

# 嵌入模型(语义向量化)
sentence-transformers>=2.2.2
Confidence
91% confidence
Finding
Using a lower-bound-only specifier like 'chromadb>=0.5.0' allows future major or minor releases to be installed automatically, which can introduce unreviewed vulnerable or malicious versions through the supply chain. In an agent skill that processes corpora and may interact with vector storage and external services, dependency drift increases the chance of breakage or exposure to newly introduced security issues.

Unpinned Dependencies

Low
Category
Supply Chain
Content
chromadb>=0.5.0

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

# 配置文件解析
pyyaml>=6.0.1
Confidence
91% confidence
Finding
Using 'sentence-transformers>=2.2.2' permits installation of any newer release without explicit review, increasing supply-chain risk and making builds non-reproducible. Because this package pulls in a substantial ML dependency tree, unpinned upgrades can materially expand the attack surface and introduce insecure transitive packages.

Unpinned Dependencies

Low
Category
Supply Chain
Content
sentence-transformers>=2.2.2

# 配置文件解析
pyyaml>=6.0.1

# CLI 美化输出
rich>=13.7.0
Confidence
96% confidence
Finding
Using 'pyyaml>=6.0.1' leaves room for dependency drift and also references a package with a history of unsafe deserialization issues when used improperly. In a corpus-building tool that explicitly parses configuration files, an unpinned YAML library is more dangerous because parser behavior and security posture may change across releases and YAML parsing often touches untrusted input.

Unpinned Dependencies

Low
Category
Supply Chain
Content
pyyaml>=6.0.1

# CLI 美化输出
rich>=13.7.0

# 内存监控
psutil>=5.9.8
Confidence
87% confidence
Finding
Using 'rich>=13.7.0' makes installations non-reproducible and may pull in future releases that have not been security-reviewed in this environment. While the direct security impact is lower than parser or network-facing libraries, it still contributes to avoidable supply-chain exposure.

Unpinned Dependencies

Low
Category
Supply Chain
Content
rich>=13.7.0

# 内存监控
psutil>=5.9.8

# sqlite3 版本兼容(ChromaDB 需要 sqlite3 >= 3.35.0)
# 如果系统 sqlite3 版本过低,安装此包作为替代
Confidence
95% confidence
Finding
Using 'psutil>=5.9.8' allows uncontrolled upgrades of a package with prior memory-safety advisories, creating supply-chain and stability risk. Since psutil interfaces with low-level system information, flaws in this dependency can have outsized impact on agent reliability and, in some cases, local attack surface.

Unpinned Dependencies

Low
Category
Supply Chain
Content
# sqlite3 版本兼容(ChromaDB 需要 sqlite3 >= 3.35.0)
# 如果系统 sqlite3 版本过低,安装此包作为替代
pysqlite3-binary>=0.5.2

# LLM API 调用(AI 标注)
# 使用 OpenAI 兼容 API 调用 DashScope Coding
Confidence
90% confidence
Finding
Using 'pysqlite3-binary>=0.5.2' permits arbitrary newer binary wheel versions to be installed, which increases supply-chain risk and may introduce ABI or bundled-library issues without review. Binary-distributed database components are especially sensitive because they embed native code and interact with local data stores.

Unpinned Dependencies

Low
Category
Supply Chain
Content
# LLM API 调用(AI 标注)
# 使用 OpenAI 兼容 API 调用 DashScope Coding
openai>=1.0.0
Confidence
94% confidence
Finding
Using 'openai>=1.0.0' allows future client-library releases to be installed automatically, which can change authentication, request handling, or network behavior in code that talks to external LLM APIs. Because this skill optionally performs AI annotation via a remote API, unpinned client dependencies are more dangerous than purely local libraries due to credential handling and outbound communications.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
# 删除向量库重新构建
rm -rf corpus/chroma/{collection_name}
python3 scripts/build_corpus.py --source ~/novels/reference --name test
```
Confidence
97% confidence
Finding
The documentation recommends `rm -rf corpus/chroma/{collection_name}`, which is a powerful destructive command that can delete data recursively with no confirmation. In agent-skill examples, users often paste commands verbatim; if `{collection_name}` is substituted incorrectly, empty, or expanded unexpectedly, the command can wipe more data than intended.

Static analysis

No suspicious patterns detected.