T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:35
- Finding
- Unpinned Global npm Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 35–39 **Vulnerability Type**: Unpinned third-party package installed globally **Risk Level**: Medium **Complete Code Snippet**: ```markdown ## Installation ```bash npm install -g mineru-open-api ``` ``` ### Technical Analysis The installation instructions retrieve and globally install the latest available release of `mineru-open-api`. No exact version, lockfile, package integrity hash, or verified source reference is specified. Consequently, the code installed and executed can change after the Skill has been reviewed. npm packages may execute lifecycle scripts during installation. If the package, one of its transitive dependencies, or its publisher account is compromised, malicious installation code could execute with the privileges of the user running npm. Global installation also increases exposure by making the executable available outside an isolated project environment. The repository does not establish that `mineru-open-api` is currently malicious. The vulnerability is the unsafe, mutable dependency installation process and the resulting supply-chain exposure. ### Attack Path 1. An attacker compromises the npm package, a transitive dependency, or a relevant publisher account, or causes a malicious release to become the version resolved by npm. 2. A user follows the Skill instructions and runs `npm install -g mineru-open-api`. 3. npm retrieves the mutable latest package and its dependency tree without a repository-provided lockfile or integrity verification. 4. Malicious package code can execute through npm lifecycle scripts during installation or when the installed CLI is invoked. 5. The malicious code operates with the invoking user's permissions and can access resources available to that user, including documents supplied for conversion. ### Impact Assessment Successful exploitation could permit arbitrary code execution with the privileges ...[truncated 500 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `mineru-open-api` to an exact, reviewed version rather than resolving the mutable latest release: ```bash npm install --save-exact mineru-open-api@<reviewed-version> ``` 2. Prefer a project-local installation over `npm install -g`, and invoke the binary from the local dependency environment. 3. Commit and enforce a lockfile so the complete transitive dependency graph and integrity metadata remain reproducible. 4. Document the package's official registry location and verify its publisher, provenance, signatures, and integrity before installation. 5. Review package lifecycle scripts and use `--ignore-scripts` when they are unnecessary and compatibility has been validated. 6. Run the converter in a sandbox or container with network, filesystem, and credential access restricted to the selected input PDF and designated output directory. 7. Perform dependency and malware scanning before approving version updates. Update pinned versions only through a controlled review process. 8. Warn users not to execute global npm installation with `sudo` or another elevated account.
