Back to skill

Security audit

Smart PDF OCR

Security checks for vulnerabilities and agentic risk

Overview

This OCR skill is purpose-aligned and transparent enough for normal use, but users should understand it relies on an external MinerU CLI/API and a global npm install.

Before installing, confirm you trust the mineru-open-api npm package and understand whether MinerU uploads or stores your PDFs. Avoid sensitive contracts, receipts, regulated records, or private documents unless the provider's privacy and retention terms meet your needs.

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:34
Finding
Unpinned Global npm Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 34-38 **Vulnerability Type**: Unpinned third-party package installed globally from an external registry **Risk Level**: Medium ### Vulnerable Code ```markdown ## Installation ```bash npm install -g mineru-open-api ``` ``` ### Technical Analysis The installation instructions retrieve and globally install the latest version of `mineru-open-api` from the configured npm registry without an exact version pin, lockfile, cryptographic integrity value, or documented provenance verification. Because the dependency's implementation is not included in the project, its effective behavior can change independently after this Skill has been reviewed. npm packages may also execute lifecycle scripts during installation. The global `-g` installation expands the potential effect by placing the executable and related package files in the user's global npm environment. This does not prove that the referenced package is currently malicious. It creates a supply-chain exposure in which a compromised publisher account, malicious future release, dependency compromise, registry substitution, or similarly unsafe package source could cause attacker-controlled code to execute. ### Attack Path 1. An attacker compromises the package publisher, a transitive dependency, the package distribution path, or a future package release. 2. The attacker publishes a malicious version under the package name referenced by the Skill. 3. A user follows the documented command without specifying a reviewed version. 4. npm resolves and downloads the attacker-controlled release from the configured registry. 5. Malicious lifecycle scripts may execute during installation, or malicious code may execute when the installed `mineru-open-api` command is later invoked. 6. The payload runs with the privileges and environment access of the user performing the installation or OCR operation. ### Impact Assessme ...[truncated 609 chars]
Remediation
## Remediation Suggestions 1. Pin the dependency to an exact version that has been independently reviewed, rather than resolving the latest release: ```bash npm install --save-exact mineru-open-api@<reviewed-version> ``` 2. Prefer a project-local installation instead of `-g`, and invoke it through a controlled local package script or an explicitly resolved binary path. 3. Commit and enforce a lockfile so that both direct and transitive dependency versions remain reproducible. 4. Verify package provenance, publisher identity, repository ownership, signatures or attestations, and registry integrity metadata before installation. 5. Review package lifecycle scripts and consider installing with `--ignore-scripts` where the package can function without them. 6. Run the OCR utility in a sandbox or container with minimum filesystem and network access, especially when processing sensitive documents. 7. Establish an update process in which each new package version and dependency-tree change is reviewed before the pinned version is advanced.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill routes OCR through the MinerU API/CLI but does not clearly disclose that uploaded PDF contents may leave the local system and be processed by an external provider. For scanned contracts, receipts, or other sensitive documents, this can lead to unintended disclosure of confidential or regulated data because users may reasonably assume OCR is local.

External Model or Provider Selection

Medium
Category
Excessive Agency
Content
- image-to-text
tools:
  - Bash(mineru-open-api:*)
model: claude-3-5-haiku-20241022
---

# Smart PDF OCR with mineru-open-api
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Missing User Warnings

Low
Confidence
91% confidence
Finding
The installation step instructs users to run a global npm install, which modifies the host environment and can introduce package-supply-chain risk or operational side effects without warning. While common, this is still a security-relevant omission because it encourages persistent system changes in order to use the skill.

Static analysis

No suspicious patterns detected.