Back to skill

Security audit

PDF to Images

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward local PDF-to-image converter, with dependency hygiene and language-localization notes but no evidence of hidden or malicious behavior.

Install only in an environment where npm dependency resolution is acceptable, and expect that canvas may need to be installed for the converter to run. Non-Chinese users may need translation of the usage text.

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

Unpinned and Incomplete Runtime Dependency Declaration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:10-12; related imports at index.js:10 and index.js:53
Vulnerability Type: Unpinned third-party dependencies and undeclared runtime dependency
Risk Level: Medium

Vulnerable Code

SKILL.md:10-12:

yaml
install:
  - kind: npm
    package: pdfjs-dist

index.js:10:

javascript
const pdfjs = require('pdfjs-dist');

index.js:53:

javascript
const { createCanvas } = require('canvas');

Technical Analysis

The installation metadata requests pdfjs-dist without specifying a reviewed version or integrity constraint. The project also contains no package manifest or lockfile in the audited directory. Consequently, installation can resolve whichever package version is current in the configured npm registry rather than a reproducible, audited dependency version.

The executable additionally loads the canvas package at runtime, but canvas is absent from the installation metadata. This incomplete declaration can cause execution to fail. It may also lead operators or automated agents to install an arbitrary current version manually without a lockfile or integrity verification.

Both dependencies execute code within the Node.js process and therefore inherit the privileges of the user running the skill. In particular, loading a compromised package can execute malicious package initialization code before normal PDF conversion completes.

Attack Path

  1. A user or agent installs the skill using the supplied installation metadata.
  2. The package manager resolves an unspecified current version of pdfjs-dist from the configured npm registry.
  3. If the resolved release or registry source has been compromised, its installation or module-loading code executes with the invoking user's privileges.
  4. When the skill processes a PDF, Node.js loads pdfjs-dist through require(), activating the compromised dependency.
  5. Exec ...[truncated 1066 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a package.json that explicitly declares reviewed versions of both pdfjs-dist and canvas.
  2. Generate and commit a lockfile, such as package-lock.json, containing exact resolved versions and integrity hashes.
  3. Configure skill installation to use the locked dependency tree rather than resolving mutable latest releases.
  4. Use npm ci in automated installation workflows so dependency resolution fails if the manifest and lockfile differ.
  5. Restrict installations to the official, trusted npm registry and prevent unapproved registry overrides.
  6. Review dependency provenance, release history, transitive dependencies, and known vulnerability advisories before pinning versions.
  7. Run the converter in a sandbox with minimal filesystem access, no unnecessary credentials, and restricted network access to reduce the impact of a compromised package.
  8. Add automated dependency scanning and controlled update reviews so pinned versions can receive security updates without silently changing during installation.
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 (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file description at L005 and the CLI/user-facing messages throughout the script are written in Chinese, which effectively imposes a specific language on users. The file does not offer an opt-in choice of language or explain that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and the main usage documentation are written in Chinese, while there is no indication that the skill is intentionally region-specific or that users can choose another language. This can violate a language/locale policy requiring neutral language support or explicit opt-in for a specific locale.

Content

No source excerpt is available for this finding.