T08 · Insecure Dependencies
- Location
SKILL.md:13- Finding
Unpinned Global Installation of a Third-Party CLI
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 13
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumComplete Code Snippet:
markdown - **依赖工具**:已安装 `wenyan-cli` (`pnpm add -g @wenyan-md/cli`)。Technical Analysis
The documented command installs the latest available version of
@wenyan-md/cliglobally without a pinned version, project lockfile, or integrity verification. The effective package contents can therefore change after this Skill has been reviewed.Package installation may also run npm-compatible lifecycle scripts. If the package, one of its transitive dependencies, or a future release is compromised, installation could execute attacker-controlled code with the privileges of the user running
pnpm. Global installation unnecessarily broadens the trust and impact boundary.Attack Path
- An attacker compromises
@wenyan-md/cli, one of its transitive dependencies, or the relevant package-publishing account. - The attacker publishes a malicious release or causes a malicious dependency version to be resolved.
- A user follows the Skill's unpinned command:
bash pnpm add -g @wenyan-md/cli - The package manager retrieves the attacker-controlled version.
- Malicious package contents or lifecycle scripts execute with the installing user's privileges.
- If WeChat credentials are present in the process environment, the malicious code may attempt to read and disclose them or abuse them to interact with the associated WeChat account.
Impact Assessment
Successful exploitation could permit arbitrary code execution with the installing user's privileges. Accessible resources may include files readable or writable by that user, environment variables, package-manager configuration, and network-accessible services.
Because the Skill requires
WECHAT_APP_IDandWECHAT_APP_SECRET, those credentials may be exposed ...[truncated 325 chars]- An attacker compromises
- Remediation
View remediation
Remediation Suggestions
- Pin
@wenyan-md/clito a specifically reviewed version rather than resolving the latest release. - Install it as a project-local development dependency instead of globally:
bash pnpm add --save-dev --save-exact @wenyan-md/cli@<reviewed-version> - Commit the resulting
pnpm-lock.yamland use frozen-lockfile installation in controlled environments:bash pnpm install --frozen-lockfile - Verify package provenance, publisher identity, checksums, signatures, and lifecycle scripts before approving upgrades.
- Review transitive dependency changes whenever the pinned version or lockfile is updated.
- Run the publisher in a least-privileged, isolated environment with access limited to the required article assets and network destinations.
- Expose
WECHAT_APP_IDandWECHAT_APP_SECRETonly to the publishing process, not to dependency installation. Store them in an appropriate secret manager and rotate them if compromise is suspected.
- Pin
