T08 · Insecure Dependencies
- Location
SKILL.md:55- Finding
Unpinned Third-Party Dependencies Create a Mutable Supply-Chain Risk
- Content
View full analysis
/dev/null || echo "❌ 缺少 websocket-client → pip3 install websocket-client" ``` ```bash # 安装依赖 npm install cloakbrowser playwright-core ``` Equivalent installation instructions also appear at `README.md:39` and `README.md:44`. ### Technical Analysis The installation instructions do not constrain dependency versions or verify package integrity. Consequently, the code installed by these commands can change after the Skill has been audited. The npm installation is particularly sensitive because npm packages can execute lifecycle scripts such as `preinstall`, `install`, and `postinstall`. Such scripts execute with the permissions of the user running npm. The Python package is also installed without a version constraint or hash verification. There is no evidence in the audited repository that the named packages are currently malicious. The vulnerability is the mutable and unverified dependency trust boundary. ### Attack Path 1. An attacker compromises the package registry account, package publication process, or a transitive dependency of one of the named packages. 2. The attacker publishes a malicious release under the same package name or introduces malicious code into a dependency selected by the unconstrained resolver. 3. A user follows the Skill instructions and runs `npm install cloakbrowser playwright-core` or `pip3 install websocket-client`. 4. The package manager retrieves the compromised version because no reviewed version or integrity hash is required. 5. Malicious npm lifecycle code or imported Python code executes with the installing user's privileges. 6. The malicious dependency can access local files and potentially interact with the authenticated browser session used by the Skill. ### ...[truncated 583 chars]- Remediation
View remediation
" npm install --save-exact "cloakbrowser@" "playwright-core@" ``` 2. Add a Python requirements file with hashes and install it using: ```bash pip3 install --require-hashes -r requirements.txt ``` 3. Commit an npm lockfile and use `npm ci` instead of unconstrained `npm install`. 4. Review transitive dependencies and npm lifecycle scripts before distribution. 5. Where lifecycle scripts are unnecessary, install with `npm ci --ignore-scripts`. 6. Document the expected package publisher, registry, version, and integrity values. 7. Run dependency installation in an isolated, non-privileged environment and never recommend `sudo`. ]]>
