T08 · Insecure Dependencies
- Location
- package.json:31
- Finding
- Unpinned Globally Installed Dependency Creates Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `package.json:31-34`; related installation instructions at `README.md:21-25` **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ### Vulnerable Code `package.json:31-34`: ```json "peerDependencies": { "mcporter": ">=0.7.0" }, ``` `README.md:21-25`: ```markdown ### 2. Install Dependencies ```bash npm install -g mcporter ``` ``` ### Technical Analysis The dependency declaration accepts every `mcporter` release from version 0.7.0 onward, while the documented installation command installs the registry's current default release globally. The project provides no exact version pin, lockfile, package integrity value, or documented publisher verification procedure. `mcporter` is security-sensitive in this project because it receives the token-bearing DingTalk MCP endpoint and processes document identifiers and document contents. Installing it globally also causes its executable to be available system-wide under the user's account. This does not prove that the current `mcporter` package is malicious. The vulnerability is the absence of controls ensuring that users install the same reviewed artifact over time. A compromised publisher account, malicious future release, or registry-level package substitution could therefore introduce code that was not covered by this audit. ### Attack Path 1. An attacker compromises the package publisher, publishing process, or package registry entry for a future `mcporter` release. 2. The malicious release remains compatible with the permissive `>=0.7.0` declaration. 3. A user follows the documented `npm install -g mcporter` command, which retrieves the current registry-selected release without an exact version or integrity check. 4. The malicious package executes installation-time code, or its executable runs when the Skill invokes `mcporter`. 5. The compromised executable receives DingTalk MCP requests and may access the confi ...[truncated 983 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `mcporter` to a reviewed exact version rather than using a lower-bound range: ```json "peerDependencies": { "mcporter": "0.7.0" } ``` 2. Change the installation instructions to specify the same reviewed version: ```bash npm install --save-dev --save-exact mcporter@0.7.0 ``` 3. Prefer a project-local dependency over a global installation, and invoke it through a package script or a locked package manager workflow. 4. Commit a lockfile containing resolved versions and integrity hashes. 5. Document the expected npm registry, package publisher, and package provenance. Where supported, verify package signatures or provenance attestations before installation. 6. Review dependency updates before changing the pin, including package ownership, install scripts, transitive dependencies, and release differences. 7. Run the dependency with the minimum necessary operating-system and DingTalk permissions, and avoid exposing unrelated environment variables or files to it. ]]>
