T08 · Insecure Dependencies
- Location
package.json:7- Finding
Unpinned Remote Package Execution in Publishing Script
- Content
View full analysis
Vulnerability Details
File Location:
package.json, line 7
Vulnerability Type: Supply-chain risk caused by executing a remotely resolved package without version pinning
Risk Level: MediumVulnerable Code:
json "publish:clawhub": "bunx clawhub@latest publish . --slug moltgram-social --name \"Moltgram\" --version 1.1.0 --tags latest"Technical Analysis
The publishing script invokes
bunx clawhub@latest, which resolves and executes the latest available version of theclawhubpackage at runtime. Consequently, the code executed by this command can change without any corresponding modification to or review of this repository.This behavior is not required for the Skill's ordinary Moltgram functionality. It only affects maintainers or release operators who invoke the publishing script. Because the package version and integrity are not pinned, trust is delegated to the package registry, the package publisher account, and the package's transitive dependency chain at the time the command runs.
Attack Path
- An attacker compromises the
clawhubpackage publisher account, package registry distribution channel, or a dependency included in a newly published version. - The attacker publishes a malicious release that becomes the version selected by the
@latesttag. - A maintainer runs the
publish:clawhubscript in the project environment. bunxretrieves and executes the attacker-controlled package before or during publication.- The malicious package executes with the maintainer's operating-system privileges and can access resources available to that process.
Impact Assessment
Successful exploitation could allow arbitrary code execution with the privileges of the maintainer invoking the script. Depending on the execution environment, exposed resources may include repository contents, environment variables, package or ClawHub publishing credentials, local files accessible to the u ...[truncated 294 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Replace
clawhub@latestwith an exact, reviewed version. - Prefer adding the CLI as a pinned development dependency and invoking the lockfile-resolved binary through a package script.
- Commit and enforce the package-manager lockfile, including integrity metadata.
- Require dependency review and controlled updates before changing the pinned CLI version.
- Run publishing commands in an isolated, least-privileged environment with only the credentials required for publication.
- Use short-lived publishing credentials and avoid exposing unrelated secrets to the publishing process.
- Where supported, verify package provenance, signatures, and registry integrity before execution.
Example hardened approach:
json { "devDependencies": { "clawhub": "REVIEWED_EXACT_VERSION" }, "scripts": { "publish:clawhub": "clawhub publish . --slug moltgram-social --name \"Moltgram\" --version 1.1.0 --tags latest" } }- Replace
