Back to skill

Security audit

Pdf

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed PDF-processing guide with helper scripts; it has ordinary document-handling risks but no evidence of hidden, destructive, persistent, or exfiltrating behavior.

Install only if you want a broad PDF assistant. Use it on PDFs you are authorized to process, prefer writing outputs to new files, make backups before repair or overwrite-style commands, and install OCR dependencies in an isolated environment with reviewed pinned versions when possible.

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

Unpinned Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:235
Vulnerability Type: Unpinned third-party dependencies from a mutable package registry
Risk Level: Medium

Vulnerable Code Snippet

python
# Requires: pip install pytesseract pdf2image

Technical Analysis

The OCR workflow recommends installing pytesseract and pdf2image directly from the default Python package registry without version constraints, integrity hashes, a lockfile, or an explicitly trusted index.

Because dependency resolution occurs at installation time, the installed code can differ from the code available when this Skill was audited. If an upstream package, maintainer account, dependency, or configured package index is compromised, an attacker-controlled release could be selected. Python packages can execute code during installation and whenever imported by the OCR workflow.

The documented package names are legitimate and the audit found no evidence that they are currently malicious. The vulnerability is the mutable and unverifiable dependency-installation process.

Attack Path

  1. A user requests OCR processing for a scanned PDF.
  2. The Agent follows the prerequisite at SKILL.md:235.
  3. It runs pip install pytesseract pdf2image without pinned versions or hashes.
  4. Pip resolves packages and transitive dependencies from its configured index at that time.
  5. A compromised release, dependency, maintainer account, or package index supplies malicious code.
  6. The code executes during installation or when the workflow imports the package.

Impact Assessment

Malicious package code would normally execute with the privileges of the account running pip or the OCR workflow. Depending on the environment, it could read or modify files accessible to that account, inspect environment variables, access documents being processed, make network requests, or tamper with generated output.

The scope is limited by the runtime's operating-system permissions, network cont ...[truncated 173 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the inline installation instruction with a reviewed dependency manifest containing exact versions.
  2. Generate and require cryptographic hashes for every direct and transitive dependency, such as with a hash-locked requirements file and pip install --require-hashes.
  3. Use an approved package index or internal artifact mirror and explicitly configure the index rather than relying on ambient pip configuration.
  4. Regularly scan and update the lockfile through a controlled review process.
  5. Install dependencies in an isolated virtual environment or container under a non-privileged account.
  6. Restrict outbound network access and access to secrets while processing untrusted PDFs.
  7. Record the expected Python and system-package versions, including the Poppler and Tesseract components used by these libraries.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad PDF-processing skill covering many user-facing PDF operations. The supplied code does none of those things: it accepts a JSON description of form fields, checks rectangle intersections and text-fit constraints, and prints validation results. This is a materially different primary purpose and capability set from the declared PDF utility description, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description claims a general-purpose PDF skill covering many PDF manipulation and extraction tasks. The supplied code has a much narrower and different behavior: it renders PDF pages to PNG files. While this is loosely PDF-related, it is not one of the explicitly described capabilities except perhaps tangentially 'anything with PDF files.' More importantly, the actual primary purpose is image rendering/export, not the broad PDF-processing functionality promised. Therefore the description does not accurately represent what this specific code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code chunk does not implement the broadly declared PDF-handling functionality. Instead, it performs a narrow image-annotation task using PIL: it reads form field bounding box data from JSON, draws rectangles on an input image for a given page number, and writes out a validation image. While this could be part of a larger PDF form-processing pipeline, the behavior shown here is materially different from the declared purpose and involves capabilities and inputs (JSON + image annotation) not represented in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This is a mismatch because the description promises a broad PDF skill for many common PDF operations, while the supplied code chunk specifically inspects AcroForm annotations and emits structured form-field information as JSON. Although this is loosely related to PDFs and could be considered adjacent to 'filling PDF forms,' the actual implemented behavior is materially narrower and different: it does not fill forms, create PDFs, OCR, extract text/tables, merge/split, rotate, watermark, or encrypt/decrypt. Instead, it analyzes form fields and their positions. That specialized capability is undeclared, and the primary purpose of this code chunk is not accurately represented by the broad description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents this as a broad, catch-all PDF skill to use whenever the user wants to do anything with PDFs. The supplied code does not implement a general PDF toolkit. Its primary purpose is materially narrower: analyzing a non-fillable PDF's visual/form structure and exporting coordinates for labels, lines, checkbox candidates, and row boundaries. While this loosely fits a subset of 'reading/extracting' from PDFs, the description significantly overstates the implemented functionality and implies many capabilities that are absent from the code. Therefore the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The activation text says to use this skill whenever the user wants to do anything with PDFs, covering an extremely broad set of requests. In an agent-routing context, such catch-all activation can cause the skill to trigger on many benign PDF mentions, increasing the chance of unnecessary file access, risky transformations, or use of decryption/OCR tooling when not actually needed.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill demonstrates file read/write capabilities through multiple code and command examples, but it declares no explicit tool scope or permission boundaries. In an agent environment, this increases the chance the skill is invoked with broader filesystem access than intended, making unintended file disclosure or overwrite easier if the agent follows the guide operationally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation includes password-removal/decryption commands with no caution about authorization, ownership, or legal/ethical handling of protected files. In a skill meant for agent use, that omission lowers friction for misuse and can facilitate unauthorized access to encrypted document contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The reference includes explicit commands for decrypting PDFs and removing password protection without any warning that these actions should only be performed with authorization. In an agent skill, this can normalize or facilitate bypassing document protections, especially if the agent later suggests or automates these commands for users handling third-party files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The in-place repair command overwrites the original PDF without warning, which can cause irreversible data loss or destruction of evidentiary/source material if suggested by an agent. In a file-processing skill, omission of overwrite warnings is risky because users may assume operations are non-destructive.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.