T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:14
- Finding
- Unpinned Third-Party npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 14-22 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash ## Installation # Global install npm install -g @marvae24/weibo-cli # Or local install (safer) npm install @marvae24/weibo-cli npx @marvae24/weibo-cli hot ``` ### Technical Analysis The skill instructs users or agents to install and execute `@marvae24/weibo-cli` without pinning an exact version or providing a lockfile, integrity hash, vendored source, or other mechanism for verifying the retrieved artifact. The audited project contains only `SKILL.md`; therefore, the dependency's implementation and the documentation's claims concerning API access, cookie processing, and retry behavior cannot be verified from the project. Both installation commands resolve a mutable package version from the npm registry. The `npx` command may retrieve and immediately execute that package. Global installation also increases exposure by placing the executable in the user's global command environment. The skill additionally states at line 27 that the package can consume the optional `WEIBO_COOKIE` environment variable. This is not evidence that the current package is malicious, but it means that malicious code introduced through a compromised or changed release could access an authenticated Weibo session cookie when the variable is present. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or a future package release. 2. The attacker publishes malicious code under the same package name and a version selected by npm's unpinned resolution. 3. A user or agent follows the skill instructions and runs `npm install`, `npm install -g`, or `npx`. 4. npm retrieves the mutable package release from the external registry. 5. Package lifecycle scripts or the invoked CLI execute with the privileges of the calling user. 6. The ma ...[truncated 868 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an exact, reviewed version rather than relying on the latest registry release. 2. Include a lockfile with npm integrity metadata and use `npm ci` for reproducible installation. 3. Provide a verifiable source-code repository and review the package implementation and lifecycle scripts before recommending execution. 4. Prefer a project-local installation over global installation, and invoke the pinned local binary. 5. Avoid allowing `npx` to download an unverified package at execution time; use an already verified local installation. 6. Execute the CLI in a restricted environment with minimal filesystem and network permissions. 7. Do not expose unrelated environment variables or credentials to the process. 8. If `WEIBO_COOKIE` is necessary, use a dedicated, minimally privileged session, avoid persistent plaintext storage, and rotate the session after suspected exposure. 9. Monitor the dependency for publisher changes, unexpected releases, ownership transfers, and reported supply-chain incidents.
