Back to skill

Security audit

pdf

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate PDF toolkit, but it needs review because it can create extra sensitive document copies and includes an in-place repair command that may overwrite files.

Install only if you are comfortable with a PDF skill that writes local PDFs, JSON, and page images. Use it on documents you are authorized to process, keep generated form data in approved locations, delete intermediate files when finished, avoid in-place repair commands, and use pinned dependencies in an isolated environment for OCR workflows.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:215
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:215
Vulnerability Type: Unpinned and unverified third-party dependencies
Risk Level: Medium

Vulnerable Code

python
# Requires: pip install pytesseract pdf2image

Technical Analysis

The Skill instructs users or agents to install pytesseract and pdf2image without specifying exact versions, cryptographic hashes, a lockfile, or a trusted package repository. Consequently, the code installed during one execution may differ from the code reviewed during the audit.

Python package installation can execute package-controlled build logic. If a dependency, transitive dependency, or configured package index is compromised, installation could run arbitrary code under the identity performing the installation.

This finding does not establish that the named packages are malicious. The risk arises from the absence of dependency integrity and reproducibility controls.

Attack Path

  1. An attacker compromises a future dependency release, one of its transitive dependencies, or a package source used by the environment.
  2. A user or agent follows the documented pip install pytesseract pdf2image instruction.
  3. pip resolves the uncontrolled package version from the configured index.
  4. Malicious package build or installation logic executes locally.
  5. The payload gains the same filesystem, network, and process privileges as the account running pip.

Impact Assessment

Successful exploitation could result in arbitrary code execution with the installing user's privileges. Depending on that user's permissions, the attacker could read or modify accessible documents, steal environment credentials, alter project files, or install additional user-level components. No privilege escalation beyond the installing account is demonstrated by the audited project.

Remediation
View remediation

Remediation Suggestions

  • Provide a reviewed dependency manifest with exact versions.
  • Use hash verification, such as a requirements file generated with --generate-hashes and installed using pip install --require-hashes.
  • Pin transitive dependencies as well as direct dependencies.
  • Require an explicitly trusted package index and disable unintended extra indexes.
  • Install dependencies in an isolated, least-privileged virtual environment or container.
  • Add automated dependency vulnerability and provenance scanning.
  • Document tested dependency versions rather than placing an unconstrained installation command in an example comment.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/convert_pdf_to_images.py:9
Finding

Resource Exhaustion Through Unbounded PDF Rendering

Content
View full analysis

Vulnerability Details

File Location: scripts/convert_pdf_to_images.py:9-18
Vulnerability Type: Uncontrolled resource consumption when processing untrusted PDFs
Risk Level: Medium

Vulnerable Code

python
images = convert_from_path(pdf_path, dpi=200)

for i, image in enumerate(images):
    # Scale image if needed to keep width/height under `max_dim`
    width, height = image.size
    if width > max_dim or height > max_dim:
        scale_factor = min(max_dim / width, max_dim / height)
        new_width = int(width * scale_factor)
        new_height = int(height * scale_factor)
        image = image.resize((new_width, new_height))

Technical Analysis

convert_from_path renders the entire PDF at 200 DPI and returns the resulting page images before the script applies its max_dim resizing. The post-render resize therefore does not constrain the memory and CPU consumed during PDF decoding and rasterization.

The implementation does not enforce limits on input file size, page count, page dimensions, rendering time, aggregate pixel count, memory usage, or output volume. A large or structurally complex PDF can cause excessive allocation and processing in Python, pdf2image, or the underlying Poppler utilities.

Because PDF conversion is a required part of the documented form workflow, an attacker-supplied PDF can reach this operation through normal Skill usage.

Attack Path

  1. An attacker supplies a PDF containing a very large number of pages, oversized page dimensions, complex graphical content, or other resource-intensive structures.
  2. The user or agent invokes convert_pdf_to_images.py as directed by the form-processing workflow.
  3. convert_from_path(pdf_path, dpi=200) attempts to render all pages and collect the images.
  4. Memory, CPU, temporary storage, or execution time is exhausted before the resizing loop can reduce image dimensions.
  5. The conversion process or host wo ...[truncated 493 chars]
Remediation
View remediation

Remediation Suggestions

  • Reject files exceeding a documented maximum size or page count before rendering.
  • Inspect PDF page dimensions and calculate projected pixel counts before conversion.
  • Render pages incrementally rather than returning all page images in one list.
  • Use first_page and last_page to process bounded page ranges.
  • Set a strict timeout for convert_from_path and handle timeout exceptions safely.
  • Render directly at a resolution calculated to satisfy the final dimension limit instead of rendering at 200 DPI and resizing afterward.
  • Run Poppler conversion in a sandbox or container with CPU, memory, process, and temporary-storage limits.
  • Limit output volume and monitor available disk space.
  • Catch resource and parser errors, remove partial outputs, and return a controlled failure message.
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 (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description promises a broad PDF toolkit with capabilities like extraction, creation, merging/splitting, and form handling. The supplied code chunk instead contains unit tests for a specific helper (get_bounding_box_messages) that validates geometric relationships among form field bounding boxes and entry text sizing. While this is loosely related to PDF forms, it is not representative of the declared comprehensive toolkit and does not implement the advertised capabilities in this chunk. The mismatch is about primary purpose and scope, not permissions or hidden resource access.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill documents and enables file-writing behavior such as creating, merging, splitting, watermarking, encrypting, and exporting PDFs, but it declares no explicit tool scope or permission boundary. In an agent setting, missing scope metadata can cause overbroad invocation and unsafe file modification in contexts where only read-only PDF analysis was expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation language is very broad ('when Claude needs to ... process, generate, or analyze PDF documents at scale'), which can cause the skill to trigger for a wide range of PDF-related requests, including sensitive or destructive operations. Overbroad activation increases the chance of the agent selecting this skill in situations involving confidential documents, form manipulation, OCR of sensitive records, or file generation without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation includes a direct example for decrypting password-protected PDFs without any warning that this should only be done with authorization. In an agent workflow, this lowers friction for misuse by normalizing circumvention of document protections and could facilitate unauthorized access to confidential material.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow instructs the agent to generate JSON files and filled PDFs containing personally identifiable and potentially sensitive form data, but it provides no warning about creating persistent artifacts or overwriting existing files. In a PDF-form skill, this increases the chance that sensitive data is unintentionally stored, duplicated, or exposed through local files, logs, backups, or shared workspaces.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The non-fillable workflow creates additional artifacts such as page images, validation images, fields.json, and annotated output PDFs, all of which can expose user-supplied form contents and document contents beyond the original file. Because the instructions emphasize image generation and annotation but omit any warning about sensitive-data proliferation, users or agents may leave multiple readable copies of private information on disk.

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 a qpdf --replace-input corrupted.pdf example that overwrites the original file in place without any warning, backup step, or safer alternative. In a PDF-processing skill, users may copy commands directly against valuable documents, so destructive in-place modification can cause irreversible data loss if the repair fails or produces unexpected output.

Content

No source excerpt is available for this finding.