Back to skill

Security audit

PDF All-in-One

Security checks for vulnerabilities and agentic risk

Overview

This is a PDF utility skill with expected local PDF read/write behavior, but users should be careful with its install, overwrite, and password/decryption examples.

Install dependencies in a virtual environment when possible, review any sudo package installation before running it, keep input and output files inside the documented workspace, and use decryption or password-removal examples only for PDFs you own or are authorized to process.

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:73
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 73-77 **Vulnerability Type**: Unpinned runtime dependency installation **Risk Level**: Medium **Vulnerable Code:** ```bash ### Prerequisites ```bash # Install Python library pip install pdf2image ``` ### Technical Analysis The skill instructs users or agents to install `pdf2image` without specifying an audited version, lockfile, package hash, or trusted package index. Consequently, the installed code may change independently of the reviewed skill package. Because Python packages and their transitive dependencies can execute code during installation or when imported, an upstream compromise, malicious replacement, or unexpectedly unsafe future release could introduce unreviewed code into the execution environment. The project does not provide a dependency manifest that enables reproducible verification. ### Attack Path 1. An agent loads the skill and follows its prerequisite instructions. 2. The agent executes `pip install pdf2image`. 3. The package resolver retrieves the current package release and its transitive dependencies from the configured package index. 4. If an upstream package, dependency, package-index account, or configured index is compromised, malicious package code is installed. 5. Malicious code may execute during installation or when the PDF conversion script imports `pdf2image`. ### Impact Assessment Exploitation could execute code with the privileges of the user or agent running `pip`. This may expose files and environment variables accessible to that account, modify its Python environment, tamper with generated documents, or affect subsequent processes using the compromised environment. The scope is generally limited to the invoking account and environment. Greater impact is possible if installation is performed with elevated privileges, although the vulnerable instruction itself does not explicitly invoke `pip` through `sudo`.
Remediation
## Remediation Suggestions - Pin `pdf2image` and all transitive dependencies to reviewed versions in a dependency lockfile. - Require cryptographic hashes for every downloaded distribution: ```bash python -m pip install --require-hashes -r requirements.txt ``` - Generate `requirements.txt` from a reviewed lock process and include entries such as: ```text pdf2image==<audited-version> --hash=sha256:<verified-hash> ``` - Install dependencies in a dedicated virtual environment rather than a shared or system-wide Python environment. - Explicitly specify and document the trusted package index. - Add automated dependency vulnerability and integrity scanning to the release process. - Periodically review and intentionally update pinned versions rather than resolving the latest release during each installation.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The supplied code does not implement PDF processing features such as merging, splitting, extracting text/tables, converting PDFs, or OCR. Instead, it validates form field bounding boxes described in a JSON file by checking rectangle intersections and entry height versus font size. This is a materially different primary purpose from the declared PDF processing tool description.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a broad PDF processing suite focused on merge/split/extract/convert/OCR/table recognition. The supplied code only inspects a PDF for AcroForm fields and reports whether fillable fields exist. That is a materially different and much narrower purpose than the declared one, and the specific capability of form-field detection is undeclared. Therefore this is a description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The code chunk does not implement the declared PDF-processing features. Instead, it creates a validation image by overlaying bounding boxes from form field metadata onto an existing image for a given page. This is a materially different primary purpose from an all-in-one PDF processing tool. While such a script could be part of a larger PDF/form-processing pipeline, this specific code's actual behavior is image annotation for validation, not general PDF operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The code does not implement the broad PDF toolkit described. Instead, it performs a specialized form-structure analysis task on PDFs, aimed at locating labels, lines, and checkbox coordinates for later field mapping. This is materially different from the declared primary purpose of merging, splitting, converting, OCR, and table recognition. While it does operate on PDFs, the actual capability is narrower and different enough that the description does not accurately represent the code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
This code chunk's actual purpose is narrow and specific: it loads a PDF, reads field values from JSON, validates field IDs/pages/allowed values for checkboxes, radio groups, and choice fields, updates fillable form fields, and saves the result. That behavior is not mentioned in the declared description. While it is still PDF-related, the declared description emphasizes document processing features such as merge, split, extraction, conversion, OCR, and table recognition, none of which appear here. The main implemented capability—filling fillable PDF forms—is a materially different undeclared function, so this is a description-behavior mismatch.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill includes numerous examples that read from and write to local files, but it declares no explicit tool scope or permissions. In an agent environment, that mismatch weakens policy enforcement and can cause the skill to be invoked with broader file access than users expect.

Vague Triggers

Medium
Confidence
98% confidence
Finding
The trigger phrases are just 'PDF, pdf', which are so broad that the skill may activate in many unrelated contexts involving any PDF mention. Over-broad invocation increases the chance that file-modifying or decryption-related instructions are surfaced when not intended, expanding attack surface and user surprise.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The guide contains many examples that create, overwrite, encrypt, decrypt, and modify files, but it lacks a clear warning about destructive or state-changing operations. In an agent setting, that omission can lead users or higher-level systems to treat the skill as read-only when it is not.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Install system dependency (poppler)
# Ubuntu/Debian:
sudo apt-get install poppler-utils

# CentOS/RHEL:
sudo yum install poppler-utils
Confidence
90% confidence
Finding
The documentation explicitly instructs use of sudo for package installation. In agent-assisted environments, privileged execution is risky because it can change the host system outside the workspace and may be socially engineered into unnecessary elevation.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
sudo apt-get install poppler-utils

# CentOS/RHEL:
sudo yum install poppler-utils

# macOS:
brew install poppler
Confidence
90% confidence
Finding
This second privileged-install example likewise encourages elevated package management commands. Even if legitimate for setup, embedding root-level commands in a general-purpose skill increases the chance of unsafe execution on production or shared systems.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The guide includes a qpdf example for password-based decryption and password removal, which can normalize bypass-oriented behavior and enable processing of protected PDFs without sufficient consent checks. In an agent context, this is more dangerous because it could be used on sensitive documents if the agent follows the example automatically.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
This is a markdown file, so SQP-2 applies to omissions in the skill description. The section demonstrates adding and removing PDF password protection, including a concrete decryption command, but does not include any warning about only processing documents the user is authorized to decrypt or the sensitivity of exposed contents.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The markdown provides a direct example of decrypting an encrypted PDF in code, which can affect privacy and document protections. There is no accompanying warning that decrypted output or in-memory text may expose sensitive content and should only be handled with user authorization.

Missing User Warnings

Medium
Confidence
81% confidence
Finding
This code performs a file write that creates or overwrites the output PDF, which affects user data. While the script validates inputs and prints usage/errors, there is no confirmation prompt, explicit user-facing warning, or inline comment/docstring disclosing that it will write a modified PDF to the specified path.

Description-Behavior Mismatch

Low
Confidence
77% confidence
Finding
The manifest frames the skill as a PDF processing tool, but this file instructs the agent to run host-level package manager commands such as apt, yum, and brew. While these are related to enabling PDF conversion, they expand behavior from document processing into system administration, which is not stated in the manifest description.

Static analysis

No suspicious patterns detected.