Back to skill

Security audit

pdf

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent PDF-processing skill with local, user-directed document utilities, though users should be careful with sensitive PDFs, output paths, and password-removal examples.

Install only if you are comfortable letting the agent process the PDFs you provide and create local output files. Use copies of important documents, choose unique output paths, avoid logging extracted sensitive text, and only remove PDF passwords when you are authorized to do so.

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

Note
Location
SKILL.md:213
Finding

Unpinned Third-Party Dependencies in OCR Installation Guidance

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:213-216
Vulnerability Type: Unpinned third-party package installation
Risk Level: Low

python
### Extract Text from Scanned PDFs
```python
# Requires: pip install pytesseract pdf2image
import pytesseract

Technical Analysis

The documentation instructs users or agents to install pytesseract and pdf2image without specifying exact versions or verifying package hashes. Consequently, the code retrieved at installation time can differ from the code reviewed during this audit.

The package names correspond to established projects, and the project does not use an explicitly untrusted package index or demonstrate dependency confusion. Therefore, this is a supply-chain hardening issue rather than evidence that the dependencies are currently malicious. Exploitation would require compromise of a package, maintainer account, package repository, dependency resolution path, or configured Python package index.

Attack Path

  1. An attacker compromises a referenced package release, one of its dependencies, a maintainer account, or the package index used by the environment.
  2. The attacker publishes a malicious version that satisfies the unconstrained installation command.
  3. A user or agent follows SKILL.md and runs pip install pytesseract pdf2image.
  4. pip resolves and installs the attacker-controlled release.
  5. Malicious package behavior may execute during installation or when the package is imported by the OCR workflow.

Impact Assessment

A compromised dependency could execute code with the privileges of the user running pip or the PDF-processing workflow. Potential effects include reading or modifying files accessible to that account, accessing PDF contents and environment variables, altering generated documents, and making network connections where the runtime permits them.

The project itself contains no demonstrated network retrieval, p ...[truncated 215 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin reviewed versions, for example through a version-controlled requirements file using exact == constraints.
  • Generate and verify cryptographic hashes with a hash-locked dependency workflow, such as pip install --require-hashes -r requirements.txt.
  • Lock transitive dependencies so indirect package updates cannot enter the environment without review.
  • Install dependencies in an isolated virtual environment under a non-privileged account.
  • Use a trusted, explicitly configured package index or an internally controlled package mirror.
  • Add automated dependency vulnerability and provenance scanning to the release process.
  • Periodically update pins through a reviewed process rather than allowing unconstrained installation at runtime.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code does not implement a comprehensive PDF manipulation toolkit. It is a test module for a specific helper, get_bounding_box_messages, using synthetic JSON streams to check form-field bounding box intersections, page separation behavior, font-size/height validation, and error limiting. While this is loosely adjacent to PDF form handling, the actual behavior shown is much narrower and materially different from the declared broad PDF extraction/creation/merging/splitting/form-processing functionality. No broader PDF operations are present in this chunk, so the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The code’s behavior is specific: it reads a PDF, renders each page as an image via pdf2image, resizes the images if necessary, and saves them as PNG files. The declared description presents a broad PDF toolkit centered on text/table extraction, PDF generation/manipulation, document splitting/merging, and form handling. Converting PDF pages to PNG images is a materially different capability and is not clearly represented in the description. While PDF-to-image conversion could be loosely considered 'processing' a PDF, the declared purpose does not accurately describe this script’s primary function.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guide includes examples that write output files, overwrite named artifacts, and decrypt password-protected PDFs without warning about data sensitivity, overwrite risks, or authorization requirements. In an agent setting, users may copy these patterns directly, increasing the chance of accidental data loss, insecure handling of confidential documents, or inappropriate decryption of protected files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file includes advanced encryption examples, including removing password protection with a literal password and producing a decrypted output file. Under the markdown-file criteria for missing user warnings, the description should warn that these actions handle sensitive secrets and can reduce document security, but no such warning is present near the example.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The command qpdf --replace-input corrupted.pdf alters the source PDF in place, which can affect user data or make recovery harder if the repair is unsuccessful. The markdown does not warn users to back up the original or note that the operation is destructive to the input file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file comment and function docstring say the script 'fills a PDF form', which implies writing actual AcroForm field values. However, the implementation creates FreeText annotations and attaches them to pages, leaving underlying form fields unchanged. This is an active intent/documentation mismatch, not just an omitted detail, because annotations and form-field filling have materially different behavior.

Content

No source excerpt is available for this finding.