T08 · Insecure Dependencies
Warning
- Location
- skill.md:14
- Finding
- Unpinned Third-Party Code Installation and Execution## Vulnerability Details **File Location**: `skill.md:14-24` and `skill.md:38-55` **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium The Skill instructs users to install and execute third-party code without pinning a package version or repository commit: ```yaml "install": [ { "id": "npm", "kind": "shell", "label": "Install wechat-public-cli (npm)", "command": "npm install -g wechat-public-cli", }, { "id": "git", "kind": "shell", "label": "Clone repo and install dependencies", "command": "git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git && cd obsidian-wechat-public-platform && npm install", }, ], ``` The documentation also provides mutable installation and execution commands: ```bash git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git cd obsidian-wechat-public-platform npm install npm install -g wechat-public-cli npx wechat-public-cli wechat:draft --file /path/to/article.md ``` ### Technical Analysis The npm commands do not specify an audited package version, and the Git command clones the repository's mutable default branch rather than a verified commit or signed release. Consequently, the code retrieved when these instructions are followed may differ from the code that existed when the Skill was audited. Both `npm install` and `npx` can execute package lifecycle scripts or package binaries. In particular, `npx` may retrieve and immediately execute the currently resolved package release. The global installation command also installs executable code outside the project-local dependency boundary. No malicious code was identified in the supplied project files. The risk arises from trusting mutable external package and repository sources without ve ...[truncated 1474 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the npm package to a specific reviewed version instead of installing the latest mutable release: ```bash npm install --save-exact wechat-public-cli@<reviewed-version> ``` 2. Prefer a project-local installation over `npm install -g` and invoke the pinned binary through a package script. 3. Replace the mutable Git clone workflow with checkout of a reviewed full commit hash: ```bash git clone https://github.com/ai-chen2050/obsidian-wechat-public-platform.git cd obsidian-wechat-public-platform git checkout --detach <reviewed-full-commit-hash> ``` 4. Verify release signatures, commit signatures, checksums, or npm package provenance before execution. 5. Commit a reviewed lockfile and use `npm ci` so transitive dependency resolution is reproducible. 6. Avoid `npx` commands that automatically download an unspecified package. Use the explicitly pinned local binary instead. 7. Review dependency lifecycle scripts before installation and, where operationally compatible, install with scripts disabled before explicitly running only trusted build steps. 8. Run the CLI with least privilege in an isolated environment and expose only the credentials and files required for the selected operation. 9. Restrict platform credentials to the minimum required permissions and rotate them immediately if dependency compromise is suspected.
