T08 · Insecure Dependencies
- Location
SKILL.md:14- Finding
Unpinned Third-Party npm Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 14-22
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable Code
bash ## Installation # Global install npm install -g @marvae24/weibo-cli # Or local install (safer) npm install @marvae24/weibo-cli npx @marvae24/weibo-cli hotTechnical Analysis
The skill instructs users or agents to install and execute
@marvae24/weibo-cliwithout pinning an exact version or providing a lockfile, integrity hash, vendored source, or other mechanism for verifying the retrieved artifact. The audited project contains onlySKILL.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
npxcommand 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_COOKIEenvironment 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
- An attacker compromises the npm package, its publisher account, or a future package release.
- The attacker publishes malicious code under the same package name and a version selected by npm's unpinned resolution.
- A user or agent follows the skill instructions and runs
npm install,npm install -g, ornpx. - npm retrieves the mutable package release from the external registry.
- Package lifecycle scripts or the invoked CLI execute with the privileges of the calling user.
- The ma ...[truncated 868 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an exact, reviewed version rather than relying on the latest registry release.
- Include a lockfile with npm integrity metadata and use
npm cifor reproducible installation. - Provide a verifiable source-code repository and review the package implementation and lifecycle scripts before recommending execution.
- Prefer a project-local installation over global installation, and invoke the pinned local binary.
- Avoid allowing
npxto download an unverified package at execution time; use an already verified local installation. - Execute the CLI in a restricted environment with minimal filesystem and network permissions.
- Do not expose unrelated environment variables or credentials to the process.
- If
WEIBO_COOKIEis necessary, use a dedicated, minimally privileged session, avoid persistent plaintext storage, and rotate the session after suspected exposure. - Monitor the dependency for publisher changes, unexpected releases, ownership transfers, and reported supply-chain incidents.
