T08 · Insecure Dependencies
- Location
rules/install.md:14- Finding
Unpinned Third-Party npm Package Is Downloaded and Executed Automatically
- Content
View full analysis
Vulnerability Details
File Location:
rules/install.md:14-17,rules/install.md:21-32,rules/install.md:97-101,rules/security.md:19-23, andSKILL.md:7-10
Vulnerability Type: Unpinned dependency execution and software supply-chain exposure
Risk Level: MediumVulnerable Code
rules/install.md:14-17:bash ## Quick setup ```bash npx -y pdf2markdown-cli init -ytext `rules/install.md:21-32`: ```bash ## Manual install Choose by package manager: ```bash # npm (default) npm install -g pdf2markdown-cli # pnpm pnpm add -g pdf2markdown-cli # yarn yarn global add pdf2markdown-clitext `rules/install.md:97-101`: ```bash 1. Check npm global bin is in PATH: `npm bin -g` 2. Use npx: `npx pdf2markdown-cli --version` 3. Reinstall: `npm install -g pdf2markdown-cli`rules/security.md:19-23:bash # Installation ```bash npm install -g pdf2markdown-clitext `SKILL.md:7-10`: ```yaml allowed-tools: - Bash(pdf2markdown *) - Bash(pdf2md *) - Bash(npx pdf2markdown *) - Bash(npx pdf2md *)Technical Analysis
The installation instructions execute
pdf2markdown-cliwithout pinning an exact reviewed version or verifying package integrity. In particular,npx -y pdf2markdown-cli init -ycan retrieve the package version currently resolved by the npm registry and execute its lifecycle and initialization code without an interactive confirmation step.The documented initialization operation has broader effects than a one-time document conversion because it installs skills and configures authentication. The global installation alternatives similarly place an unpinned third-party executable in the user's command search path. Subsequent commands permitted by
SKILL.mdcan then invoke that installed executable.No evidence was found that the referenced package is currently malicious. The vulnerability is the unsafe tru ...[truncated 1950 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to an exact reviewed version in every installation and execution example, such as
pdf2markdown-cli@X.Y.Z; do not use floating tags or version ranges. - Commit a lockfile where the deployment model permits it and validate npm integrity metadata before execution.
- Replace automatic
npx -ysetup with a reviewable installation process that requires explicit user confirmation before downloading code, configuring authentication, or installing additional skills. - Separate CLI installation, authentication, and agent-skill installation into distinct opt-in steps. Clearly disclose the files and directories modified by each step.
- Run the package with the minimum necessary privileges. Do not recommend administrator or root execution for global installation.
- Prefer a locally installed, locked dependency invoked through a package script over an unpinned global executable.
- Review and pin transitive dependencies, monitor package ownership and release changes, and use automated dependency scanning or provenance verification where available.
- Restrict allowed command patterns to the pinned and reviewed invocation. Avoid broad
npxallowances that can retrieve mutable code at runtime. - Document package checksums, supported trusted versions, and a controlled upgrade procedure requiring security review before changing the pinned version.
- Pin the CLI to an exact reviewed version in every installation and execution example, such as
