T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:47
- Finding
- Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 47 and 80 **Vulnerability Type**: Unpinned package installation from third-party registries **Risk Level**: Medium ### Vulnerable Code ```markdown - 通过:≥ 0.9.0 | 未通过:提示 `npm install -g mcporter` ``` ```markdown - 通过:✅ | 未通过:提示 `pip install python-docx`(仅影响DOCX输出,MD仍可生成) ``` ### Technical Analysis The Skill instructs users or an executing Agent to install `mcporter` and `python-docx` without specifying reviewed versions or validating package integrity. Consequently, each installation resolves to whatever package version the configured npm or Python package registry serves at execution time. The `mcporter` instruction additionally uses npm's global installation mode. Package installation scripts can execute with the privileges of the user running npm, and a global installation exposes the resulting executable across that user's environment. The Python installation instruction likewise lacks a version constraint, hash verification, lockfile, or isolated environment requirement. This creates a supply-chain risk if a package publisher account, registry, dependency, DNS route, package mirror, or future release is compromised. The package names are not demonstrated to be malicious; exploitation depends on compromise or substitution of a dependency source. ### Attack Path 1. An attacker compromises a package publisher, dependency, configured registry or mirror, or otherwise causes a malicious package version to be served. 2. The required dependency is absent from the target environment. 3. The Agent or user follows the Skill's installation instruction: - `npm install -g mcporter`, or - `pip install python-docx`. 4. The package manager downloads the unreviewed current version without integrity validation against a project-controlled lockfile or hash. 5. Malicious installation hooks or imported package code execute under the installing user's account. 6. The attacker can act within that ...[truncated 675 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to a reviewed exact version instead of installing the latest available release. 2. Use lockfiles and package-manager integrity controls: - Commit an npm lockfile and use `npm ci`. - Use a hashed Python requirements file and install with `pip install --require-hashes -r requirements.txt`. 3. Verify package publisher identity, registry origin, release signatures, and checksums before installation. 4. Avoid global npm installation. Install `mcporter` in a dedicated project environment and invoke the locally pinned executable. 5. Install Python dependencies in an isolated virtual environment with minimal filesystem and network permissions. 6. Disable or carefully review npm lifecycle scripts where operationally possible. 7. Document trusted package registries and reject unapproved mirrors or registry overrides. 8. Periodically scan the pinned dependency graph for compromised, malicious, or vulnerable releases. ]]>
