Back to skill

Security audit

PDF QR Extractor

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a local PDF QR-code extractor, but its install instructions use an overbroad Python package command that can modify the user’s system Python environment.

Install only in an isolated virtual environment, remove the separate fitz package, prefer pinned dependencies, and avoid using --break-system-packages. Treat generated page images and QR crops as sensitive if the source PDF contains private information, and delete the output directory when finished.

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:28
Finding

Unsafe and Ambiguous Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:28-32; README.md:5-8
Vulnerability Type: Unpinned and unnecessary third-party dependencies installed while bypassing package-management safeguards
Risk Level: Medium

Vulnerable Code

SKILL.md:28-32:

markdown
需要先安装依赖:
bash
pip install fitz PyMuPDF opencv-python numpy pyzbar --break-system-packages

README.md:5-8:

markdown
## 安装依赖

```bash
pip install fitz PyMuPDF opencv-python numpy pyzbar --break-system-packages
text

The corresponding import at `scripts/extract_qr.py:1` is:

```python
import fitz  # PyMuPDF

Technical Analysis

The installation instructions request both fitz and PyMuPDF, although the implementation identifies the fitz import as the module supplied by PyMuPDF. Installing the separate fitz distribution is unnecessary and introduces package-name ambiguity and additional supply-chain exposure.

None of the dependencies are version-pinned or hash-verified. Consequently, identical installation commands can resolve to different artifacts over time. If a package release or its distribution channel is compromised, package-controlled build or installation logic may execute during installation.

The use of --break-system-packages explicitly bypasses protections intended to prevent pip from modifying a system-managed Python environment. This increases the likelihood of dependency conflicts, replacement of operating-system-managed packages, and unintended effects on other Python applications.

No evidence establishes that the currently named packages are malicious. The vulnerability is the unsafe installation procedure and avoidable dependency exposure.

Attack Path

  1. A user follows the dependency-installation command from SKILL.md or README.md.
  2. pip resolves mutable, unpinned package releases, including the unnecessary fitz distribution.
  3. A compromised, replaced, ...[truncated 1100 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the unnecessary fitz package and retain PyMuPDF as the provider of the fitz module.

  2. Remove --break-system-packages from all installation instructions.

  3. Require installation in an isolated virtual environment, for example:

    bash
    python -m venv .venv
    . .venv/bin/activate
    python -m pip install --require-hashes -r requirements.txt
    
  4. Create a reviewed lock file or fully pinned requirements.txt containing exact versions.

  5. Add cryptographic hashes and use pip install --require-hashes so altered artifacts are rejected.

  6. Periodically scan dependencies for known vulnerabilities and review updates before changing pinned versions.

  7. Correct both SKILL.md and README.md so they provide the same hardened installation procedure.

  8. Prefer headless OpenCV packages where graphical functionality is not needed, reducing the dependency and attack surface after compatibility testing.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README's operational instructions and descriptions are presented in Chinese only, which can violate a language/locale policy when no opt-in or alternative language is offered. There is no indication that the skill is intentionally limited to a Chinese-language or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file contains user-facing docstrings and console output in Chinese, including error messages and usage text. This imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file documents that the tool will automatically create an output directory and save page images and QR code files, which affects the user's filesystem. The description explains the behavior, but it does not explicitly warn users about these write operations or their impact on disk contents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The natural-language instructions, examples, and headings are all presented in Chinese, which effectively forces a specific language without any opt-in or alternative. The policy requires flagging language or locale constraints unless the skill offers a choice or clearly justifies the restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly describes creating an output directory, saving extracted QR code images, and retaining intermediate page-rendered images, but it does not clearly warn users about local file writes and persistence of those artifacts. This can cause unintended data retention or disclosure, especially because PDFs and extracted QR contents may contain sensitive business or personal information.

Content

No source excerpt is available for this finding.