Back to skill

Security audit

pdf-nano

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a PDF helper, but one form-filling path can silently make persistent host font/configuration changes from workspace-adjacent files.

Review carefully before installing. Use this only in an isolated workspace or container, avoid running annotation-based form filling on untrusted PDFs or directories, inspect any nearby assets/fonts folder first, and work on copies of sensitive PDFs. Do not let the skill silently change font directories, renderer policy, ownership, or caches; require explicit approval for any persistent environment change.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/fill_pdf_form_with_annotations.py:13
Finding

Untrusted Fonts Are Persistently Installed into User or System Font Directories

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
forms.md:302
Finding

Skill Instructions Encourage Silent Modification of Shared Runtime and Security State

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:235
Finding

OCR Setup Recommends Unpinned Package Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is a clear mismatch. The declared description says the skill should be used for essentially any PDF-related task. However, the supplied code only loads a JSON structure with form_fields, inspects label_bounding_box and entry_bounding_box coordinates, checks rectangle intersections on the same page, validates entry box height against font size, and emits success/failure messages. There is no PDF parsing, rendering, text extraction, table extraction, merging, splitting, form filling into PDFs, OCR, encryption, or any other direct PDF operation. The actual code’s purpose is specialized QA/validation for form field layout metadata, not a general PDF utility.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as a general-purpose PDF toolkit covering numerous operations such as text extraction, merging, splitting, OCR, form filling, and encryption. The supplied code, however, only renders PDF pages to PNG images and saves them. While this is PDF-related, it is not explicitly one of the described capabilities except loosely adjacent to 'extracting images,' which usually means pulling embedded images from a PDF rather than rasterizing pages. The primary purpose of the code is materially narrower and different from the declared broad functionality, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad PDF-processing skill, but the actual code chunk performs a narrow image-annotation task: it reads field metadata from JSON and overlays bounding boxes onto an image for validation. It does not read, modify, generate, merge, split, OCR, encrypt, or otherwise process PDF files in this chunk. Its primary purpose is materially different from the declared PDF utility description, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents this as an all-purpose PDF skill, triggered whenever the user wants to do anything with PDFs. The supplied code chunk has a much narrower purpose: it inspects PDF form annotations using pypdf and exports form field metadata to JSON. It does not implement the broad set of PDF operations claimed in the description. While the code does operate on PDFs, its actual behavior is materially narrower and specifically focused on form-field introspection, which is not clearly represented in the description. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises a broad PDF toolkit usable for essentially anything involving PDFs. The supplied code, however, has a much narrower and materially different purpose: it inspects a non-fillable PDF using pdfplumber to identify text labels and geometric elements relevant to reconstructing form fields, then saves those coordinates as JSON. While this loosely falls under PDF text extraction/analysis, it does not implement most of the declared capabilities and its primary purpose is specialized form-structure extraction rather than general PDF handling. This is a description/behavior mismatch due to the materially narrower 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 rule says to use this skill whenever the user wants to do anything with PDFs or even merely mentions a .pdf file, which is excessively broad. In an agent system, that can cause the skill to be selected in irrelevant or sensitive contexts, increasing the chance of unintended file access, shell execution, or incorrect handling of protected documents.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill provides Python and shell examples that imply file read/write and shell execution capability, but it does not declare any explicit tool scope such as permissions or allowed-tools. In an agent environment, that ambiguity can lead to over-privileged invocation or unsafe assumptions about what the skill is authorized to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide includes a qpdf example for removing a password and decrypting a PDF but provides no warning about authorization, ownership, or protected-document handling. In a skill meant for agent use, this can normalize bypass-style workflows and encourage processing of encrypted documents without verifying the user is permitted to do so.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section broadens the skill from PDF form filling into runtime remediation and system configuration, including machine-visible font registration, cache/index refresh, ownership normalization, and renderer configuration changes. In an agent setting, such instructions can induce privileged or persistent environmental modifications that exceed the user's task and create opportunities for unintended system impact.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The recovery guidance expands a PDF-processing skill into host-level environment maintenance by suggesting actions like rebuilding font state, reconciling shared font indexes, adjusting cache ownership, and registering fonts in machine-visible locations. These are system configuration changes unrelated to ordinary document handling and could modify shared runtime state, weaken isolation boundaries, or create persistence on the host if followed by an agent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction to keep recovery actions silent unless a retry fails suppresses user visibility into environment-changing behavior. Concealing retries that may rebuild caches, modify font state, or alter machine-visible configuration undermines informed consent and makes unauthorized system changes harder to detect or audit.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown reference includes many examples that save new files, extract text/images from PDFs, decrypt documents, and even replace input files in place, but the document contains no user-facing warning about possible data exposure, overwrites, or irreversible changes. Under the markdown-specific SQP-2 criterion, the skill description should disclose behaviors that can affect user data, privacy, or system integrity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes reading/extracting content from PDFs, merging/splitting, rotating, watermarking, creating/filling/encrypting PDFs, extracting images from PDFs, and OCR. This script instead renders each PDF page into new PNG image files, which is a distinct PDF-to-image conversion capability not stated in the manifest description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

This PDF helper copies .ttf/.otf files from assets/fonts near the input path or current working directory into user or system font directories, then refreshes font caches. In the context of a form-filling skill, that behavior is unnecessary and dangerous because untrusted PDFs placed alongside attacker-controlled font assets can cause host font installation and persistent modification of the runtime environment beyond the requested document operation.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The script executes an external binary (fc-cache) after copying fonts into writable font directories under the user's home or system font paths. Although it does not invoke a shell, this is still risky behavior for a PDF form-filling utility because it expands scope from document processing into host environment modification and command execution, increasing attack surface and enabling persistence-like side effects if untrusted font assets are present.

Content

Scanner excerpt · scripts/fill_pdf_form_with_annotations.py (reported line 78)May include surrounding context.

python
if cmd:
            try:
                import subprocess
                subprocess.run([cmd, "-f", str(target_dir)], check=False)
                break
            except Exception:
                pass

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file instructs the user to generate filled PDFs and intermediate JSON files containing form field values, which may include sensitive personal information. The instructions explain how to perform the operation but do not warn that these artifacts will store user data on disk or should be handled carefully.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.