Back to skill

Security audit

Mineru Extract

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly purpose-aligned, but it needs review because it recommends an unsafe system-wide Python install and sends user documents to external MinerU/OSS services.

Review before installing. Use a virtual environment instead of the documented system-wide pip command, pin dependencies where possible, and avoid uploading confidential, regulated, or proprietary documents to MinerU unless you are comfortable with the third-party processing path.

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
SKILL.md:12
Finding

Unpinned System-Wide Python Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12-16
Vulnerability Type: Unsafe third-party dependency installation
Risk Level: Medium

Vulnerable Code

markdown
## 安装

首次使用时,安装依赖:

```bash
pip3 install --break-system-packages requests python-dotenv
text

### Technical Analysis

The installation command retrieves `requests` and `python-dotenv` from the configured Python package index without pinning reviewed versions, verifying cryptographic hashes, or using a lock file. Consequently, the installed artifacts can change between executions even though the audited skill content remains unchanged.

The command also uses `--break-system-packages`, which bypasses Python's externally managed environment protection. This permits pip to modify the host's system-managed Python environment and can overwrite or conflict with operating-system packages.

Exploitation requires the configured package source or a selected dependency release to become malicious or otherwise untrusted. No evidence in the audited project indicates that either named package is currently malicious; the finding concerns the unsafe installation mechanism and resulting supply-chain exposure.

### Attack Path

1. A user or agent follows the first-use installation instructions.
2. The command connects to the configured Python package index and resolves the latest acceptable dependency versions.
3. An attacker who has compromised the package source, a dependency release, or the relevant package-distribution path supplies a malicious artifact.
4. Pip downloads and installs that artifact without checking a project-defined version or hash.
5. Package installation logic executes with the privileges of the invoking account.
6. Because `--break-system-packages` permits changes to the system Python environment, malicious or incompatible components can affect other Python applications that use the same environment.

### Impact Assessment

A malicious dependency artifact could ex
...[truncated 594 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove --break-system-packages and install dependencies in a dedicated virtual environment:
bash
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --require-hashes -r requirements.txt
  1. Pin every direct and transitive dependency to a reviewed version in requirements.txt.
  2. Record SHA-256 hashes for every permitted distribution and enforce them with --require-hashes.
  3. Generate and review a dependency lock file using a tool such as pip-tools.
  4. Use a trusted, explicitly configured package index and secure transport.
  5. Periodically scan locked dependencies for known vulnerabilities and review updates before changing pinned versions.
  6. Document that installation must not be performed as root or in the operating system's managed Python environment.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

在项目目录创建 .env 文件:

bash
# .env
MINERU_API_KEY="your-api-key-here"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

在项目目录创建 .env 文件:

bash
# .env
MINERU_API_KEY="your-api-key-here"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

在项目目录创建 .env 文件:

bash
# .env
MINERU_API_KEY="your-api-key-here"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs users to upload local documents/images to MinerU and intermediate OSS endpoints but does not warn that file contents leave the local environment and are sent to third-party services. This creates a real privacy and data-handling risk because users may unknowingly transmit sensitive documents, credentials, personal data, or proprietary materials to external infrastructure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill metadata and instructions are written to operate in Chinese and do not indicate that users may choose another language or locale. This can violate language/locale policy when a skill implicitly enforces a specific language without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.