T08 · Insecure Dependencies
Error
- Location
- SKILL.md:43
- Finding
- Unpinned Third-Party Package Installation Followed by Privileged Execution## Vulnerability Details **File Location**: `SKILL.md:43-52`; additional occurrence in `references/commands.md:134-139` **Vulnerability Type**: Supply-chain compromise through unpinned dependencies **Risk Level**: High ### Vulnerable Code ```bash which wechat-cli ``` ```bash npm install -g @canghe_ai/wechat-cli # or pip install wechat-cli ``` ```bash sudo wechat-cli init ``` ### Technical Analysis The skill instructs users to install a mutable package from either npm or PyPI without specifying an exact version, integrity hash, trusted source repository, or signature. The npm and PyPI package names also differ, and the project does not establish that they are equivalent or maintained by the same trusted publisher. After installation, the resulting executable is invoked using `sudo`. This creates a supply-chain trust boundary in which package installation scripts or the installed command can execute attacker-controlled code, potentially with root privileges. Because the dependency source is not included in the audited project, its behavior cannot be independently verified by this audit. ### Attack Path 1. An attacker compromises the package publisher account, package registry entry, or upstream release process. 2. Alternatively, an unsafe or unrelated package is published under one of the documented names. 3. A user follows the skill instructions and installs the latest mutable package globally. 4. Malicious package lifecycle hooks may execute during installation. 5. The user then executes `sudo wechat-cli init`. 6. Malicious code in the installed executable runs with root privileges and can access or modify protected resources. ### Impact Assessment Successful exploitation could result in arbitrary code execution. Global package installation affects the user's broader development environment, while subsequent execution with `sudo` could permit system-wide file modification, credential theft, install ...[truncated 90 chars]
- Remediation
- ## Remediation Suggestions - Identify and document one canonical, verified package and its official source repository. - Pin an exact reviewed package version rather than installing the latest release. - Verify package integrity using registry checksums, lockfiles, signed releases, or published hashes. - Do not present unrelated npm and PyPI packages as interchangeable without verification. - Disable package installation scripts where supported and review all required lifecycle hooks. - Avoid global installation when a dedicated virtual environment or isolated local installation is sufficient. - Remove the `sudo` invocation and perform initialization as an unprivileged user whenever possible. - If privileged setup is unavoidable, use a small, separately reviewed helper with narrowly defined operations rather than running the entire third-party CLI as root.
