T08 · Insecure Dependencies
- Location
SKILL.md:43- Finding
Unpinned Global npm Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 43–47
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumVulnerable Code
markdown If it is missing and the environment allows installs, install it with npm: ```bash npm install -g epub2mdtext ### Technical Analysis The Skill instructs users or agents to install `epub2md` globally from npm without pinning a reviewed version or verifying package integrity. Although the documentation states that behavior was validated against `epub2md 1.6.2`, the installation command retrieves whichever release the npm registry currently resolves as the latest version. npm packages may execute lifecycle scripts during installation. Consequently, a compromised package, malicious newly published release, or compromised package-maintainer account could cause attacker-controlled code to execute with the privileges of the user running npm. The global `-g` installation also increases the installation scope and makes the resulting executable available to subsequent sessions and projects. ### Attack Path 1. An attacker compromises the `epub2md` package, its maintainer account, or its release process. 2. The attacker publishes a malicious release under the legitimate package name. 3. A user or agent follows the Skill prerequisite and runs `npm install -g epub2md`. 4. npm resolves and downloads the mutable latest release rather than the documented and reviewed `1.6.2` release. 5. Malicious lifecycle scripts may execute during installation, or malicious behavior may execute when the globally installed CLI is subsequently invoked. 6. The compromised global executable can affect EPUB conversion operations performed by this Skill and other users of that command. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the account performing the installation or invoking the compromised CLI. The attacker could access or modify f ...[truncated 318 chars]- Remediation
View remediation
Remediation Suggestions
Pin installation to the explicitly reviewed version and avoid a global installation where possible:
bash npm install --save-exact epub2md@1.6.2Use a project-local dependency with a committed lockfile and invoke the local executable through
npx --no-install epub2mdor its explicitnode_modules/.binpath. Enforce lockfile integrity in deployment or installation workflows and review dependency changes before upgrades.Where compatible with the package, disable installation lifecycle scripts:
bash npm install --save-exact --ignore-scripts epub2md@1.6.2If lifecycle scripts are required, inspect them before allowing execution. In addition, run conversion under a minimally privileged account, restrict filesystem access to the required input and workspace directories, and document a controlled upgrade process that re-audits new versions before changing the pin.
