T08 · Insecure Dependencies
- Location
.github/workflows/clawhub-publish.yml:16- Finding
Unpinned ClawHub CLI Dependency in Publishing Workflow
- Content
View full analysis
Vulnerability Details
File Location:
.github/workflows/clawhub-publish.yml, lines 16–18
Vulnerability Type: Supply-chain risk caused by a mutable npm dependency
Risk Level: MediumVulnerable Code
yaml - name: Install ClawHub CLI run: npm install -g clawhub@latestTechnical Analysis
The publishing workflow installs
clawhub@latestat runtime. Thelatestnpm tag is mutable, so the workflow may execute a package version that was never reviewed by the repository maintainers. npm installation can also run package lifecycle scripts, giving the resolved package and its dependency chain an opportunity to execute code on the GitHub Actions runner.If the
clawhubpackage, its maintainer account, its release process, or a transitive dependency is compromised, a malicious version can execute during installation. Because the installation and publication steps share the same job and runner, malicious installation code could modify the checked-out Skill, replace installed tooling, tamper with files under the runner's home directory, or establish a process or hook that affects the later publication step.Although
CLAWHUB_TOKENis only explicitly supplied to the subsequent publication step, this separation does not fully isolate it from earlier runner compromise. Malicious code that persists within the job could replace theclawhubexecutable or otherwise intercept the publication command when the token becomes available.Attack Path
- An attacker compromises the
clawhubnpm package, a relevant maintainer account, or a transitive dependency. - The attacker publishes a malicious release and causes the mutable
latesttag to resolve to it. - A push to
mainor a manual workflow dispatch starts the publishing job. npm install -g clawhub@latestdownloads the attacker-controlled release.- Malicious package lifecycle code executes on the GitHub Actions runner, or the installed CLI itself is replaced with malicious b ...[truncated 1077 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
-
Replace the mutable
latesttag with a reviewed, exact package version:yaml - name: Install ClawHub CLI run: npm install --global --ignore-scripts clawhub@X.Y.ZUse
--ignore-scriptsonly if the verified CLI does not require lifecycle scripts. -
Prefer installing the CLI as a repository development dependency using an npm lockfile. Use
npm ciso dependency versions and integrity hashes are enforced, then invoke it withnpx --no-install clawhub. -
Update the pinned version only through reviewed dependency-update pull requests. Validate release provenance, package ownership, changelog, integrity metadata, and dependency changes before merging.
-
Separate dependency installation and publication into isolated jobs or environments where practical. Pass only a verified artifact into the credential-bearing publication job.
-
Protect
CLAWHUB_TOKENwith least privilege, restrict its publication scope to the intended owner or package, rotate it after suspected workflow compromise, and apply protected GitHub environments with required approval for publishing. -
Pin GitHub Actions to audited commit SHAs rather than mutable major-version tags to further reduce workflow supply-chain exposure.
-
