T08 · Insecure Dependencies
- 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 atindex.js:10andindex.js:53
Vulnerability Type: Unpinned third-party dependencies and undeclared runtime dependency
Risk Level: MediumVulnerable Code
SKILL.md:10-12:yaml install: - kind: npm package: pdfjs-distindex.js:10:javascript const pdfjs = require('pdfjs-dist');index.js:53:javascript const { createCanvas } = require('canvas');Technical Analysis
The installation metadata requests
pdfjs-distwithout 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
canvaspackage at runtime, butcanvasis 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
- A user or agent installs the skill using the supplied installation metadata.
- The package manager resolves an unspecified current version of
pdfjs-distfrom the configured npm registry. - If the resolved release or registry source has been compromised, its installation or module-loading code executes with the invoking user's privileges.
- When the skill processes a PDF, Node.js loads
pdfjs-distthroughrequire(), activating the compromised dependency. - Exec ...[truncated 1066 chars]
- Remediation
View remediation
Remediation Suggestions
- Add a
package.jsonthat explicitly declares reviewed versions of bothpdfjs-distandcanvas. - Generate and commit a lockfile, such as
package-lock.json, containing exact resolved versions and integrity hashes. - Configure skill installation to use the locked dependency tree rather than resolving mutable latest releases.
- Use
npm ciin automated installation workflows so dependency resolution fails if the manifest and lockfile differ. - Restrict installations to the official, trusted npm registry and prevent unapproved registry overrides.
- Review dependency provenance, release history, transitive dependencies, and known vulnerability advisories before pinning versions.
- 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.
- Add automated dependency scanning and controlled update reviews so pinned versions can receive security updates without silently changing during installation.
- Add a
