T08 · Insecure Dependencies
- Location
package.json:5- Finding
Unpinned Third-Party Dependency Without a Lockfile
- Content
View full analysis
Vulnerability Details
File Location:
package.json:5-8
Vulnerability Type: Supply-chain exposure through mutable dependency resolution
Risk Level: MediumVulnerable Code
json "main": "index.js", "dependencies": { "word-extractor": "^1.0.0" },The project does not include a package lockfile. In addition,
SKILL.md:68-76instructs users to run a generalnpm installcommand:markdown ## Installation ```bash cd docx-footnote-reader npm installtext ### Technical Analysis The caret version constraint `^1.0.0` allows npm to install compatible releases newer than the version originally reviewed. Because no `package-lock.json` is present, direct and transitive package versions are resolved dynamically during installation rather than being restricted to an audited dependency graph. This does not demonstrate that the current `word-extractor` package is malicious. However, it creates a supply-chain weakness: a future compromised, malicious, or unexpectedly changed release satisfying the declared range could be installed without any change to this repository. npm dependencies may execute lifecycle scripts during installation and subsequently run with the privileges of the user invoking this skill. The dependency also receives the path of, and parses, potentially sensitive Word documents at `index.js:9-10`. ### Attack Path 1. An attacker compromises the publishing account or release pipeline for `word-extractor` or one of its transitive dependencies. 2. The attacker publishes a modified release that remains compatible with the `^1.0.0` range. 3. A user follows the documented installation procedure and runs `npm install`. 4. With no lockfile to preserve reviewed versions and integrity hashes, npm resolves the attacker-controlled release. 5. Malicious code can execute through an npm lifecycle script during installation or when `require('word-extractor')` loads the dependency. ...[truncated 836 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
word-extractorto a specifically reviewed version rather than a mutable caret range. - Generate and commit a
package-lock.jsoncontaining the complete resolved dependency graph and integrity hashes. - Update installation documentation to require
npm ciinstead ofnpm installfor reproducible installations. - Review direct and transitive dependencies, including their npm lifecycle scripts, before approving the lockfile.
- Use automated dependency monitoring and review lockfile changes before merging dependency updates.
- Run installation and document processing under a dedicated, unprivileged account or sandbox with only the required file access.
- Where operationally feasible, disable lifecycle scripts during installation with
npm ci --ignore-scripts, after confirming that the dependency does not legitimately require them.
- Pin
