T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:34
- Finding
- Unpinned Global npm Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, lines 34–38 **Vulnerability Type**: Supply-chain exposure through an unpinned globally installed dependency **Risk Level**: Medium ### Vulnerable Code ```markdown ## Installation ```bash npm install -g mineru-open-api ``` ``` ### Technical Analysis The installation instructions retrieve and globally install the latest available version of `mineru-open-api` without an exact version, lockfile, integrity hash, or publisher verification. Consequently, the code installed when users follow these instructions can change after the Skill has been reviewed. npm packages may execute lifecycle scripts during installation. If the package's registry account, publication process, or dependency chain is compromised, a malicious release could execute code with the privileges of the user running npm. The global `-g` installation increases exposure by placing the package in a shared tool location rather than isolating it to the project. This finding establishes an insecure dependency-installation practice; it does not establish that the current `mineru-open-api` package is malicious. ### Attack Path 1. An attacker compromises the package publisher, publication pipeline, or a relevant dependency and causes a malicious version to become the version resolved by npm. 2. A user follows the Skill's documented command, `npm install -g mineru-open-api`. 3. npm downloads the mutable package release and its transitive dependencies without validating them against a repository-controlled lockfile or expected integrity value. 4. Malicious package code can run through npm lifecycle scripts during installation or when the installed CLI is subsequently invoked. 5. The payload executes under the installing user's account and may modify user-accessible files, credentials, configuration, or globally installed tooling. ### Impact Assessment Successful exploitation could provide arbitrary cod ...[truncated 552 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `mineru-open-api` to a reviewed exact version rather than resolving the latest release: ```bash npm install --save-exact mineru-open-api@<reviewed-version> ``` 2. Prefer a project-local installation over `-g` so the dependency is isolated and recorded in project metadata. 3. Commit `package.json` and `package-lock.json`, then use `npm ci` to enforce locked versions and integrity metadata. 4. Verify the package's registry namespace, publisher ownership, provenance, release history, and transitive dependency tree before adoption. 5. Where compatible with the package, disable npm lifecycle scripts during installation: ```bash npm ci --ignore-scripts ``` 6. Execute document conversion in a sandbox or container with minimal filesystem access, no unnecessary credentials, and restricted network access. 7. Establish a controlled update process that reviews and tests new versions before changing the pin.
