Back to skill

Security audit

image-to-pdf

Security checks for vulnerabilities and agentic risk

Overview

This PDF-processing skill is mostly coherent, but it can automatically send sensitive accounting documents to Telegram after broad PDF triggers without a clear per-run confirmation step.

Review this skill before installing if you process private vouchers, invoices, loan documents, or other business records. Use it only when you are comfortable with the generated PDF and summary being sent through Telegram, and require a visible confirmation of recipient, filenames, and message text before any send action. Also sanitize spreadsheet-derived filenames and pin dependencies before operational use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:7
Finding

Unpinned Third-Party Dependencies from Mutable Package Registries

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 7-12
Vulnerability Type: Supply-chain exposure through unpinned dependencies
Risk Level: Medium

Vulnerable Code

bash
# Python
pip3 install Pillow pypdf openpyxl

# System tools
brew install poppler tesseract tesseract-lang

Technical Analysis

The skill instructs users or agents to install third-party Python packages and system tools without specifying reviewed versions, package hashes, a lockfile, or trusted repository constraints. Consequently, the software installed when the command is executed can differ from the software that existed when the skill was audited.

Package installation may execute package-controlled build or installation logic with the privileges of the invoking account. The absence of version and integrity constraints increases exposure to compromised releases, malicious dependency substitution, and unexpected upstream changes. No direct evidence indicates that the named packages are malicious; the vulnerability is the unsafe and non-reproducible dependency installation process.

Attack Path

  1. An attacker compromises an upstream dependency, package distribution account, or package source used by the local package manager.
  2. A user or agent follows the skill instructions and runs the unpinned installation command.
  3. The package manager resolves the dependency to the attacker-controlled or compromised release.
  4. Malicious installation or runtime code executes in the environment.
  5. The payload obtains the permissions of the account running the installation and can access data available to that account.

Impact Assessment

Successful exploitation could permit arbitrary code execution with the privileges of the installing user. Depending on the execution environment, exposed assets may include uploaded documents, generated PDFs, OCR output, spreadsheets, environment variables, user files, and credentials ac ...[truncated 177 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin every Python and system dependency to a reviewed version.
  • Maintain a lockfile containing cryptographic hashes for Python packages, and install with hash verification enabled.
  • Restrict package retrieval to explicitly trusted repositories and disable unintended supplemental indexes.
  • Install Python dependencies inside a dedicated virtual environment or isolated container.
  • Document supported operating-system package versions and verify downloaded artifacts where the package manager supports integrity controls.
  • Run dependency vulnerability and provenance checks during release preparation.
  • Avoid installing packages automatically when the skill is invoked; provision and review dependencies separately.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:93
Finding

Unsanitized Spreadsheet Values Used to Construct a Destination File Path

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 93-105
Vulnerability Type: Path manipulation and unintended file overwrite
Risk Level: Medium

Vulnerable Code

python
desc = ws[f'H{excel_row}'].value
ship = ws[f'M{excel_row}'].value

date_match = re.search(r'(\d+月\d+号)', filename)
date_part = date_match.group(1) if date_match else ""

new_name = f"{idx:02d}_{date_part}-【{ship}】{desc}.pdf"

src = os.path.join(inbound_dir, filename)
dst = os.path.join(output_dir, new_name)
shutil.copy(src, dst)

Technical Analysis

Values read from spreadsheet columns H and M are inserted directly into new_name. The resulting value is passed to os.path.join and then used as the destination of shutil.copy without filename sanitization, canonicalization, or verification that the resolved destination remains inside output_dir.

Spreadsheet cells can contain path separators and traversal components. Although the document later states that special filename characters should be cleaned, the supplied implementation does not perform that cleaning. A crafted value can therefore alter the path structure, target nested paths, or potentially escape the intended output directory when the necessary intermediate path components exist.

The fixed filename prefix makes straightforward absolute-path replacement less direct, but it does not establish a security boundary. Separator injection and traversal remain possible under suitable filesystem conditions. Existing files at the resolved destination can also be overwritten by shutil.copy.

Attack Path

  1. An attacker supplies or modifies the workbook used by the skill.
  2. The attacker places path separators and traversal components in a column H or M cell associated with a processed index.
  3. The skill reads the malicious cell into desc or ship.
  4. The value is interpolated into new_name without validation.
  5. os.path.join constructs a path who ...[truncated 710 chars]
Remediation
View remediation

Remediation Suggestions

  • Treat all workbook values as untrusted input.
  • Convert cell values to strings only after checking for None and unexpected data types.
  • Replace path separators, control characters, traversal sequences, and operating-system-reserved characters with safe delimiters.
  • Apply a strict allowlist for filename characters and enforce a maximum filename length.
  • Resolve both the output directory and destination to canonical paths before writing.
  • Verify that the canonical destination is a child of the canonical output directory.
  • Reject the operation if containment validation fails rather than attempting to repair an ambiguous path.
  • Prevent unintended overwrites by using exclusive creation, generating a unique filename, or requiring explicit confirmation when the destination exists.
  • A hardened implementation should include containment validation similar to:
python
from pathlib import Path
import re

def safe_component(value):
    value = "" if value is None else str(value)
    value = re.sub(r'[^\w .()\-]', '_', value, flags=re.UNICODE)
    value = value.replace('..', '_').strip(' .')
    return value[:100] or 'unknown'

output_root = Path(output_dir).resolve()
safe_ship = safe_component(ship)
safe_desc = safe_component(desc)
safe_name = f"{idx:02d}_{safe_component(date_part)}-{safe_ship}-{safe_desc}.pdf"
destination = (output_root / safe_name).resolve()

if destination.parent != output_root:
    raise ValueError("Destination escapes the output directory")
if destination.exists():
    raise FileExistsError(destination)

shutil.copy(src, destination)
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill description is presented entirely in Chinese and does not offer any language or locale choice to the user. Under the stated policy, language constraints should either be optional for the user or clearly documented as region-specific and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to activate on generic requests such as generating or merging PDFs, including cases unrelated to this specific workflow. Overbroad activation is dangerous here because the skill also performs file handling, OCR, renaming, and outbound sending, so accidental invocation could process or disclose documents the user did not intend to route through this skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill automatically sends generated files and metadata to Telegram, which expands its behavior from local document processing into external data exfiltration. Because the documents may contain sensitive financial or identity information, automatic transmission without an explicit confirmation step creates a real confidentiality risk if triggered unintentionally or directed to the wrong recipient.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill lacks a clear warning that it may automatically send generated files and descriptive text to Telegram, creating a consent and privacy failure. In the context of accounting vouchers, scanned PDFs, and OCR-derived summaries, silent outbound delivery can expose sensitive business data to unintended parties.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The OCR flow invokes external shell tools and provides a bash script, increasing the skill's operational scope and attack surface beyond simple in-process file conversion. While OCR legitimately needs helper binaries, command execution on user-supplied files and paths can become dangerous if paths, filenames, or later script edits are not tightly controlled.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.