T08 · Insecure Dependencies
- Location
PUBLISH.md:37- Finding
Execution of Unpinned npm Packages Through npx
- Content
View full analysis
Vulnerability Details
File Location:
PUBLISH.md:37-48
Vulnerability Type: Insecure third-party dependency execution
Risk Level: MediumVulnerable Code
bash npx clawhub@latest loginbash cd ~/openclaw/workspace/skills/just-note npx clawhub@latest publish . \ --slug just-note \ --name "记一下" \ --version 0.2.0 \ --changelog "MVP 完成:记录/查询/统计/导出功能,AI 自动分类" \ --tags "note,ai,knowledge,productivity"The same unsafe pattern also appears at
PUBLISH.md:81-87,PUBLISH.md:108-110,PUBLISH.md:172-201, andPUBLISH.md:228. Related unpinned global installation and execution instructions appear atpublish.sh:10-13andpublish.sh:85.Technical Analysis
The documentation directs users to obtain and execute
clawhub@latestfrom the npm registry. Thelatesttag is mutable, so the code executed when a user follows these instructions may differ from the code that existed when this project was audited.No exact dependency version, lockfile, package integrity hash, or provenance verification is specified.
npxmay download the package and execute its CLI immediately. npm package lifecycle behavior and transitive dependencies can also introduce executable code. The related recommendation to runnpm install -g clawhubinstalls similarly unpinned executable code globally.This is a supply-chain weakness rather than evidence that the current
clawhubpackage is malicious. Exploitation depends on compromise or malicious replacement of the package, its publisher account, registry metadata, or a transitive dependency.Attack Path
- An attacker compromises the npm publisher account, package, registry metadata, or a transitive dependency associated with
clawhub. - The attacker publishes a malicious release and assigns it to the mutable
latesttag, or introduces malicious install/runtime behavior into an unpinned version. - A user follows the project documentation and runs
npx clawhub@latest login, `publish ...[truncated 1136 chars]
- An attacker compromises the npm publisher account, package, registry metadata, or a transitive dependency associated with
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed version:bash npx --yes clawhub@X.Y.Z login npx --yes clawhub@X.Y.Z publish . - Verify the selected release's publisher, provenance, signatures, and published integrity metadata before recommending it.
- Document the expected package checksum or another trustworthy verification procedure where the package manager supports it.
- Avoid recommending
npm install -g clawhub. Prefer an exact-version, project-local development dependency governed by a committed lockfile. - Use
npm ciwith a committed lockfile for reproducible dependency resolution when integrating the CLI into automated workflows. - Run publishing operations in a restricted environment with minimal filesystem access and a narrowly scoped, short-lived publication token.
- Review the dependency tree and lifecycle scripts of the pinned version before adoption.
- Update every duplicate command in
PUBLISH.mdandpublish.shso users are not directed back to the mutable package reference. - Add automated checks that reject
@latest, unversionednpxexecution, and unpinned global installation commands in release documentation and scripts.
- Replace
