Back to skill

Security audit

habib-pdf-to-json

Security checks for vulnerabilities and agentic risk

Overview

This skill provides local PDF extraction examples that match its stated purpose, with ordinary setup and file-output risks users should manage.

Install dependencies in a virtual environment, consider pinning package versions, and write outputs only to approved directories. Treat extracted Excel, CSV, JSON, and text files as potentially sensitive project data and delete, restrict, or encrypt them when no longer needed.

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:37
Finding
Unpinned Third-Party Dependencies Allow Supply-Chain Compromise## Vulnerability Details **File Location**: `SKILL.md`, lines 37–48 **Vulnerability Type**: Unpinned and integrity-unverified third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash # Core libraries pip install pdfplumber pandas openpyxl # For scanned PDFs (OCR) pip install pytesseract pdf2image # Also install Tesseract OCR: https://github.com/tesseract-ocr/tesseract # For advanced PDF operations pip install pypdf ``` ### Technical Analysis The installation instructions retrieve third-party Python packages without fixed versions, cryptographic hashes, a lockfile, or an explicitly trusted package index. Consequently, installation resolves whichever package versions and transitive dependencies are available from the configured index at execution time. Python packages may execute installation hooks or run code when imported. If a package release, maintainer account, package index, or transitive dependency is compromised, following these instructions could introduce attacker-controlled code. The absence of version and hash verification also makes installations non-reproducible and prevents users from confirming that installed artifacts match versions reviewed by the project. ### Attack Path 1. An attacker compromises a listed dependency, one of its transitive dependencies, or the package repository from which it is resolved. 2. The attacker publishes a malicious package version or replaces an expected distribution artifact. 3. A user or agent follows the documented unpinned `pip install` commands. 4. `pip` resolves and downloads the attacker-controlled release because no approved version or artifact hash is required. 5. Malicious code executes during installation or when the dependency is imported by a PDF-processing example. 6. The payload operates with the privileges and environmental access of the user running Python. ### Impact Assessment Successful exploitation could permit arbitra ...[truncated 474 chars]
Remediation
## Remediation Suggestions 1. Pin every direct dependency to a reviewed version rather than allowing unconstrained resolution. 2. Generate and distribute a lockfile that also fixes transitive dependency versions. 3. Record cryptographic hashes for all approved distributions and install with `pip install --require-hashes`. 4. Configure an explicit trusted package index or an internally controlled dependency mirror. 5. Install dependencies in an isolated virtual environment with least privilege; do not run installation commands as an administrator or root user. 6. Add automated dependency vulnerability and provenance scanning to the release process. 7. Review and update pinned versions through a controlled process that tests the complete PDF and OCR workflow before publication.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill repeatedly instructs users to write extracted PDF contents directly to local files such as .xlsx, .csv, .json, and .txt without any warning that source documents may contain sensitive project, commercial, or personal data. In a construction-document context, this increases the risk of unintended persistent storage, data sprawl, and later exposure through shared workstations, synced folders, backups, or source repositories.

Static analysis

No suspicious patterns detected.