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**: Unpinned third-party package installed globally from an external registry **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 version of `mineru-open-api` from the configured npm registry without an exact version pin, lockfile, cryptographic integrity value, or documented provenance verification. Because the dependency's implementation is not included in the project, its effective behavior can change independently after this Skill has been reviewed. npm packages may also execute lifecycle scripts during installation. The global `-g` installation expands the potential effect by placing the executable and related package files in the user's global npm environment. This does not prove that the referenced package is currently malicious. It creates a supply-chain exposure in which a compromised publisher account, malicious future release, dependency compromise, registry substitution, or similarly unsafe package source could cause attacker-controlled code to execute. ### Attack Path 1. An attacker compromises the package publisher, a transitive dependency, the package distribution path, or a future package release. 2. The attacker publishes a malicious version under the package name referenced by the Skill. 3. A user follows the documented command without specifying a reviewed version. 4. npm resolves and downloads the attacker-controlled release from the configured registry. 5. Malicious lifecycle scripts may execute during installation, or malicious code may execute when the installed `mineru-open-api` command is later invoked. 6. The payload runs with the privileges and environment access of the user performing the installation or OCR operation. ### Impact Assessme ...[truncated 609 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an exact version that has been independently reviewed, rather than resolving the latest release: ```bash npm install --save-exact mineru-open-api@<reviewed-version> ``` 2. Prefer a project-local installation instead of `-g`, and invoke it through a controlled local package script or an explicitly resolved binary path. 3. Commit and enforce a lockfile so that both direct and transitive dependency versions remain reproducible. 4. Verify package provenance, publisher identity, repository ownership, signatures or attestations, and registry integrity metadata before installation. 5. Review package lifecycle scripts and consider installing with `--ignore-scripts` where the package can function without them. 6. Run the OCR utility in a sandbox or container with minimum filesystem and network access, especially when processing sensitive documents. 7. Establish an update process in which each new package version and dependency-tree change is reviewed before the pinned version is advanced.
