Back to skill

Security audit

原子化RAG知识库构建器

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but it exposes a GitHub token and under-discloses that PDF contents are sent to external embedding/vector systems and may be retained.

Review carefully before installing. Revoke and remove the exposed GitHub token, pin and audit dependencies, and only process PDFs you are comfortable sending to the configured embedding provider and storing in the selected vector database. Use an isolated environment and define retention/deletion controls for stored knowledge bases.

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
package.json:12
Finding

GitHub Personal Access Token Embedded in Repository URL

Content
View full analysis

Vulnerability Details

File Location: package.json:12-15
Vulnerability Type: Hardcoded authentication credential
Risk Level: High

Vulnerable Code

json
"repository": {
  "type": "git",
  "url": "git+https://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@github.com/simonstang/atomic-rag-knowledge-base.git"
},

Technical Analysis

The repository URL contains a GitHub personal access token in plaintext. Anyone who receives this package, reads its source, accesses a cached copy, or observes tooling logs containing the repository URL can recover the credential.

Embedding credentials in URLs also increases secondary exposure because Git clients, package managers, build systems, proxy logs, shell histories, and diagnostic output may record complete URLs. Whether exploitation remains possible depends on whether the token is still valid and which permissions and repository access were assigned to it.

Attack Path

  1. An attacker downloads or otherwise accesses the project.
  2. The attacker opens package.json and extracts the token from the repository URL.
  3. The attacker attempts to authenticate to the GitHub API or Git operations using the exposed token.
  4. If the token remains valid, the attacker enumerates the repositories and operations permitted by its scopes.
  5. The attacker reads private resources, modifies repository content, creates releases, or performs other operations allowed by the token.
  6. Modified repository content could subsequently be distributed to users who clone or install the project.

Impact Assessment

The exact impact cannot be established from the repository because the token's current validity and permission scopes are unknown. If valid, the attacker can obtain all GitHub privileges granted to the token. Depending on those privileges, the scope could include private repository access, source-code modification, issue management, release manipulation, or broader account and organization resources.

Repository ...[truncated 162 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke the exposed token immediately through GitHub's credential settings.
  2. Review the token's audit history and repository activity for unauthorized use.
  3. Replace the authenticated URL with a credential-free URL:
json
"repository": {
  "type": "git",
  "url": "git+https://github.com/simonstang/atomic-rag-knowledge-base.git"
}
  1. Remove the secret from all Git history, tags, release archives, package publications, caches, and mirrors. Merely changing the current file does not remove historical exposure.
  2. Use a secret manager, CI secret store, environment variable, or Git credential helper when authenticated access is genuinely necessary.
  3. Grant replacement credentials only the minimum required permissions and use short expiration periods.
  4. Enable GitHub secret scanning and pre-commit secret detection to prevent recurrence.

T08 · Insecure Dependencies

Warning
Location
requirements.txt:2
Finding

Open-Ended and Unlocked Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:2-37; installation instruction at PUBLISH.md:60-62
Vulnerability Type: Unpinned third-party dependencies and non-reproducible installation
Risk Level: Medium

Vulnerable Code

requirements.txt:2-37:

text
python>=3.8

# PDF processing
pdfplumber>=0.10.0
PyMuPDF>=1.23.0
pdf2image>=1.16.0

# OCR
pytesseract>=0.3.10
Pillow>=10.0.0

# NLP and text processing
spacy>=3.7.0
keybert>=0.8.3

# Vector databases
pymilvus>=2.3.0
chromadb>=0.4.0
pinecone-client>=2.2.0

# Embedding models
langchain>=0.1.0
langchain-openai>=0.0.5
sentence-transformers>=2.2.0

# Knowledge graph
networkx>=3.1.0

# Data science
numpy>=1.24.0
pandas>=2.0.0
scikit-learn>=1.3.0

# Other
python-dotenv>=1.0.0
tqdm>=4.65.0

PUBLISH.md:60-62:

bash
git clone https://github.com/xuelai-xuequ/atomic-rag-knowledge-base.git
cd atomic-rag-knowledge-base
pip install -r requirements.txt

Technical Analysis

Every Python package is declared with an open-ended lower bound. Consequently, installations performed at different times can resolve to substantially different dependency versions without any change to this repository. The project also does not provide hashes that would allow installers to verify the exact reviewed artifacts.

Python package installation may execute package build backends and installation-related code. A malicious or compromised future release satisfying one of these constraints could therefore run code during installation or later when imported. Even absent malicious activity, incompatible releases can silently change security-sensitive behavior or break the application.

The line python>=3.8 is not a valid method of declaring the interpreter requirement in a pip requirements file. Pip can interpret python as a package requirement rather than as a runtime-version constraint, introducing an unnecessary and potentially confusing package resolution attempt.

No specific dependency in the su ...[truncated 1411 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove python>=3.8 from requirements.txt. Declare the supported interpreter version in package metadata, such as requires-python, and enforce it in CI.
  2. Generate a lock file containing exact, reviewed versions for direct and transitive dependencies.
  3. Require cryptographic hashes for production installation, for example by generating a hashed requirements file and installing it with:
bash
pip install --require-hashes -r requirements.lock
  1. Separate abstract dependency constraints from reproducible deployment dependencies. Keep compatible ranges in project metadata if necessary, but deploy from an exact lock file.
  2. Remove packages that are not actually used to reduce the supply-chain attack surface.
  3. Use a controlled package index or registry proxy and restrict unexpected alternative sources.
  4. Add automated dependency vulnerability scanning and update dependencies through reviewed pull requests.
  5. Run installation and document processing in a minimally privileged, isolated environment without unnecessary secrets.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (47)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The repository URL contains what appears to be a GitHub personal access token embedded directly in package metadata. Secrets in package.json are easily exposed through source control, package publishing, logs, dependency tooling, and downstream mirrors, allowing unauthorized access to the associated GitHub account or repositories if the token is valid.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file includes usage instructions for processing user-supplied PDFs and persisting the resulting knowledge atoms to a vector database. Because these actions can affect privacy and user data retention, the skill description should explicitly warn users not to ingest sensitive or confidential documents without appropriate safeguards.

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

The file contains almost all substantive instructions and descriptions in Chinese, with only minimal English labels, and it does not state that the skill supports multiple languages or that Chinese output is optional. This creates a natural-language locale constraint without user opt-in, which fits the policy-violation category for forced language/locale behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The builder initializes OpenAIEmbeddings and later uses it to embed full PDF-derived chunks, which means document contents are transmitted to an external service. For a tool presented as a PDF-to-knowledge-base builder, this is a real data exposure/privacy issue if users reasonably expect local-only processing or are handling sensitive documents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

pytesseract.image_to_string 使用固定 lang='chi_sim+eng',意味着技能在OCR时强制使用特定语言配置。文件中未见用户可选语言设置、自动检测说明或该限制的明确合理化文档,符合语言/locale策略违规特征。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

At embedding time, the code submits atom.content chunks to the embedding provider without any in-product notice, consent flow, or sensitivity check. This is dangerous because users may process proprietary, regulated, or personal PDF content under the mistaken assumption that analysis happens locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code can persist processed document content and metadata into Chroma or Milvus backends, which may be external or durable stores depending on deployment. This expands the data exposure surface beyond transient processing, creating confidentiality and retention risks if users are not clearly warned or allowed to control storage targets.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

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-/developer-facing natural-language documentation entirely in Chinese, including the module description of the processors' purpose. Under the language/locale policy, forcing a specific language without opt-in or a documented region-specific justification can be a policy violation.

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 docstrings and user-facing prompt/answer text are written entirely in Chinese, and the generated answer path explicitly constructs Chinese-language responses. There is no indication that the skill is China-specific or that users can opt into another language, which creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt passed to the answer-generation path instructs the model in Chinese, and the fallback simulated answer is also always returned in Chinese. This is a natural-language policy issue because the implementation enforces a specific language with no user choice or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file includes example usage that processes a local PDF and stores extracted content into a vector database, which can affect user data and privacy. The surrounding documentation does not disclose that document contents may be persisted or should be reviewed for sensitive information before ingestion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language description includes Chinese title and tagline text, which imposes a specific language presentation without indicating that users can choose another language. Under the language/locale policy rule, forcing a language without opt-in can be a policy concern even when it appears only in descriptive text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Persisting atoms into a vector database without an explicit save/retention prompt is a real transparency and privacy weakness, especially when metadata includes source information and the backend may be persistent or remote. The issue is lower impact than direct exfiltration because storage destination depends on configuration, but it still creates unexpected retention risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The docstrings, comments, example file path, and user-facing output are all written in Chinese, and the code sets a Chinese-language usage context without any indication that language is configurable or intentionally region-scoped. This can violate language/locale policy when a skill implicitly requires a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This requirements file uses Chinese-only natural-language comments such as '基础依赖', 'PDF处理', and '其他' throughout the file. The policy calls for flagging language or locale constraints when a skill forces a specific language without user opt-in, and there is no indication here that Chinese-only labeling is optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Using a lower-bound only specifier for the runtime version makes builds non-reproducible and can pull in unexpected interpreter versions with behavior or security differences. In a skill that processes untrusted PDFs, OCR input, embeddings, and remote vector/LLM integrations, environment drift increases supply-chain and operational risk.

Content

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

text
# 基础依赖
python>=3.8

# PDF处理
pdfplumber>=0.10.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

An unpinned pdfplumber dependency allows future installs to pull different releases, including ones with newly introduced flaws or breaking parser behavior. Because this skill ingests untrusted document content, parser-related dependencies deserve reproducible, vetted versions.

Content

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

text
python>=3.8

# PDF处理
pdfplumber>=0.10.0
PyMuPDF>=1.23.0
pdf2image>=1.16.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

PyMuPDF is used for PDF handling, a high-risk file parsing surface, and the manifest permits any version at or above a minimum. This makes it impossible to ensure deployed builds avoid vulnerable releases, increasing exposure to parser or path-handling issues when processing attacker-controlled PDFs.

Content

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

text
# PDF处理
pdfplumber>=0.10.0
PyMuPDF>=1.23.0
pdf2image>=1.16.0

# OCR

Unverifiable Dependency: PyMuPDF has 2 known advisory(ies) (CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py); CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The manifest references PyMuPDF without pinning an exact version, so there is no way to verify whether deployed environments avoid known vulnerable releases. This is more dangerous here because the skill processes untrusted PDFs, making parser and path-handling flaws materially relevant.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Unpinned pdf2image introduces non-reproducible builds and uncertainty around security posture for document conversion code. Since this component may process untrusted files and invoke external tooling paths, version drift can materially affect risk.

Content

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

text
# PDF处理
pdfplumber>=0.10.0
PyMuPDF>=1.23.0
pdf2image>=1.16.0

# OCR
pytesseract>=0.3.10

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

pytesseract is unpinned, so installations may resolve to different releases with varying security and reliability characteristics. In a pipeline handling user-supplied images/PDFs, reproducibility matters to reduce supply-chain uncertainty.

Content

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

text
pdf2image>=1.16.0

# OCR
pytesseract>=0.3.10
Pillow>=10.0.0

# NLP和文本处理

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

Pillow is a major image parsing library with a history of memory-safety and resource-consumption issues, and the manifest does not pin a specific safe version. Because this skill performs OCR and image handling on potentially untrusted content, leaving Pillow unpinned raises the chance of deploying a vulnerable or untested release.

Content

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

text
# OCR
pytesseract>=0.3.10
Pillow>=10.0.0

# NLP和文本处理
spacy>=3.7.0

Unverifiable Dependency: Pillow has 16 known advisory(ies) (CVE-2016-2533 (Pillow buffer overflow in ImagingPcdDecode); CVE-2023-50447 (Arbitrary Code Execution in Pillow); CVE-2021-27922 (Pillow Uncontrolled Resource Consumption) +13 more), 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

Pillow has multiple known advisories and the manifest does not specify an exact version, leaving the actual deployed risk unknowable. Since this skill handles OCR/images from potentially attacker-controlled documents, image parser vulnerabilities have elevated relevance.

Content

No source excerpt is available for this finding.