Back to skill

Security audit

nano-banana-pdf-edit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent PDF editing helper, but it can send PDF page images and full document text to Google Gemini under broad auto-trigger rules and relies on unpinned executable dependencies.

Install only if you are comfortable sending the relevant PDF pages, and sometimes full document text, to Google Gemini. Avoid confidential, regulated, or customer documents unless your data policy allows that use. Prefer a reviewed, pinned nano-pdf version in an isolated environment with only the target PDF and GEMINI_API_KEY available, and require explicit approval before any dependency installation or external processing.

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:27
Finding

Unpinned Third-Party Package Installation and Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:27
Additional Location: README.md:34
Vulnerability Type: Unpinned executable dependency
Risk Level: Medium

Vulnerable Code Snippet

From SKILL.md:27:

markdown
1. **nano-pdf** — `pip install nano-pdf` (or use `uvx nano-pdf` to run without installing)

The same unsafe installation guidance appears in README.md:34:

markdown
- **nano-pdf**: `pip install nano-pdf`

Technical Analysis

The skill instructs the agent to retrieve and execute the nano-pdf package without specifying an exact version, cryptographic hash, lockfile, or verified distribution source. Both pip install nano-pdf and uvx nano-pdf may resolve to the latest package available from the configured Python package index.

Because the repository does not contain the implementation of this dependency, the behavior executed at runtime is not fixed to the version reviewed during this audit. A compromised package release, package-index account, dependency, or configured package mirror could therefore introduce arbitrary code after the skill itself has been reviewed.

The risk is amplified by the dependency's intended access to:

  • User-provided PDF documents.
  • Generated and temporary document content.
  • The GEMINI_API_KEY environment variable.
  • Files and resources accessible to the user running the agent.

No evidence establishes that the current nano-pdf package is malicious. The confirmed issue is the unsafe, unpinned dependency acquisition and execution process.

Attack Path

  1. An attacker compromises the package publisher, a transitive dependency, the configured package index, or a package mirror.
  2. The attacker publishes or serves a malicious version under the expected package name.
  3. The agent follows the skill instructions and executes pip install nano-pdf or uvx nano-pdf.
  4. The package manager retrieves the attacker-controlled release because no exact version or integrity hash is ...[truncated 1202 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin nano-pdf to an exact version that has been reviewed:

    bash
    python3 -m pip install "nano-pdf==<audited-version>"
    
  2. Require package integrity verification using hashes in a requirements file:

    text
    nano-pdf==<audited-version> --hash=sha256:<verified-hash>
    

    Install it with:

    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Pin and verify all transitive dependencies through a generated lockfile rather than only constraining the top-level package.

  4. Document the canonical package registry, project repository, expected publisher, and verified package digest so that similarly named or substituted packages can be detected.

  5. Do not automatically install missing dependencies. Request explicit user approval and display the exact package version and source before installation.

  6. Run the package in a restricted environment with:

    • A dedicated virtual environment or isolated container.
    • Access only to the PDF files required for the operation.
    • No unrelated credentials in the process environment.
    • Restricted filesystem permissions.
    • Network access limited to required service endpoints.
  7. Update both SKILL.md and README.md so they provide identical pinned and integrity-checked installation instructions.

  8. Establish a controlled dependency-update process in which new versions are reviewed, tested, and assigned new verified hashes before the documented pin is changed.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README explicitly describes sending rendered PDF page images and optional reference pages to Gemini, but it does not pair that with a clear privacy warning or consent requirement. Because PDFs often contain confidential business, legal, or personal information, silent transmission to a third-party AI provider creates a significant data exposure risk.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger description is extremely broad, causing the skill to activate for many generic PDF or slide-editing requests. Over-broad activation increases the chance that sensitive documents are routed into this workflow unnecessarily, especially since the workflow sends page images and possibly document text to an external AI service.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill does not clearly warn users that PDF content is transmitted to Google's Gemini service for processing, and the documented --use-context option may send full PDF text as model context. This is a significant privacy and data-handling issue because users may provide confidential decks, reports, or regulated documents without informed consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README says the skill 'triggers automatically' whenever the agent detects a desire to visually edit a PDF, and the metadata description is similarly broad. In an agentic context, vague activation boundaries can cause the skill to run in situations the user did not clearly intend, leading to unintended file modification attempts, dependency installation prompts, or external model usage.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The skill recommends running uvx nano-pdf without pinning a specific version, which makes execution depend on whatever package version is current at runtime. That creates a supply-chain risk: a compromised or breaking upstream release could be pulled automatically and executed in the user's environment.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 39)May include surrounding context.

md
Before running any nano-pdf command, ensure the following dependencies are installed. If any are missing, install them before proceeding:

1. **nano-pdf** — `pip install nano-pdf` (or use `uvx nano-pdf` to run without installing)
2. **poppler** — PDF-to-image rendering (`brew install poppler` on macOS / `sudo apt-get install poppler-utils` on Linux)
3. **tesseract** — OCR for text layer restoration (`brew install tesseract` on macOS / `sudo apt-get install tesseract-ocr` on Linux)
4. **GEMINI_API_KEY** — A **paid** Google Gemini API key (free tier does not support image generation). Get one at https://aistudio.google.com/api-keys — then `export GEMINI_API_KEY="your_key"`

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 40)May include surrounding context.

md
Before running any nano-pdf command, ensure the following dependencies are installed. If any are missing, install them before proceeding:

1. **nano-pdf** — `pip install nano-pdf` (or use `uvx nano-pdf` to run without installing)
2. **poppler** — PDF-to-image rendering (`brew install poppler` on macOS / `sudo apt-get install poppler-utils` on Linux)
3. **tesseract** — OCR for text layer restoration (`brew install tesseract` on macOS / `sudo apt-get install tesseract-ocr` on Linux)
4. **GEMINI_API_KEY** — A **paid** Google Gemini API key (free tier does not support image generation). Get one at https://aistudio.google.com/api-keys — then `export GEMINI_API_KEY="your_key"`

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
Before running any nano-pdf command, ensure the following dependencies are installed. If any are missing, install them before proceeding:

1. **nano-pdf** — `pip install nano-pdf` (or use `uvx nano-pdf` to run without installing)
2. **poppler** — PDF-to-image rendering (`brew install poppler` on macOS / `sudo apt-get install poppler-utils` on Linux)
3. **tesseract** — OCR for text layer restoration (`brew install tesseract` on macOS / `sudo apt-get install tesseract-ocr` on Linux)
4. **GEMINI_API_KEY** — A **paid** Google Gemini API key (free tier does not support image generation). Get one at https://aistudio.google.com/api-keys — then `export GEMINI_API_KEY="your_key"`

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
Before running any nano-pdf command, ensure the following dependencies are installed. If any are missing, install them before proceeding:

1. **nano-pdf** — `pip install nano-pdf` (or use `uvx nano-pdf` to run without installing)
2. **poppler** — PDF-to-image rendering (`brew install poppler` on macOS / `sudo apt-get install poppler-utils` on Linux)
3. **tesseract** — OCR for text layer restoration (`brew install tesseract` on macOS / `sudo apt-get install tesseract-ocr` on Linux)
4. **GEMINI_API_KEY** — A **paid** Google Gemini API key (free tier does not support image generation). Get one at https://aistudio.google.com/api-keys — then `export GEMINI_API_KEY="your_key"`

Static analysis

No suspicious patterns detected.